Report a pc-joint entity reference that does not resolve - #425
Merged
Conversation
An entity-a or entity-b that names nothing live produced no constraint and no message, so the joint simply did nothing - indistinguishable from a physics problem, and the failure most likely to bite when referencing a pc-node, whose entity does not exist until its container asset has loaded. The silence was deliberate and pinned by a test; this replaces it, because every neighboring element already reports the same class of mistake loudly. pc-model warns for an asset id that resolves to nothing, and pc-node warns for a name it cannot find, down to offering the closest match. An empty reference stays silent. On entity-b it is the documented way to pin the first body to a point in world space, and on either it is the transient state of an element whose reference has yet to be assigned. The two failures report differently, because they have different fixes: nothing in the document matching the reference is usually a typo, while something matching that has no entity is usually timing. Telling them apart needs the matched element, so the element lookup is split out of getEntity as findEntityElement. getEntity keeps its signature and its silence - what an unresolved reference means depends on the element holding it, so reporting stays with the caller. The other four components that resolve references this way are left alone here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 29, 2026
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.
Fixes #389
An
entity-aorentity-bthat names nothing live produced no constraint and no message, so the joint simply did nothing — indistinguishable from a physics problem, and the failure most likely to bite when referencing apc-node, whose entity does not exist until its container asset has loaded. The silence was deliberate and pinned by a test; this replaces it, because every neighboring element already reports the same class of mistake loudly:pc-modelwarns for an asset id that resolves to nothing, andpc-nodewarns for a name it cannot find, down to offering the closest match.This is option (1) from the issue: warn on a non-empty reference that does not resolve, with no timing change and nothing breaking.
What warns, and how
The two failures report differently, because they have different fixes:
pc-nodewhose asset has not loaded), or the wrong element entirely:Telling them apart needs the matched element, so the element lookup is split out of
getEntityasfindEntityElement(both@internal).getEntitykeeps its signature and its silence — what an unresolved reference means depends on the element holding it, so reporting stays with the caller.What stays silent
An empty reference. On
entity-bit is the documented way to pin the first body to a point in world space, and on either attribute it is the transient state of an element whose reference has yet to be assigned. A test pins this.Scope
pc-jointonly — the most punishing of the five reference-resolving elements, because a missing joint has no visual symptom at all.pc-button,pc-scrollbar,pc-scrollviewandpc-scriptare left alone here.Test plan
warns when a reference matches nothing in the document(replaces the test that pinned the silence)warns differently when a reference matches an element backing no entitywarns again when a reference is reassigned and still does not resolvestays silent for an empty reference, which is the world-space case🤖 Generated with Claude Code