{"record":{"id":"22618b9e0fc27253","repo":"HKUDS/DeepTutor","slug":"unknown-surface-surface-r","errorCode":null,"errorMessage":"unknown surface {surface!r}","messagePattern":"unknown surface (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"deeptutor/api/routers/memory.py","lineNumber":77,"sourceCode":"# ── Helpers ──────────────────────────────────────────────────────────────\n\n\ndef _validate_doc_key(layer: Layer, key: str) -> None:\n    if layer == \"L2\" and key not in SURFACES:\n        raise HTTPException(status_code=404, detail=f\"unknown surface {key!r}\")\n    if layer == \"L3\" and key not in L3_SLOTS:\n        raise HTTPException(status_code=404, detail=f\"unknown L3 slot {key!r}\")\n\n\ndef _validate_layer(layer: str) -> Layer:\n    if layer not in {\"L2\", \"L3\"}:\n        raise HTTPException(status_code=400, detail=\"layer must be L2 or L3\")\n    return layer  # type: ignore[return-value]\n\n\ndef _validate_surface(surface: str) -> Surface:\n    if surface not in SURFACES:\n        raise HTTPException(status_code=404, detail=f\"unknown surface {surface!r}\")\n    return surface  # type: ignore[return-value]\n\n\n# ── Overview / list ──────────────────────────────────────────────────────\n\n\n@router.get(\"/overview\")\nasync def get_overview():\n    store = get_memory_store()\n    rows = [asdict(r) for r in store.overview()]\n    backup_dir = paths.backup_root()\n    backups: list[str] = []\n    if backup_dir.exists():\n        backups = sorted(p.name for p in backup_dir.iterdir() if p.is_dir())\n    return {\"docs\": rows, \"backups\": backups}\n\n\n@router.get(\"/resolve_entry/{entry_id}\")","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/memory.py#L59-L95","documentation":"Guard in _validate_surface: the surface path segment does not name one of the known L2 memory surfaces, so the trace/snapshot/changes endpoint has nothing to serve. The surface name itself is invalid input, not a missing resource.","triggerScenarios":"Thrown at deeptutor/api/routers/memory.py:77 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the SURFACES names for the surface segment","Enumerate valid surfaces via the memory docs endpoint before calling trace endpoints"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","contentChangedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}