- bootstrap.py: ensure_corpus() downloads corpus from HF dataset repo on first
run; no-op when both corpus_dir and faiss_path already exist
- main.py: replace deprecated @app.on_event("startup") with lifespan context
manager; wire in ensure_corpus before get_corpus; mount frontend/dist at /
for SPA serving (API routes registered first, take precedence)
- Dockerfile: two-stage build (node:20-slim → python:3.11-slim + uv); all
runtime data under /data (corpus, faiss, figures, sqlite, HF cache)
- .dockerignore: excludes node_modules, backend/data, .venv, prototype/, docs/
- README.md: prepend HF Spaces YAML frontmatter (docker SDK, port 7860)
- pyproject.toml: add huggingface-hub>=0.23 as explicit dependency
- tests/test_bootstrap.py: 3 new tests (no-op + download paths); 70 total green
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>