fix(docs-site): load files-before-subdirs so cross-file overlays resolve on --site#176
Merged
Merged
Conversation
The site loader (loadModel) fed metadata to the parser via fromDirectory, whose DirectorySource sorts by basename (a cross-port ordering contract). When a base object lives in a top-level file and an `overlay: true` extension lives in a subdir whose basename sorts earlier, the overlay parsed before its base and the load failed with ERR_OVERLAY_NO_TARGET — even though the sdk's loadMemory (and so meta gen/migrate) loads the same model fine, because loadMemory collects files-before-subdirs. loadModel now collects files in that same files-before-subdirs, per-level-sorted order and feeds them to MetaDataLoader.load directly, leaving the cross-port DirectorySource basename order untouched. No treeOf change (source ids are basenames, so it already falls back to sourceDirs[0]). Surfaced by dogfooding a real model whose admin-UI presentation overlays live in a nested dir: it now renders end-to-end (0 dangling). The acme golden is byte-identical; a new overlay-order test reproduces the base-in-file / overlay-in-subdir case (ERR_OVERLAY_NO_TARGET before the fix). Co-Authored-By: Claude Opus 4.8 <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.
The site loader used
fromDirectory(basename sort, a cross-port contract), so a base object in a top-level file + anoverlay: trueextension in a subdir with an earlier-sorting basename failed withERR_OVERLAY_NO_TARGET— while the sdk'sloadMemory(meta gen/migrate) loads it fine via files-before-subdirs.loadModelnow collects files-before-subdirs and feedsMetaDataLoader.loaddirectly, leaving the cross-portDirectorySourceorder untouched.Surfaced dogfooding a real model whose admin-UI presentation overlays live in a nested dir — now renders end-to-end, 0 dangling. acme golden byte-identical; new overlay-order regression test.
🤖 Generated with Claude Code