fix(read): surface bare index id, not file stem, on the read path (U1b)#2
Merged
Conversation
Issue 1 routed id derivation through id_for_path on the write/index side
(insert, boot scan, watcher reindex, delete guard), so the documents index
holds the bare id for a decorated path like {id}-{title}.md. But the READ
path still took the id from the file stem: Collection::get/list and the
typed get_document/list_documents returned read_document's stem-derived id,
so get_dynamic/list_dynamic (and validate_all, doc_to_json) reported
"{id}-{title}" as the id. Downstream ref JOINs key on the bare id, so a
decorated stem produced an empty view — forcing consumers back to bare
{id}.md filenames.
Fix: all four read sites already fetch the authoritative index record; use
record.id for the returned Document instead of the file stem. Views need no
change — they read the documents index table, whose id column was already
correct.
Found by Donovan's live worker probe against main (2d08aee). Adds a
regression test asserting get_dynamic, list_dynamic, and the typed read all
return the bare id for a decorated {id}-{title}.md schema.
Co-Authored-By: Claude Opus 4.8 (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.
Follow-up to #1. Issue 1 routed id derivation through
id_for_pathon the write/index side, but the read path still took id from the file stem:Collection::get/listand typedget_document/list_documentsreturnedread_document's stem id, soget_dynamic/list_dynamic(andvalidate_all,doc_to_json) reported{id}-{title}— breaking ref JOINs keyed on the bare id and forcing consumers back to bare{id}.md.Fix: all four read sites already fetch the authoritative index
record; userecord.idfor the returnedDocumentinstead of the file stem. Views need no change (they read the index table, already correct).Found by Donovan's live worker probe against main (2d08aee). Verified: reviewed by liz + arabella; Donovan's app-level ref-JOIN round-trip green against this branch (insert/list/get ids all equal the bare ulid, JOIN populates).
+1 regression test (dynamic get, dynamic list, typed get for a decorated
{id}-{title}.mdschema). 147 grounddb / 169 workspace green, 0 new warnings.🤖 Generated with Claude Code