{"record":{"id":"3dc78ea1be0f509b","repo":"HKUDS/DeepTutor","slug":"objective-not-found","errorCode":null,"errorMessage":"Objective not found","messagePattern":"Objective not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"deeptutor/api/routers/mastery_path.py","lineNumber":220,"sourceCode":"    }\n\n\n@router.get(\"/progress/{book_id}/objectives/{kp_id}\")\nasync def get_objective_report(book_id: str, kp_id: str):\n    \"\"\"The evidence behind one objective: attempts, schedule, errors, prompts.\n\n    ``policy.objective_report`` is pure over the aggregate, so the questions\n    themselves — which live in the durable interaction log, not the aggregate —\n    are joined on here, redacted of their answer keys.\n    \"\"\"\n    _validate_book_id(book_id)\n    store = LearningStore()\n    progress = await asyncio.to_thread(store.load, book_id)\n    if progress is None:\n        raise HTTPException(status_code=404, detail=\"Progress not found\")\n    report = learning_policy.objective_report(progress, kp_id)\n    if report is None:\n        raise HTTPException(status_code=404, detail=\"Objective not found\")\n\n    from deeptutor.learning.pending import public_pending_question\n\n    interactions = await asyncio.to_thread(store.list_interactions, book_id)\n    prompts = {\n        interaction.interaction_id: public_pending_question(interaction.question).prompt\n        for interaction in interactions\n    }\n    for attempt in report[\"attempts\"]:\n        attempt[\"prompt\"] = prompts.get(attempt[\"question_id\"], \"\")\n    return {\"book_id\": book_id, \"path_revision\": progress.version, \"objective\": report}\n\n\n@router.get(\"/progress/{book_id}/events\")\nasync def get_progress_events(book_id: str, after_revision: int = 0):\n    \"\"\"Ordered, redacted domain events for reconnect and incremental UI sync.\"\"\"\n    _validate_book_id(book_id)\n    store = LearningStore()","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/mastery_path.py#L202-L238","documentation":"Error \"Objective not found\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/api/routers/mastery_path.py:220 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"}