{"record":{"id":"85d7a3ccd5db08d4","repo":"MemPalace/mempalace","slug":"field-must-be-a-non-empty-string","errorCode":null,"errorMessage":"{field} must be a non-empty string","messagePattern":"(.+?) must be a non-empty string","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mempalace/palace_graph.py","lineNumber":460,"sourceCode":"    source_wing: str, source_room: str, target_wing: str, target_room: str\n) -> str:\n    \"\"\"Compute a symmetric tunnel ID.\n\n    Tunnels are conceptually undirected — \"auth relates to users\" is the\n    same connection as \"users relates to auth\". Sort the two endpoints\n    before hashing so ``create_tunnel(A, B)`` and ``create_tunnel(B, A)``\n    resolve to the same ID and dedup into one record.\n    \"\"\"\n    src = _endpoint_key(source_wing, source_room)\n    tgt = _endpoint_key(target_wing, target_room)\n    a, b = sorted((src, tgt))\n    return hashlib.sha256(f\"{a}↔{b}\".encode()).hexdigest()[:16]\n\n\ndef _require_name(value: str, field: str) -> str:\n    \"\"\"Reject empty / non-string endpoint identifiers.\"\"\"\n    if not isinstance(value, str) or not value.strip():\n        raise ValueError(f\"{field} must be a non-empty string\")\n    return value.strip()\n\n\ndef _check_room_exists(wing: str, room: str, col) -> bool:\n    \"\"\"Check if at least one drawer exists for the given wing/room in ChromaDB.\"\"\"\n    if col is None:\n        # If collection is unreachable, can't verify, so allow.\n        logger.debug(\n            \"ChromaDB collection not reachable, skipping room existence validation for %s/%s\",\n            wing,\n            room,\n        )\n        return True\n    try:\n        results = col.get(where={\"$and\": [{\"wing\": wing}, {\"room\": room}]}, limit=1, include=[])\n        return len(results[\"ids\"]) > 0\n    except Exception:\n        # If query fails, assume it's a temporary issue or permissions, and allow.","sourceCodeStart":442,"sourceCodeEnd":478,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/palace_graph.py#L442-L478","documentation":"Error \"{field} must be a non-empty string\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/palace_graph.py:460 when the library encounters an invalid state.","commonSituations":"Required wing/room name argument was empty or not a string.","solutions":["Pass a non-empty string for the field"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}