HKUDS/DeepTutor · error · ValueError

No spine for book {book_id}

Error message

No spine for book {book_id}

What it means

Error "No spine for book {book_id}" thrown in HKUDS/DeepTutor.

Source

Thrown at deeptutor/book/engine.py:782

        book_id: str,
        edited_spine: Spine | None = None,
        stream: StreamBus | None = None,
        auto_compile: bool = True,
    ) -> list[Page]:
        """User confirms (or edits) the spine → create pending page shells.

        BookEngine v2: automatically injects an **Overview** chapter at order 0
        whose page is fully pre-built (deterministic concept-graph render +
        intro text + chapter index). The rest of the chapters are queued for
        normal compilation.
        """
        book = self.storage.load_book(book_id)
        if book is None:
            raise ValueError(f"Book {book_id} not found")

        spine = edited_spine or self.storage.load_spine(book_id)
        if spine is None:
            raise ValueError(f"No spine for book {book_id}")
        if edited_spine is not None:
            spine.book_id = book_id
            self.storage.save_spine(spine)

        # Chapters the reader deleted must not survive on the concept map.
        dropped = _prune_concept_graph(spine)
        if dropped:
            self.storage.append_log(
                book_id,
                f"pruned {dropped} concept-graph node(s) for deleted chapters",
                op="confirm_spine",
            )

        # ── Inject Overview chapter (idempotent) ─────────────────────
        spine = await self._ensure_overview_chapter(spine, book, stream=stream)
        self.storage.save_spine(spine)

        existing = {p.chapter_id: p for p in self.storage.list_pages(book_id)}

View on GitHub (pinned to 3e82f13042)

When it happens

Trigger: Thrown at deeptutor/book/engine.py:782 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/27bbbe6e4158174c. Report an issue: GitHub.