{"record":{"id":"709573b217280f2f","repo":"HKUDS/DeepTutor","slug":"cannot-compile-page-missing-book-spine-page-bo","errorCode":null,"errorMessage":"Cannot compile page – missing book/spine/page ({book_id}/{page_id})","messagePattern":"Cannot compile page – missing book/spine/page \\((.+?)/(.+?)\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"deeptutor/book/engine.py","lineNumber":1082,"sourceCode":"        rebuild cannot evict its successor.\n        \"\"\"\n        if runtime.in_flight.get(page_id) is task:\n            runtime.in_flight.pop(page_id, None)\n\n    async def _compile_page_now(\n        self,\n        *,\n        book_id: str,\n        page_id: str,\n        stream: StreamBus | None = None,\n        force: bool = False,\n    ) -> Page:\n        \"\"\"Drive the compiler for one page. Always run via :meth:`compile_page`.\"\"\"\n        book = self.storage.load_book(book_id)\n        spine = self.storage.load_spine(book_id)\n        page = self.storage.load_page(book_id, page_id)\n        if book is None or spine is None or page is None:\n            raise ValueError(f\"Cannot compile page – missing book/spine/page ({book_id}/{page_id})\")\n        if page.status == PageStatus.READY and not force:\n            return page\n\n        # Overview pages are built deterministically from the spine (intro,\n        # concept graph, chapter index). Never run the generic LLM compiler over\n        # their hand-built blocks — that would overwrite the deterministic\n        # \"How to read this book\" intro and chapter index with hallucinated\n        # prose. Reaching here means force=True or the page is not yet READY, so\n        # rebuild deterministically (this also refreshes a changed spine).\n        if page.content_type == ContentType.OVERVIEW:\n            page.status = PageStatus.PENDING\n            self.storage.save_page(page)\n            await self._materialize_overview_page(spine, [page], book, stream=stream)\n            page = self.storage.load_page(book_id, page_id) or page\n            await self._maybe_finalize_book(book_id)\n            return page\n\n        if force:","sourceCodeStart":1064,"sourceCodeEnd":1100,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/book/engine.py#L1064-L1100","documentation":"Error \"Cannot compile page – missing book/spine/page ({book_id}/{page_id})\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/book/engine.py:1082 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}