{"record":{"id":"096636719fd31a97","repo":"RyanCodrai/turbovec","slug":"namespace-must-not-contain-path-separators-or","errorCode":null,"errorMessage":"namespace must not contain path separators ('/' or '\\\\') or '..'; got {namespace!r}. It names a store within persist_dir, not a path.","messagePattern":"namespace must not contain path separators \\('/' or '\\\\\\\\'\\) or '\\.\\.'; got (.+?)\\. It names a store within persist_dir, not a path\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"turbovec-python/python/turbovec/llama_index.py","lineNumber":170,"sourceCode":"    ``persist_dir`` (path traversal), an empty/``.`` namespace names the\n    directory itself rather than a store file, and a ``:`` forms a\n    Windows drive-relative name (``C:foo``) that escapes ``persist_dir``\n    without any separator. We reject these loudly rather than silently\n    basenaming them — silent rewriting could load a *different* store\n    than the caller named. Any other namespace is accepted verbatim\n    (alphanumerics, dash, underscore, dots, and other non-separator\n    characters); dotted namespaces such as ``v1.2`` map to distinct\n    file pairs and coexist in one ``persist_dir``.\n\n    This is a deliberate divergence from ``SimpleVectorStore``, which does\n    not sanitize its namespace, in the safer direction.\n    \"\"\"\n    if namespace == \"\" or namespace == \".\":\n        raise ValueError(\n            f\"namespace must be a non-empty name, got {namespace!r}\"\n        )\n    if \"/\" in namespace or \"\\\\\" in namespace or os.sep in namespace or \"..\" in namespace:\n        raise ValueError(\n            \"namespace must not contain path separators ('/' or '\\\\\\\\') or \"\n            f\"'..'; got {namespace!r}. It names a store within persist_dir, \"\n            \"not a path.\"\n        )\n    if \":\" in namespace:\n        raise ValueError(\n            \"namespace must not contain ':' (a Windows drive-relative name \"\n            f\"like 'C:foo' escapes persist_dir); got {namespace!r}. It \"\n            \"names a store within persist_dir, not a path.\"\n        )\n    return namespace\n\n\ndef _split_persist_base(persist_path: str | Path) -> Path:\n    \"\"\"Derive the on-disk base from ``persist_path``: the binary index is\n    written to ``{base}.tvim`` and the node side-car to\n    ``{base}.nodes.json`` (extensions *appended* — see ``_with_ext``).\n","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec-python/python/turbovec/llama_index.py#L152-L188","documentation":"Raised in _validate_namespace when the namespace contains a path separator ('/', backslash, or os.sep) or '..'. Composed into the persist filename, such a namespace performs path traversal and resolves outside persist_dir; it is rejected loudly rather than silently basename'd, since silent rewriting could load a different store than the caller named.","triggerScenarios":"Thrown at turbovec-python/python/turbovec/llama_index.py:170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a flat name (alphanumerics, dash, underscore, dots) — the namespace names a store within persist_dir, not a path.","Strip or encode directory components before passing the namespace.","Catch the ValueError in tooling to detect accidental path-like namespaces (also a path-traversal defense)."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ccab9f325e6ce2a270a87daf01ae4e443bcf2d49","analyzedAt":"2026-09-06T08:39:18.516Z","contentChangedAt":"2026-09-06T08:39:18.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}