Uh oh!
There was an error while loading. Please reload this page.
[AIT-1138] Deprecate RTPO8d: PathObject#instance wraps primitives (RTPO8f) - #504
Conversation
Previously PathObject#instance returned undefined/null when the path resolved to a primitive (RTPO8d). This is inconsistent with the Instance model itself: RTINS1 defines Instance as a view of "a LiveObject or primitive value", and primitives already surface as Instances via Instance#get (RTINS5c). Replace RTPO8d with RTPO8f: a primitive resolution returns a new Instance wrapping the primitive value. Resolution failure (RTPO8e) still returns undefined/null. Update the corresponding UTS test spec: the RTPO8c primitive-null test becomes RTPO8f/instance-primitive-wrapped-0, asserting the returned Instance has no object id (RTINS3b) and exposes the primitive via Instance#value (RTINS4c).
PathObject#instance wraps primitives (RTPO8f)PathObject#instance wraps primitives (RTPO8f)paddybyers
commented
Jul 12, 2026
Does this need a uts test update? |
sacOO7
commented
Jul 13, 2026
Yes, we need to update current test |
There was a problem hiding this comment.
Pull request overview
Deprecates the PathObject#instance primitive-resolution behavior that previously returned undefined/null (RTPO8d), replacing it with a new clause (RTPO8f) that returns an Instance wrapping the primitive value, and updates the corresponding UTS spec to match the new semantics.
Changes:
- Mark
RTPO8das replaced and addRTPO8fto specify primitive →Instancewrapping the primitive. - Update the UTS spec case to assert a primitive
Instanceis returned (anonymous id,value()exposes the primitive).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| specifications/objects-features.md | Deprecates the primitive-null clause and adds the primitive-wrapped Instance clause for PathObject#instance. |
| uts/objects/unit/path_object.md | Updates the primitive instance() UTS spec to assert an Instance is returned and behaves as a primitive instance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
What
PathObject#instancepreviously returned undefined/null when the path resolved to a primitive value (RTPO8d). This PR deprecates that clause and replaces it withRTPO8f: a primitive resolution now returns a newInstancewrapping the primitive value. The corresponding UTS test spec is updated to match.Why
The primitive-null behaviour was the odd one out in the
Instancemodel:RTINS1already definesInstanceas "a direct-reference view of aLiveObjector primitive value".Instances throughInstance#get(RTINS5c), so a map entry read via anInstanceproduced a primitiveInstance, while the same entry read viaPathObject#instanceproduced nothing.RTINS3b(primitives have no object id) andRTINS4c(Instance#valuereturns the primitive directly) already specify how a primitive-wrappingInstancebehaves —RTPO8dwas just blocking the one entry point.Making
instance()total over resolved values gives callers a single, uniform way to capture a point-in-time reference to whatever sits at a path.Changes
specifications/objects-features.mdRTPO8d— marked as replaced byRTPO8f, following the existing deprecation convention.RTPO8f(new) — a primitive resolution returns a newInstance(RTINS1) wrapping the primitive value.RTPO8c(LiveObject →Instance) andRTPO8e(resolution failure → undefined/null) are unchanged.uts/objects/unit/path_object.mdobjects/unit/RTPO8c/instance-primitive-null-0becomesobjects/unit/RTPO8f/instance-primitive-wrapped-0: asserts the returnedInstanceexists, has no object id (RTINS3b), and exposes the primitive viavalue()(RTINS4c).SDK adoption
Both SDK implementations and their derived UTS tests have been updated to this behaviour and are pending on their respective branches:
_resolveInstancewraps any resolved value;batch()retains its explicit LiveObject check so the 92007 non-LiveObject error is unaffected.DefaultPathObject.instance()returns the typedInstancefor any resolved value; primitive instances remain anonymous (noidmember) per the typed-SDK contract.Follow-up (separate PR)
The typed-SDK spec section (
RTTS6e/RTTS3b, #491) still states thatinstance()on primitivePathObjectsub-classes returns null or throws 92007 — that premise is removed by this change and will be reconciled in an individual PR against that branch.