-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
π Description
Add an input-side validation layer to reject incomplete incident data before PDF generation. This validates that required fields like incident_type, location, and time are present and non-empty before data proceeds further in the pipeline.
π‘ Rationale
Currently, incomplete or malformed incident data can enter the pipeline and lead to invalid PDF generation or downstream failures. Adding a validation gate improves reliability and prevents bad data from reaching the PDF filler stage.
π οΈ Proposed Solution
- Logic change in
src/ - Update to
requirements.txt - New prompt for Mistral/Ollama
Implementation outline:
- Add
validate_incident()insrc/validator.py - Validate required fields before PDF filling
- Return deterministic error messages for missing or empty fields
- Add unit tests for valid input, missing fields, empty fields, whitespace-only fields, and invalid input type
- Integrate validation into
src/file_manipulator.py
β Acceptance Criteria
- Feature works in Docker container.
- Documentation updated in
docs/. - Input incident data is validated before PDF fill.
Definition of done:
validate_incident()returns[]for valid incident data- Missing required fields produce deterministic error messages
- Empty or whitespace-only required fields produce deterministic error messages
- Unit tests cover all validation cases and pass locally
- Validation runs before PDF fill logic
π Additional Context
PR already opened: #304
This is distinct from #114:
- This contribution validates input completeness before PDF filling
- [FEAT]: Schema Validation + Error RecoveryΒ #114 focuses on output/schema validation after LLM extraction
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels