`extract.book_structure.detect` splits books using the PDF's embedded TOC (`pymupdf.get_toc()`) or the EPUB spine. When a PDF has neither — scanned or badly-produced files — the book stays as a single item and the "chapters as first-class items" feature (plan §6 Phase 6a) silently skips it.
Plan hint at the time:
PDF second (pymupdf bookmark tree; fall back to GROBID's `processFullText` when bookmarks are missing)
Proposal
- When `detect()` returns `None` for a PDF, optionally call GROBID's `/api/processFulltextDocument` (already wrapped via `extract.grobid` — only the header endpoint is used today).
- Parse the TEI response for `<div type="chapter">` or top-level `` structures.
- Convert to `ChapterSpec` entries.
- Opt-in via a config flag (`GRIMOIRE_GROBID_FULLTEXT_FALLBACK=true`) — the endpoint is 3–10 s per PDF and not always reliable.
Acceptance
`extract.book_structure.detect` splits books using the PDF's embedded TOC (`pymupdf.get_toc()`) or the EPUB spine. When a PDF has neither — scanned or badly-produced files — the book stays as a single item and the "chapters as first-class items" feature (plan §6 Phase 6a) silently skips it.
Plan hint at the time:
Proposal
Acceptance