Closed bug report

Part auto-detection: render/ preview beats the page's own <slug>.glb (tree order); parts-override field name undiscoverable

Colby Knox · 2mo ago ·closed by Colby Knox

Part auto-detection picks render/<v>/board.glb over the page's own <slug>.glb (tree order); declared-override field name is undiscoverable

From adom/adom-wiki-cli#31 (barrett-land), reproduced today on prod with a throwaway page; the indexer half lives here.

Mechanism (lib/index.js, the component parts block): byExt(".glb") takes the FIRST tree entry ending in .glb from the recursive listing, which is alphabetical. So any slug sorting after the literal render/ gets model_3d_path: render/<version>/board.glb (APM's preview copy, currently emitted with fewer meshes, adom/adom-project-manager#9) instead of the anchored, checksummed <slug>.glb at the root. Reproduced: a page with render/1.0.0/board.glb + ztest-glb-31.glb indexed to the render copy. Same hazard exists for every byExt part (.step, .pdf, .kicad_sym, ...) whenever a subfolder sorts first — the datasheet variant already bit essemtec-puma and grew a name-match special case.

The override exists but nobody can find it. component.parts.model_3d in page.json wins over the scan (verified live: pushing it flipped the page immediately). But barrett set component.model_3d_path — the METADATA OUTPUT field name — and the indexer silently ignores it; that's now two people reasonably guessing the output name as the input name.

Asks, in priority order:

  1. Exclude render/ from the part scan (it is APM's preview folder, never the canonical part), and prefer a root-level <slug>.<ext> match over any subfolder match generally. That fixes every affected page with no author action; the three molecule pages in CLI#31 are live examples (adom/rp2350-ads1220-molecule is the broken one).
  2. Accept component.model_3d_path (and the sibling *_path names) as declared-override aliases, or at minimum emit a publish/index hint when component carries a *_path key that matches a metadata output name — today it's a silent no-op, which is what turned a mispick into a filed bug.
  3. Docs: the CLI's SKILL.md now documents component.parts.* (incl. the false/null opt-out you already support); a line in the wiki's own docs wouldn't hurt.

Happy to verify on staging when it lands; the repro is two pushed .glb files and a read of metadata.model_3d_path.

1 Reply

Colby Knox · 2mo ago ·edited

All three asks shipped to prod, plus the fleet cleanup.

Ask 1, the scan. byExt now excludes render/ entirely and prefers the page's own root-level <slug>.<ext>, then any root file, then subfolders; the same rule covers every part extension (.step, .pdf, .kicad_sym, ...). Verified on staging with the exact repro from this issue (a root <slug>.glb + render/1.0.0/board.glb): model_3d_path resolves to the root slug file.

Ask 2, the override spelling. The *_path metadata-OUTPUT names are accepted as declared-override aliases; canonical component.parts.* wins on conflict, including its false/null opt-out. And pushing an alias now emits a COMPONENT_PARTS_ALIAS hint teaching the canonical name at the moment of use, so the guess converges instead of fossilizing as a silent no-op.

Ask 3, docs. COMPONENT_PARTS_ALIAS plus the scan rules are registered in docs/hint-codes.md; the CLI SKILL.md side was already done per this issue.

Fleet cleanup. Swept all 945 hardware pages for metadata paths pointing into render/: 8 live pages were bitten. Reindexed each (single-page rebuilds, no rebuildAll); 7 now resolve to their canonical root <slug>.glb, including the named adom/rp2350-ads1220-molecule siblings (uv-current-monitor-board, uv-led-panel, three workcell boards, cosmiic/wireless-link). The eighth, adom/usb3-to-ethernet-dataonly-molecule, keeps render/board.glb because its page.json DECLARES it under parts.model_3d: explicit author choice, canonical-wins working as designed. Note for its owner: the repo now carries a root board.glb, so that declaration may be a fossil from when only the render copy existed.

Coverage: 10 new regression assertions (slug-beats-subfolders, render excluded, render-only yields no model, alias override, canonical-beats-alias, and the hint firing/naming/silent cases).

Log in to reply.