Richie c7cd63f8e4 feat(ebook): migrate to async DB/HTTP and parallelize phrase pipeline
Convert the ebook-search web app to async end to end and add concurrency
to the protected-phrase extraction and judging pipeline so large books no
longer block the event loop or the UI.

ORM / infra:
- Add get_async_postgres_engine and factor shared URL/connect_args building
  into build_postgres_url (reused by the sync and async engine builders)
- Add async FastAPI session helpers (get_async_db, AsyncDbSession) with
  expire_on_commit=False to avoid implicit IO under asyncio

App:
- Use AsyncEngine/AsyncSession throughout routes, search, ingest, embeddings,
  answer, rerank and LLM calls; convert handlers to async
- Share a single httpx.AsyncClient in app state for LLM requests; size the
  connection pool for concurrent phrase-judging workers
- Add judge_tasks: run per-book judging as tracked background tasks so a
  book already being judged isn't double-queued

Protected phrases:
- Add a process pool (pool.py) and worker-count config
  (extraction/judge book/phrase workers) to parallelize candidate generation
  and judging
- Split admin actions into all/missing variants for generation and judging

Config:
- Add protected_phrase_extraction_workers, phrase_judge_book_workers,
  phrase_judge_phrase_workers
2026-07-09 11:04:59 -04:00
2026-06-18 12:55:46 -04:00
2026-05-14 15:12:53 -04:00
2026-05-14 15:12:53 -04:00
2025-12-06 12:33:10 -05:00
2026-06-14 15:40:31 -04:00
2024-08-24 17:53:37 -04:00
2025-11-08 08:21:27 -05:00
2025-10-31 22:37:54 -04:00

dotfiles

Installer ISO

Build a bootable NixOS ISO with the installer preinstalled:

nix build .#iso

Write result/iso/nixos-zfs-installer.iso to a USB stick (for example with dd) or boot it in a VM. The image is the minimal NixOS installation CD with ZFS enabled and nixos-installer on PATH. SSH is enabled and the nixos and root accounts use the password nixos, so you can also run the installer remotely. Once booted:

sudo nixos-installer

The ISO bundles the .#installer-nixos package, a variant of the binary that keeps its Nix store linkage instead of being patched for foreign distributions.

Installer binary

Build the self-contained installer executable with:

nix build .#installer

The flake package (defined in python/installer/package.nix) uses the Python builder in python/installer/build.py, which stages only the installer modules before running PyInstaller. You can also call it directly when pyinstaller and patchelf are on PATH:

python -m python.installer.build --output ./nixos-installer

Copy result/bin/nixos-installer to the installer USB stick and run it as root from the NixOS live environment:

sudo ./nixos-installer

Validate the live environment first with:

./nixos-installer --check

Paste a value into the TUI encryption password field to enable LUKS during install, or set ENCRYPT_KEY:

sudo env ENCRYPT_KEY='change-me' ./nixos-installer

The binary bundles the Python runtime and only the installer modules it imports. It still expects the NixOS installer environment to provide system install tools such as parted, zfs, zpool, cryptsetup, nixos-generate-config, and nixos-install.

S
Description
No description provided
Readme MIT
13 MiB
Languages
Python 82.9%
Nix 12%
HTML 3.8%
CSS 0.7%
Shell 0.3%
Other 0.2%