docs: palace_path must have even number of segments#5
Merged
Conversation
Firestore paths alternate collection/document, so any palace_path used
as a prefix for collection creation must have an even number of
segments — otherwise `db.collection(f"{palace_path}/{name}")` fails
with ValueError.
This bites anyone nesting the palace under a user doc (e.g.
"users/{id}/memory" feels natural but is 3 segments and produces an
invalid collection path). The fix is to add an anchor doc level
("users/{id}/memory/palace"), which Firestore materializes implicitly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a section to
FIRESTORE_BACKEND.mdexplaining whypalace_pathmust have an even number of segments.Firestore paths alternate
collection/document/collection/document…. Since the backend usespalace_pathas a document-level prefix and appends a collection name to it ({palace_path}/mempalace_drawers), the prefix must be even-segmented — otherwise the resulting path is invalid and Firestore raisesValueError: A collection path must have an odd number of components.This bites anyone nesting the palace under a user doc. A natural-feeling
users/{id}/memoryis 3 segments → invalid. The fix is to add an anchor doc level, e.g.users/{id}/memory/palace, which Firestore materializes implicitly.Includes a clear ✅/❌ table of examples.
🤖 Generated with Claude Code