Module 08 Activity
Scenario
Users will upload files, and files are the least trustworthy input you will handle.
What you build
A file pipeline that rejects safely, chunks on sentences, extracts against a schema, and cites which part of the file an answer came from.
Steps
- Check encoding, emptiness and binary content before any file reaches a prompt. Construct one failing example of each.
- Chunk on sentence boundaries and measure how many chunks end at one.
- Extract structured records with a schema that includes bounds and patterns, not just types.
- List the qualifiers that must survive a summary and check for them mechanically.
- Cite the file and chunk in every answer, and run a term check against the cited text.
- Report the rejection rate by reason.
Evidence to hand in
- Three failing files with distinct reasons.
- Chunk boundary completeness at your chosen size.
- The extraction schema with bounds.
- The qualifier check on three summaries.
- An answer with citations and its term check.
- Rejection rates by reason.
Review checklist
errors="ignore"is not used anywhere.- Chunks end at sentence boundaries.
- The extraction schema rejects a negative amount.
- Qualifier survival is checked mechanically.
- Citations name a file and a chunk, not just a document.
