{"record":{"id":"ccb87da005b4c3d6","repo":"RyanCodrai/turbovec","slug":"namespace-must-be-a-non-empty-name-got-namespace","errorCode":null,"errorMessage":"namespace must be a non-empty name, got {namespace!r}","messagePattern":"namespace must be a non-empty name, got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"turbovec-python/python/turbovec/llama_index.py","lineNumber":166,"sourceCode":"    ``persist_dir`` when composed into a filename.\n\n    ``from_persist_dir`` builds ``{persist_dir}/{namespace}__vector_store.json``.\n    A ``namespace`` containing a path separator or ``..`` resolves outside\n    ``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:","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec-python/python/turbovec/llama_index.py#L148-L184","documentation":"Raised in _validate_namespace (called from from_persist_dir) when the namespace is empty or '.'. Such a namespace would name the persist_dir itself rather than a store file when composed into '{namespace}__vector_store.json', so it is rejected before any file access.","triggerScenarios":"Thrown at turbovec-python/python/turbovec/llama_index.py:166 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-empty namespace such as 'default' or 'v1.2'.","Check where the namespace value originates — an empty config/env value is a caller bug.","Catch the ValueError in storage bootstrap to report the invalid namespace."],"exampleFix":null,"handlingStrategy":"validation","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"}