HKUDS/DeepTutor · error · HTTPException

Objective not found

Error message

Objective not found

What it means

Error "Objective not found" thrown in HKUDS/DeepTutor.

Source

Thrown at deeptutor/api/routers/mastery_path.py:220

    }


@router.get("/progress/{book_id}/objectives/{kp_id}")
async def get_objective_report(book_id: str, kp_id: str):
    """The evidence behind one objective: attempts, schedule, errors, prompts.

    ``policy.objective_report`` is pure over the aggregate, so the questions
    themselves — which live in the durable interaction log, not the aggregate —
    are joined on here, redacted of their answer keys.
    """
    _validate_book_id(book_id)
    store = LearningStore()
    progress = await asyncio.to_thread(store.load, book_id)
    if progress is None:
        raise HTTPException(status_code=404, detail="Progress not found")
    report = learning_policy.objective_report(progress, kp_id)
    if report is None:
        raise HTTPException(status_code=404, detail="Objective not found")

    from deeptutor.learning.pending import public_pending_question

    interactions = await asyncio.to_thread(store.list_interactions, book_id)
    prompts = {
        interaction.interaction_id: public_pending_question(interaction.question).prompt
        for interaction in interactions
    }
    for attempt in report["attempts"]:
        attempt["prompt"] = prompts.get(attempt["question_id"], "")
    return {"book_id": book_id, "path_revision": progress.version, "objective": report}


@router.get("/progress/{book_id}/events")
async def get_progress_events(book_id: str, after_revision: int = 0):
    """Ordered, redacted domain events for reconnect and incremental UI sync."""
    _validate_book_id(book_id)
    store = LearningStore()

View on GitHub (pinned to 3e82f13042)

When it happens

Trigger: Thrown at deeptutor/api/routers/mastery_path.py:220 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/3dc78ea1be0f509b. Report an issue: GitHub.