[AIT-1092] chore(uts): reconcile LiveObjects (objects) test specs with main spec#499
Open
sacOO7 wants to merge 1 commit into
Open
[AIT-1092] chore(uts): reconcile LiveObjects (objects) test specs with main spec#499sacOO7 wants to merge 1 commit into
sacOO7 wants to merge 1 commit into
Conversation
Align the uts/objects test specs with the canonical objects-features.md on main, and fold in the test-correctness fixes from the objects UTS audit. Reconciliation with main: - Rename the internal CRDT type LiveMap/LiveCounter -> InternalLiveMap/ InternalLiveCounter (271 refs), and rename the four CRDT spec files to internal_live_*.md, repointing all cross-references. Blueprint .create() factories, public PathObject/Instance, and LiveMapUpdate/ LiveMapValue are deliberately left unchanged. - get() precondition RTO23b -> RTO23e: get() now performs ensure-active-channel (RTL33) -- re-attaches on DETACHED, rejects 90001 only on FAILED -- instead of unconditionally throwing 90001. - Rename blueprint value types LiveMapValueType/LiveCounterValueType -> LiveMap/LiveCounter (static .create() factories), matching main. - Consolidate RTO25 (access) / RTO26 (write) preconditions as dedicated sections in realtime_object.md, fixing 8 references to two precondition files that never existed; drop the mislabeled RTO25b-via-get() tests. - public_object_message: replace the ably-js-private _derivedFrom with a spec-neutral derivedFrom (RTLCV4g5/RTLMV4j5 keep this retained Create local-only and unnamed). Test-correctness fixes (objects UTS audit): - Quiescence-barrier pattern for negative subscription assertions. - Tombstone / echo-dedup handling; map-clear (RTLM24) and LWW-reject (RTLM9b) semantics; path depth-coverage (RTO24b2a1) fixes. - ACK-serial helper + SITE_CODE in standard_test_pool; explicit REST per-op cardinality; assorted spec-ID and expected-event corrections. Validated against main objects-features.md and cross-checked with ably-js; spec naming is preferred over ably-js where the two differ.
161ca87 to
34b9ee5
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the uts/objects test-spec pseudocode to match the newer canonical LiveObjects spec terminology and behaviors, ensuring derived SDK tests are generated from spec-faithful, internally consistent inputs.
Changes:
- Renames internal CRDT types and related specs to
InternalLiveMap/InternalLiveCounter, while keeping public API/blueprint naming intact. - Updates
RealtimeObject.get()preconditions/behavior to the ensure-active-channel flow (reattach on DETACHED; reject on FAILED), and consolidates RTO25/RTO26 precondition tests intorealtime_object.md. - Improves test correctness and determinism (negative-assertion quiescence barriers, ack serial helpers, siteCode exposure, and several behavioral expectation fixes).
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| uts/objects/unit/value_types.md | Renames blueprint value types to LiveCounter/LiveMap and updates assertions/requirements accordingly. |
| uts/objects/unit/realtime_object.md | Updates get() behavior to ensure-active-channel semantics; consolidates RTO25/RTO26 precondition tests; adds sync-wait correctness assertions. |
| uts/objects/unit/public_object_message.md | Renames _derivedFrom to spec-neutral derivedFrom in local-only retained create metadata. |
| uts/objects/unit/path_object.md | Updates internal CRDT naming in delegation/prose/spec references. |
| uts/objects/unit/path_object_subscribe.md | Adds quiescence-control patterns to make negative subscription assertions non-flaky; adjusts depth/path stimuli. |
| uts/objects/unit/path_object_mutations.md | Updates internal CRDT naming and blueprint type names for write delegation tests. |
| uts/objects/unit/parent_references.md | Updates internal CRDT naming for parentReferences and rebuild behavior tests. |
| uts/objects/unit/objects_pool.md | Updates internal CRDT naming in pool initialization/sync logic assertions. |
| uts/objects/unit/live_object_subscribe.md | Adds quiescence barriers and clarifies noop/tombstone subscription behaviors. |
| uts/objects/unit/internal_live_map.md | Renames and updates InternalLiveMap CRDT tests; adjusts several semantics explanations/assertions. |
| uts/objects/unit/internal_live_map_api.md | Renames map API tests and repoints precondition-test references to consolidated sections. |
| uts/objects/unit/internal_live_counter.md | Renames and updates InternalLiveCounter CRDT tests. |
| uts/objects/unit/internal_live_counter_api.md | Renames counter API tests and repoints precondition-test references to consolidated sections. |
| uts/objects/unit/instance.md | Updates internal CRDT naming for Instance delegation and event assertions; adds quiescence control for unsubscribe tests. |
| uts/objects/PLAN.md | Updates architecture summary and file plan to reflect new naming and consolidated precondition sections. |
| uts/objects/integration/objects_sync_test.md | Updates integration test prose to InternalLiveMap naming. |
| uts/objects/integration/objects_lifecycle_test.md | Updates integration test prose for InternalLive* naming and blueprint type naming. |
| uts/objects/helpers/standard_test_pool.md | Exposes canonical SITE_CODE and ack_serial; documents negative-assertion quiescence; updates naming. |
Comments suppressed due to low confidence (1)
uts/objects/unit/internal_live_map.md:1301
- Grammar: use “an InternalLiveMap” (vowel sound) instead of “a InternalLiveMap”.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| **Test ID**: `objects/unit/RTPO3a1/intermediate-not-map-0` | ||
|
|
||
| **Spec requirement:** Current object must be a LiveMap. If not, resolution fails. | ||
| **Spec requirement:** Current object must be a InternalLiveMap. If not, resolution fails. |
| **Test ID**: `objects/unit/RTINS12d/set-non-map-throws-0` | ||
|
|
||
| **Spec requirement:** If the wrapped value is not a LiveMap, throw ErrorInfo with code 92007. | ||
| **Spec requirement:** If the wrapped value is not a InternalLiveMap, throw ErrorInfo with code 92007. |
| **Test ID**: `objects/unit/RTINS14d/increment-non-counter-throws-0` | ||
|
|
||
| **Spec requirement:** If the wrapped value is not a LiveCounter, throw ErrorInfo with code 92007. | ||
| **Spec requirement:** If the wrapped value is not a InternalLiveCounter, throw ErrorInfo with code 92007. |
| | RTO3a | ObjectsPool is Dict<String, LiveObject> | | ||
| | RTO3b | Must always contain a LiveMap with id "root" | | ||
| | RTO3b1 | On initialization, create zero-value LiveMap with objectId "root" | | ||
| | RTO3b | Must always contain a InternalLiveMap with id "root" | |
Comment on lines
617
to
619
| ProtocolMessage(action: CONNECTED, connectionDetails: { | ||
| connectionId: "conn-1", connectionKey: "key-1", siteCode: "test-site", | ||
| objectsGCGracePeriod: 86400000 | ||
| connectionId: "conn-1", connectionKey: "key-1", siteCode: "test-site" | ||
| }) |
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.
Intent
The canonical LiveObjects spec (
specifications/objects-features.md) onmainhas moved ahead of the version theuts/objectstest specs were originally written against. This PR reconciles the test specs withmainand folds in the test-correctness fixes identified during the objects UTS audit, so the derived SDK tests are generated from a spec-faithful, internally-consistent source.Source of truth:
objects-features.mdonmain, cross-checked against the ably-jsliveobjectsimplementation. Where ably-js naming differs from the spec, the spec wins.What changed
1. Internal CRDT naming →
InternalLiveMap/InternalLiveCountermainrenames the internal CRDT graph objects to disambiguate them from the public API and the create-blueprints. Applied across 271 references (constructions,ISassertions,.diff,#methoddelegations, and prose).The four CRDT spec files were renamed to match (the skill resolver derives the test class name from the filename, so generated classes become
InternalLive*automatically):unit/live_counter.mdunit/internal_live_counter.mdunit/live_map.mdunit/internal_live_map.mdunit/live_counter_api.mdunit/internal_live_counter_api.mdunit/live_map_api.mdunit/internal_live_map_api.mdLeft unchanged on purpose: blueprint
.create()factories, publicPathObject/Instance,LiveObject(base), andLiveMapUpdate/LiveCounterUpdate/LiveMapValue.2.
get()precondition:RTO23b→RTO23e(ensure-active-channel)RTO23b(throw90001on DETACHED/FAILED) was replaced byRTO23e(perform ensure-active-channel,RTL33):RTO23b)RTO23e/RTL33)90001PathObject9000190001(viaRTL33c)Read/subscribe access methods are a separate check (
RTO25b, still90001on DETACHED/FAILED) — verified against ably-js (get()→ensureAttached(); access methods →throwIfInvalidAccessApiConfiguration()).3. Blueprint value types →
LiveMap/LiveCounterLiveMapValueType/LiveCounterValueTyperenamed toLiveMap/LiveCounter(immutable blueprints with static.create()), matchingmainand the ably-js public exports (LiveMapValueType as LiveMap,LiveCounterValueType as LiveCounter).4. RTO25 / RTO26 preconditions consolidated into
realtime_object.mdThe spec centralised the per-method preconditions into
RTO25(access) /RTO26(write), and the per-method clauses now read "replaced by RTO25/RTO26". Eight notes pointed readers to two files (rto25_access_preconditions.md,rto26_write_preconditions.md) that never existed.realtime_object.md(RTO25a, RTO25b ×2, RTO26a, RTO26b ×2, RTO26c), grouped after theget()tests.realtime_object.mdwith section qualifiers.RTO25b-via-get()tests; the genuineRTO25btests now exercise a real access method (root.keys()) on DETACHED/FAILED.5.
public_object_message: spec-neutralderivedFromReplaced the ably-js-private field name
_derivedFromwithderivedFrom(+ a comment): the spec (RTLCV4g5/RTLMV4j5) keeps the retainedCounterCreate/MapCreatelocal-only and unnamed, so the UTS pseudocode should not borrow an SDK-internal field name. The assertions already read spec-presentPAOOPfields only.6. Test-correctness fixes (objects UTS audit)
Independent of the
maindelta, folded in here:RTLM24) and LWW-reject (RTLM9b) semantics; path depth-coverage (RTO24b2a1) fixes.ack_serialhelper + exposedSITE_CODEinstandard_test_pool; explicit REST per-op cardinality; assorted spec-ID and expected-event corrections (e.g.RTPO13c5,RTPO3c2→92005,RTINS16g).Validation
diffof working-copy vsmainobjects-features.md, normalising the two renames to isolate the single behavioural change (RTO23b→RTO23e).LiveObjectpreserved; every asserted internal field is spec-named.get()/ access / write precondition behaviour and the value-type exports against ably-js.Notes / out of scope
RTO26bcovers DETACHED/FAILED/SUSPENDED but the suite only tests DETACHED/FAILED. This is a pre-existing coverage gap, not a regression; happy to addRTO26b/write-throws-suspended-0if wanted.uts/directory still reference the old filenames; they are historical records and were intentionally left untouched.