fix(ingest): support .txt sources + fix citing_id FK violation #7
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/ingest-txt-and-citing-id"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two bugs found during the first full batch ingest run (29 papers → Jetson DB via SSH tunnel):
Bug 1 —
.txtfiles silently skippedingest.pyonly handled.texand.pdfextensions;.txtfell through tologger.warning("Unbekannter Dateityp")and produced 0 chunkselif suffix == ".txt": text = Path(source_path).read_text(...)branchBug 2 —
citing_idFK violation after D-03openalex_id=None→ SemanticScholar fallback → S2 used arXiv ID asciting_id=paper.id✓paper.id = 'https://doi.org/…'butfetch_citations()returnsciting_id = openalex_id = 'https://openalex.org/W…'→ FK constraintcitations_citing_id_fkey → papers.idviolatedciting_idtopaper.idafter fetching from OpenAlexTest plan
uv run pytest tests/ingest/passes.txtsource → chunks > 0Two bugs exposed during first batch ingest run after D-03 fix: 1. `.txt` files were silently skipped ("Unbekannter Dateityp") — added plain-text read path alongside .tex and .pdf. 2. After D-03, OpenAlex resolves arXiv IDs → paper.id uses the DOI (https://doi.org/…) but fetch_citations emits citing_id=openalex_id (https://openalex.org/W…). FK constraint citations_citing_id_fkey → papers.id violated. Fix: rewrite citing_id to paper.id after fetching from OpenAlex. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>