Skip to content

fix(docs-site): load files-before-subdirs so cross-file overlays resolve on --site#176

Merged
dmealing merged 1 commit into
mainfrom
fix/docs-site-overlay-order
Jul 5, 2026
Merged

fix(docs-site): load files-before-subdirs so cross-file overlays resolve on --site#176
dmealing merged 1 commit into
mainfrom
fix/docs-site-overlay-order

Conversation

@dmealing

@dmealing dmealing commented Jul 5, 2026

Copy link
Copy Markdown
Member

The site loader used fromDirectory (basename sort, a cross-port contract), so a base object in a top-level file + an overlay: true extension in a subdir with an earlier-sorting basename failed with ERR_OVERLAY_NO_TARGET — while the sdk's loadMemory (meta gen/migrate) loads it fine via files-before-subdirs. loadModel now collects files-before-subdirs and feeds MetaDataLoader.load directly, leaving the cross-port DirectorySource order 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

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>
@dmealing
dmealing merged commit 6e7f47f into main Jul 5, 2026
1 check passed
@dmealing
dmealing deleted the fix/docs-site-overlay-order branch July 5, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant