Repository navigation
Route imported special folders under the import's top collection; show multi-parent collections under the most specific parent - #3813
Merged
Conversation
…t multi-parent collections under the most specific parent derive_collection_metadata sent archived/, decisions/|adr/ and lessons/ to fixed top-level collection names and dropped the directories above them, while every other directory was joined from all its segments, so one import produced two trees (Archived and ADR outside the import's top collection). The special folders now keep the leading directories and match by whole path segment (a top-level decisions/ is ADR like a nested one). The collections tree showed a multi-parent collection under its first parent, in unspecified order; it now picks the most specific parent (one nested below another candidate), so a workspace-wide container that also holds every collection does not hide the real nesting. Refs #3812 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…der-independently Refs #3812 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… directory Refs #3812 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mstomar125
force-pushed
the
issue-3812-import-routing-prefix
branch
from
October 14, 2026 10:21
c013a70 to
9ea7458
Compare
Merged
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.
Closes #3812. Follow-up to #1703 / #1705.
Problem
nodespace import dir <parent> --auto-collection-routingwhere<parent>holds one docs folder (docs-sync-smoke/{architecture,archived,decisions,...}) produced two trees:ArchivedandADR(andLessons) were routed to fixed top-level names, dropping the directories above them, while every other directory kept its full prefix (Docs Sync Smoke:Architecture). Reproduced on a built CLI/daemon with the 36-file sample structure:Archived -> (no parent),ADR -> (no parent).Separately, the collections tree showed a multi-parent collection under its first parent in unspecified order. In a Sync workspace every collection is also filed under the workspace-wide default collection, so a collection could appear under that container instead of its real parent.
Change
derive_collection_metadata: the special folders keep the directories above them (docs-sync-smoke/archived/x.md->Docs Sync Smoke:Archived,...:ADR,...:Lessons) and match by whole path segment. Precedence is unchanged (archived > decisions/adr > lessons). A prefix that cannot be a collection path (blank name,:in a name, deeper than the depth limit) falls back to the bare name, as before. A top-leveldecisions/is nowADR, like a nested one (it used to becomeDecisions).buildCollectionsTree: a collection with several parents is shown under the most specific one (candidates that are an ancestor of another candidate are dropped; the first of the rest wins, so behavior with unrelated parents is unchanged).Not changed, on purpose
The importer is NOT stamped as a member of the imported collections. Core has no membership/access semantics (ADR-081/083), and in Sync a registered person
member_ofa collection restricts it (ADR-037), so stamping would make a team's imported docs private to the importer. Hiding the default container in the sidebar is the Sync extension'scollectionTreeRootscontribution (ADR-082), a Sync-app follow-up.Tests
buildCollectionsTreedisplay-parent tests (both parent orders, three parents, unrelated parents, cycle). Mutation-checked: first-parent selection fails 2.Archived/ADRhad no parent; after, all 9 routed collections hang underDocs Sync Smoke.The Sync app ships a pinned core rev, so a pin bump is needed there to pick this up.
🤖 Generated with Claude Code