# Task 04 — Schema Profiling & Fingerprints ## Goal Capture the record structure of every CSV without full load; compute schema fingerprints. ## Input - `manifest/inventory.jsonl`, `manifest/tokens.jsonl`; sample sizes from `pipeline.json`. ## Actions 1. Write `scripts/profile_schema.py` (streaming; head N + tail N + random M rows only). 2. Per file capture: delimiter, header presence, column names (raw, ordered), column count, inferred dtype per column, null-rate in sample, min/max of numeric columns in sample, total row estimate (size/avg-row-len). 3. Fingerprint = hash of normalized ordered column-name list (lowercased, trimmed). Also compute a name-insensitive positional fingerprint (dtype sequence) for headerless files. 4. Emit `manifest/schema_profiles.jsonl`; add table `schema_profiles` to `manifest.sqlite`. 5. Log unreadable/malformed files to `manifest/profile_errors.csv`. ## Intermediate Result (done when) - 100% of CSV files have a profile row or an entry in `profile_errors.csv`. - Every profile carries a fingerprint.