feat(F-09): rich parsing — formula + figure extraction #1
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/F-09-rich-parsing"
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
codex/parsing/mathpix.py: pix2tex (lokal, CPU) als primärer Pfad + MathPix API als optionales Cloud-Upgrade; Singleton-Model-Cache; Bbox-Heuristik h>15px / math-char-count>5;try/finallyfür fitz-Doc-Closecodex/parsing/figures.py: pymupdf Embedded-Image → PNG-Export; Caption-Proximity-Detection (60pt, "Figure/Fig./Abbildung"-Prefix);try/finallyfür fitz-Doc-Closecodex/models.py:FormulaChunk+FigureChunkDataclassescodex/ingest.py:--richFlag; DELETE-before-INSERT für Idempotenz bei Re-Ingestcodex/cli.py:search_appSub-Typer (paper + formula Subcommands);--richon ingestcodex/config.py:mathpix_app_id/key,pix2tex_fallback,figures_dirinfra/schema.sql:formulas+figuresTabellen mit HNSW pgvector-Indexpyproject.toml:pymupdf>=1.24,pix2tex>=0.1.4tests/parsing/test_mathpix.py+test_figures.py: 31 Tests (mock pix2tex + MathPix HTTP)Requirements
R-10 R-11 R-12 R-13 R-14 → done
Test plan
uv run pytest tests/ -q— 158 passed, 0 faileduv run ruff check .— cleanuv run mypy codex/— clean (20 files, strict)🤖 Generated with Claude Code