{"record":{"id":"a32cec543f7bf3a5","repo":"HKUDS/DeepTutor","slug":"note-ref-r-not-found-in-the-vault","errorCode":null,"errorMessage":"Note {ref!r} not found in the vault.","messagePattern":"Note (.+?) not found in the vault\\.","errorType":"exception","errorClass":"VaultError","httpStatus":null,"severity":"error","filePath":"deeptutor/capabilities/obsidian/vault.py","lineNumber":167,"sourceCode":"\n\ndef _snippet(body: str, query: str, width: int = 160) -> str:\n    lowered = body.lower()\n    idx = lowered.find(query.lower())\n    if idx < 0:\n        return body[:width].strip().replace(\"\\n\", \" \")\n    start = max(0, idx - width // 3)\n    return (\"…\" if start else \"\") + body[start : start + width].strip().replace(\"\\n\", \" \") + \"…\"\n\n\n# --- read operations --------------------------------------------------------\n\n\ndef read_note(root: Path, ref: str) -> dict[str, Any]:\n    \"\"\"Return ``{path, frontmatter, body}`` for a note, or raise ``VaultError``.\"\"\"\n    path = resolve_note(root, ref)\n    if path is None:\n        raise VaultError(f\"Note {ref!r} not found in the vault.\")\n    text = _read_text(path)\n    frontmatter, body = split_frontmatter(text)\n    return {\"path\": _rel(root, path), \"frontmatter\": frontmatter, \"body\": body}\n\n\ndef search_notes(root: Path, query: str, limit: int = 20) -> list[dict[str, str]]:\n    \"\"\"Case-insensitive substring search over note titles and bodies.\"\"\"\n    query = (query or \"\").strip()\n    if not query:\n        return []\n    needle = query.lower()\n    hits: list[dict[str, str]] = []\n    for path in _iter_markdown(root):\n        try:\n            text = _read_text(path)\n        except OSError:\n            continue\n        if needle in path.stem.lower() or needle in text.lower():","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/capabilities/obsidian/vault.py#L149-L185","documentation":"Error \"Note {ref!r} not found in the vault.\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/capabilities/obsidian/vault.py:167 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"}