--- id: ESRC-WP-0003 type: workplan title: "Document metadata enrichment beyond pass-through options" domain: infotech repo: evidence-source status: finished owner: codex topic_slug: citation_evidence_mvp created: "2026-07-08" updated: "2026-07-09" spec_refs: - README.md - src/pdf/ingest.ts - src/pdf/metadata.ts state_hub_workstream_id: "16444f5e-93f2-5a7f-a2f1-92284315d041" --- # ESRC-WP-0003 — Metadata enrichment Today `ingestPdf` only passes through caller-supplied `title`/`uri`/`metadata`. This workplan extracts intrinsic document metadata (PDF info dictionary, embedded XMP, page-derived signals like author/creation date/title) and folds it into the `Document` record without breaking the pure-over-bytes contract. ## Sketch ```task id: ESRC-WP-0003-T01 status: done priority: low state_hub_task_id: "01187f2c-f6fa-549e-91ad-a0acc46bcd36" ``` Enumerate available PDF metadata sources (info dict, XMP) via PDF.js and decide precedence vs. caller-supplied options (caller wins). ```task id: ESRC-WP-0003-T02 status: done priority: low state_hub_task_id: "95176499-3ae7-586d-bce4-a96c075632ab" ``` Implement extraction into a normalized metadata shape; keep it optional so minimal-metadata PDFs still ingest cleanly. ```task id: ESRC-WP-0003-T03 status: done priority: low state_hub_task_id: "83fa3027-61f7-5bb9-95ce-ffbe58c90ebd" ``` Contract tests over the fixture corpus asserting extracted vs. overridden metadata precedence.