Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

1.5 KB
Raw Blame
"""Catalog identifiers for arXiv HTML-extracted text provenance.

``LibraryDocument.extraction_method`` and ``.extraction_source``
(``database/models/library.py``) are plain unconstrained strings, not
SQLAlchemy ``Enum`` columns, so adding a new catalog value never changes
the schema Alembic ships -- see the docstring on ``ExtractionMethod`` /
``ExtractionSource`` in that file.

The ``"html_extraction"`` / ``"arxiv_html"`` values ``DownloadService``
persists for an HTML-extracted arXiv download (see
``_arxiv_text_provenance`` in
``research_library/services/download_service.py``) are defined here,
outside ``database/models/``, rather than as new members on the
pre-existing enums in ``library.py``. That keeps every file under
``database/models/`` byte-identical to the merge base, which two tests
enforce:

* ``test_migration_chain_integrity.py::test_every_file_behind_the_alembic_metadata_is_unchanged_since_the_fork``
* ``test_upgrade_from_pre_migration_install.py::test_pr_changes_no_orm_model``

Both treat any edit to a file backing ``Base.metadata`` (or anything
under ``database/models/``) as presumed schema drift, regardless of
whether the specific edit actually changes a column -- so a value that
does not need to live there should not.
"""

import enum


class ExtractionMethodExtra(str, enum.Enum):
    """Extraction-method catalog values added after the merge base."""

    HTML_EXTRACTION = "html_extraction"


class ExtractionSourceExtra(str, enum.Enum):
    """Extraction-source catalog values added after the merge base."""

    ARXIV_HTML = "arxiv_html"