@webex/plugin-meetings 3.12.0-webex-services-ready.4 → 3.13.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/.sdd/manifest.json +1312 -0
  2. package/.sdd/templates/.source.json +30 -0
  3. package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +111 -0
  4. package/.sdd/templates/component-repo/module-docs/module-spec.template.md +321 -0
  5. package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +59 -0
  6. package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +49 -0
  7. package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +42 -0
  8. package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +120 -0
  9. package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +206 -0
  10. package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +90 -0
  11. package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +68 -0
  12. package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +111 -0
  13. package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +57 -0
  14. package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +69 -0
  15. package/.sdd/templates/component-repo/standing-docs/RULES.template.md +96 -0
  16. package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +84 -0
  17. package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +82 -0
  18. package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +94 -0
  19. package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +64 -0
  20. package/.sdd/templates/component-repo/template-map.json +112 -0
  21. package/AGENTS.md +130 -4
  22. package/ai-docs/ARCHITECTURE.md +208 -0
  23. package/ai-docs/CONTRACTS.md +267 -0
  24. package/ai-docs/DATA_MODEL.md +64 -0
  25. package/ai-docs/GETTING_STARTED.md +73 -0
  26. package/ai-docs/GLOSSARY.md +56 -0
  27. package/ai-docs/REVIEW_CHECKLIST.md +45 -0
  28. package/ai-docs/RULES.md +79 -0
  29. package/ai-docs/SECURITY.md +74 -0
  30. package/ai-docs/SERVICE_STATE.md +59 -0
  31. package/ai-docs/SPEC_INDEX.md +85 -0
  32. package/ai-docs/TEST_INDEX.md +45 -0
  33. package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
  34. package/ai-docs/patterns/defensive-error-propagation.md +55 -0
  35. package/ai-docs/patterns/event-scope-emission.md +46 -0
  36. package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
  37. package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
  38. package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
  39. package/assets/README.md +28 -0
  40. package/assets/e2ee-0.0.1.js +2 -0
  41. package/assets/e2ee-0.0.1.wasm +0 -0
  42. package/dist/aiEnableRequest/index.js +1 -1
  43. package/dist/annotation/index.js +55 -19
  44. package/dist/annotation/index.js.map +1 -1
  45. package/dist/assets/e2ee-0.0.1.js +2 -0
  46. package/dist/assets/e2ee-0.0.1.wasm +0 -0
  47. package/dist/breakouts/breakout.js +1 -1
  48. package/dist/breakouts/index.js +39 -5
  49. package/dist/breakouts/index.js.map +1 -1
  50. package/dist/common/errors/webex-errors.js +7 -2
  51. package/dist/common/errors/webex-errors.js.map +1 -1
  52. package/dist/config.js +1 -0
  53. package/dist/config.js.map +1 -1
  54. package/dist/constants.js +6 -5
  55. package/dist/constants.js.map +1 -1
  56. package/dist/hashTree/hashTreeParser.js +101 -48
  57. package/dist/hashTree/hashTreeParser.js.map +1 -1
  58. package/dist/index.js +1 -0
  59. package/dist/index.js.map +1 -1
  60. package/dist/interceptors/dataChannelAuthToken.js +41 -59
  61. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  62. package/dist/interceptors/locusRetry.js +1 -1
  63. package/dist/interceptors/locusRetry.js.map +1 -1
  64. package/dist/interpretation/index.js +46 -12
  65. package/dist/interpretation/index.js.map +1 -1
  66. package/dist/interpretation/siLanguage.js +1 -1
  67. package/dist/locus-info/index.js +236 -80
  68. package/dist/locus-info/index.js.map +1 -1
  69. package/dist/locus-info/types.js +2 -1
  70. package/dist/locus-info/types.js.map +1 -1
  71. package/dist/media/MediaConnectionAwaiter.js +225 -175
  72. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  73. package/dist/meeting/index.js +355 -299
  74. package/dist/meeting/index.js.map +1 -1
  75. package/dist/meeting/util.js +8 -2
  76. package/dist/meeting/util.js.map +1 -1
  77. package/dist/meeting/voicea-meeting.js +2 -1
  78. package/dist/meeting/voicea-meeting.js.map +1 -1
  79. package/dist/meeting-info/meeting-info-v2.js +10 -3
  80. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  81. package/dist/meetings/index.js +72 -31
  82. package/dist/meetings/index.js.map +1 -1
  83. package/dist/multistream/remoteMediaManager.js +32 -4
  84. package/dist/multistream/remoteMediaManager.js.map +1 -1
  85. package/dist/multistream/sendSlotManager.js +11 -1
  86. package/dist/multistream/sendSlotManager.js.map +1 -1
  87. package/dist/types/annotation/index.d.ts +19 -0
  88. package/dist/types/common/errors/webex-errors.d.ts +6 -2
  89. package/dist/types/config.d.ts +1 -0
  90. package/dist/types/constants.d.ts +2 -1
  91. package/dist/types/hashTree/hashTreeParser.d.ts +12 -0
  92. package/dist/types/index.d.ts +1 -0
  93. package/dist/types/locus-info/index.d.ts +45 -1
  94. package/dist/types/locus-info/types.d.ts +1 -0
  95. package/dist/types/media/MediaConnectionAwaiter.d.ts +61 -53
  96. package/dist/types/meeting/index.d.ts +49 -12
  97. package/dist/types/meeting/util.d.ts +3 -1
  98. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  99. package/dist/types/meetings/index.d.ts +2 -1
  100. package/dist/types/multistream/remoteMediaManager.d.ts +18 -0
  101. package/dist/types/multistream/sendSlotManager.d.ts +5 -1
  102. package/dist/webinar/index.js +298 -255
  103. package/dist/webinar/index.js.map +1 -1
  104. package/package.json +25 -23
  105. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
  106. package/src/annotation/ai-docs/annotation-spec.md +236 -0
  107. package/src/annotation/index.ts +61 -29
  108. package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
  109. package/src/breakouts/index.ts +35 -2
  110. package/src/common/errors/webex-errors.ts +8 -2
  111. package/src/config.ts +5 -1
  112. package/src/constants.ts +2 -1
  113. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
  114. package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
  115. package/src/hashTree/hashTreeParser.ts +67 -3
  116. package/src/index.ts +1 -0
  117. package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
  118. package/src/interceptors/dataChannelAuthToken.ts +48 -77
  119. package/src/interceptors/locusRetry.ts +1 -1
  120. package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
  121. package/src/interpretation/index.ts +38 -1
  122. package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
  123. package/src/locus-info/index.ts +156 -35
  124. package/src/locus-info/types.ts +1 -0
  125. package/src/media/MediaConnectionAwaiter.ts +223 -207
  126. package/src/media/ai-docs/media-spec.md +267 -0
  127. package/src/meeting/ai-docs/meeting-spec.md +404 -0
  128. package/src/meeting/index.ts +332 -296
  129. package/src/meeting/util.ts +7 -4
  130. package/src/meeting/voicea-meeting.ts +1 -1
  131. package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
  132. package/src/meeting-info/meeting-info-v2.ts +7 -2
  133. package/src/meetings/ai-docs/meetings-spec.md +296 -0
  134. package/src/meetings/index.ts +59 -23
  135. package/src/member/ai-docs/member-spec.md +196 -0
  136. package/src/members/ai-docs/members-spec.md +256 -0
  137. package/src/metrics/ai-docs/metrics-spec.md +185 -0
  138. package/src/multistream/ai-docs/multistream-spec.md +295 -0
  139. package/src/multistream/remoteMediaManager.ts +23 -1
  140. package/src/multistream/sendSlotManager.ts +15 -1
  141. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
  142. package/src/reachability/ai-docs/reachability-spec.md +261 -0
  143. package/src/reactions/ai-docs/reactions-spec.md +198 -0
  144. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
  145. package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
  146. package/src/roap/ai-docs/roap-spec.md +241 -0
  147. package/src/webinar/ai-docs/webinar-spec.md +243 -0
  148. package/src/webinar/index.ts +168 -188
  149. package/test/unit/spec/annotation/index.ts +214 -182
  150. package/test/unit/spec/breakouts/index.ts +145 -13
  151. package/test/unit/spec/hashTree/hashTreeParser.ts +212 -1
  152. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +81 -99
  153. package/test/unit/spec/interceptors/locusRetry.ts +29 -1
  154. package/test/unit/spec/interpretation/index.ts +93 -0
  155. package/test/unit/spec/locus-info/index.js +397 -0
  156. package/test/unit/spec/media/MediaConnectionAwaiter.ts +426 -19
  157. package/test/unit/spec/media/properties.ts +3 -3
  158. package/test/unit/spec/meeting/index.js +1219 -723
  159. package/test/unit/spec/meeting/utils.js +52 -18
  160. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  161. package/test/unit/spec/meeting-info/meetinginfov2.js +69 -1
  162. package/test/unit/spec/meetings/index.js +145 -43
  163. package/test/unit/spec/multistream/remoteMediaManager.ts +46 -0
  164. package/test/unit/spec/multistream/sendSlotManager.ts +30 -2
  165. package/test/unit/spec/webinar/index.ts +886 -718
@@ -0,0 +1,296 @@
1
+ <!-- sdd-generated-metadata
2
+ doc_kind: module-spec
3
+ generated_from: module-spec@0.2.2
4
+ generator_plugin: repo-annotation@1.0.5+codex.20260818094939
5
+ generated_by: codex
6
+ approved_by: repository user
7
+ updated_at: 2026-09-08T00:00:00Z
8
+ validation_status: pass-with-warnings
9
+ -->
10
+ # MEETINGS — SPEC
11
+
12
+ > Start here → root [`AGENTS.md`](../../../AGENTS.md) · router [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md) · system [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md). This is the canonical source-local spec for `src/meetings/`.
13
+
14
+ ## Metadata
15
+
16
+ | Field | Value |
17
+ |---|---|
18
+ | Module id | `meetings` |
19
+ | Source path(s) | `src/meetings/` |
20
+ | Parent spec | — |
21
+ | Doc kind | Module spec |
22
+ | Coverage score | 93% assessed 2026-08-22; 13/14 mandatory fields present; all critical and Important fields present; one noncritical polish gap remains; pending independent validation of the participant-role repair |
23
+ | Generated from | `module-spec` @ SDLC template library `0.2.2` |
24
+ | generated_by / approved_by / updated_at | codex / repository user / 2026-09-08T00:00:00Z |
25
+ | Revalidated against | `b7b93b443e` (manual diff review of `f9a29f61..b7b93b443e`; not a generator/validator tool run) |
26
+ | Validation status | pass-with-warnings |
27
+
28
+ ## Evidence Rules
29
+
30
+ Requirements cite current implementation and mirrored unit-test paths. Current code wins over retained prose when they conflict; commit and PR history are excluded by repository-owner decision. Missing test evidence is stated as a gap rather than inferred.
31
+
32
+ ## Source Material Register
33
+
34
+ | Source material | Scope | Decision | Detail location or disposition |
35
+ |---|---|---|---|
36
+ | Retained package consumer documentation | overview / API / behavior / tests | used and verified; creation, registration, collection, PMR, and event behavior moved into requirements/use cases; examples remain in the retained guide |
37
+ | Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
38
+
39
+ ## Overview
40
+
41
+ `src/meetings/` contains 5 direct source/reference file(s) and has 4 mirrored unit-test file(s). This spec separates its public operations, runtime data movement, component ownership, state applicability, and verification boundary.
42
+
43
+ ## Purpose / Responsibility
44
+
45
+ Owns the registered plugin lifecycle, meeting discovery, registration, realtime routing, and the top-level meeting collection.
46
+
47
+ ## Stack
48
+
49
+ TypeScript/JavaScript in the Node 22.14 Yarn workspace; Webex core/plugin abstractions and Mocha/Sinon/`@webex/test-helper-chai` tests. Build target: `yarn workspace @webex/plugin-meetings build:src`.
50
+
51
+ ## Folder / Package Structure
52
+
53
+ ```text
54
+ src/meetings/
55
+ ├── collection.ts — module-owned collection
56
+ ├── index.ts — module facade/controller or primary exports
57
+ ├── meetings.types.ts — module type declarations
58
+ ├── request.ts — HTTP request boundary
59
+ ├── util.ts — normalization/helper functions
60
+ └── ai-docs/meetings-spec.md — canonical module specification
61
+ ```
62
+
63
+ ## Key Files (source of truth)
64
+
65
+ | File | Holds |
66
+ |---|---|
67
+ | `src/meetings/collection.ts` | module-owned collection |
68
+ | `src/meetings/index.ts` | module facade/controller or primary exports |
69
+ | `src/meetings/meetings.types.ts` | module type declarations |
70
+ | `src/meetings/request.ts` | HTTP request boundary |
71
+ | `src/meetings/util.ts` | normalization/helper functions |
72
+ | `test/unit/spec/meetings/collection.js` and 3 sibling test file(s) | mirrored characterization/unit coverage |
73
+
74
+ ## Public Surface
75
+
76
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
77
+ |---|---|---|---|---|---|---|
78
+ | `meetings.1` | SDK collection | `MeetingCollection.set()`, `getByKey()`, `getActiveBreakoutLocus()`, and `getActiveWebrtcMeeting()` | Store Meeting models and resolve current normal/breakout active meetings. | Preserve collection key aliases and active-meeting selection. | `src/meetings/collection.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
79
+ | `meetings.2` | SDK / registration | `executeRegistrationStep()`, `register()`, and `unregister()` | Coordinate device registration and Meetings-owned Mercury/Locus/ROAP listener lifecycle. | Preserve tracked step results and the exact listeners each lifecycle method adds/removes. | `src/meetings/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
80
+ | `meetings.3` | SDK / diagnostics/media effects | `uploadLogs()`, `getReachability()`, `startReachability()`, `getGeoHint()`, `createNoiseReductionEffect()`, and `createVirtualBackgroundEffect()` | Expose logs, reachability/geo diagnostics, and configured media-effect creation. | `startReachability()` returns the gather promise directly. Only the separate registration callback absorbs its rejection. Preserve that boundary, other request outcomes, and effect construction inputs. | `src/meetings/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
81
+ | `meetings.4` | SDK / preferences | `fetchUserPreferredWebexSite()`, `getPersonalMeetingRoom()`, `fetchSitePreferencesMeViaSite()`, and `getBasicMeetingInformation()` | Fetch account/site preferences, PMR, and lightweight meeting information. | Preserve parallel independent request behavior; do not claim a strict ordering across site/geo/reachability/H264 setup. | `src/meetings/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
82
+ | `meetings.5` | SDK / static links | `fetchStaticMeetingLink()`, `enableStaticMeetingLink()`, and `disableStaticMeetingLink()` | Delegate static meeting-link lookup and mutation to meeting-info V2. | Preserve typed meeting-info errors and direct service outcomes. | `src/meetings/index.ts`, `src/meeting-info/meeting-info-v2.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
83
+ | `meetings.6` | SDK / meeting lookup | `create()`, `getMeetingByType()`, `getAllMeetings()`, and `getActiveWebrtcMeeting()` | Create/find/list Meeting models from destination information and collection keys. | Preserve model reuse/collection identity and lookup-type behavior. | `src/meetings/index.ts`, `src/meetings/collection.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
84
+ | `meetings.7` | SDK / synchronization | `syncMeetings()`, `sortLocusArrayToUpdate()`, `checkHandleBreakoutLocus()`, and `getCorrespondingMeetingByLocus()` | Reconcile active Loci into the collection, including breakout/main relationships. | All four methods are defined on `Meetings` in `index.ts`; Online Mercury handling invokes this sync, while `register()` itself does not. | `src/meetings/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
85
+ | `meetings.8` | request/types | `MeetingRequest.getActiveMeetings()`, `fetchGeoHint()`, `getMeetingPreferences()`, `fetchSitePreferencesMeViaSite()`, and `determineRedirections()` plus `LocusEvent`, `BasicMeetingInformation`, `INoiseReductionEffect`, `IVirtualBackgroundEffect`, `MEETING_KEY`, `MeetingRegistrationStatus`, `SitePreferenceSelectOption`, `FetchSitePreferencesMeViaSiteOptions`, `DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS`, and `SitePreferencesResponse` | Provide direct service requests and the exact collection/configuration vocabulary consumed by Meetings. | Preserve request result shapes, enum/raw option values, and default site-selection options. | `src/meetings/request.ts`, `src/meetings/meetings.types.ts`, `src/meetings/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
86
+ | `meetings.9` | SDK / diagnostics | `getLogger()` | Return the logger used by Meetings and child meeting operations. | Preserve logger identity and existing call sites. | `src/meetings/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
87
+
88
+ ### Emitted events
89
+
90
+ Current source emits or forwards these observable literals for this operation boundary. Preserve literal values, scope, payload shape, and emission timing; a constant name alone is not a substitute for the consumer-visible value.
91
+
92
+ | Event literal | Constant / expression | Emission evidence |
93
+ |---|---|---|
94
+ | `meeting:added` | `EVENT_TRIGGERS.MEETING_ADDED` | `src/meetings/index.ts` |
95
+ | `meeting:logUpload:failure` | `EVENT_TRIGGERS.MEETING_LOG_UPLOAD_FAILURE` | `src/meetings/index.ts` |
96
+ | `meeting:logUpload:success` | `EVENT_TRIGGERS.MEETING_LOG_UPLOAD_SUCCESS` | `src/meetings/index.ts` |
97
+ | `meeting:removed` | `EVENT_TRIGGERS.MEETING_REMOVED` | `src/meetings/index.ts` |
98
+ | `meetings:ready` | `EVENT_TRIGGERS.MEETINGS_READY` | `src/meetings/index.ts` |
99
+ | `meetings:registered` | `EVENT_TRIGGERS.MEETINGS_REGISTERED` | `src/meetings/index.ts` |
100
+ | `meetings:unregistered` | `EVENT_TRIGGERS.MEETINGS_UNREGISTERED` | `src/meetings/index.ts` |
101
+
102
+ Compatibility notes:
103
+ - Prefer additive options and payload fields. Preserve method/event names, rejection semantics, and cleanup timing; route public changes through `src/index.ts` or the documented owning object.
104
+
105
+ ## Requires (dependencies)
106
+
107
+ Webex core host, device and Mercury plugins, meeting-info services, Meeting construction, reachability, and metrics.
108
+
109
+ ## Requirements
110
+
111
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
112
+ |---|---|---|---|---|---|---|
113
+ | `MEETINGS-R-001` | create/get meeting and collection lookup. | Owns the registered plugin lifecycle, meeting discovery, registration, realtime routing, and the top-level meeting collection. | `src/meetings/index.ts` | `test/unit/spec/meetings/index.js` | none | PRESENT |
114
+ | `MEETINGS-R-002` | register/unregister device and Mercury lifecycle. | Registration owns device/listener readiness; active-meeting synchronization is a separate online-event flow. | `src/meetings/index.ts`, `src/meetings/request.ts` | `test/unit/spec/meetings/index.js` | unregister does not remove the OFFLINE listener; retain as a targeted teardown gap | PRESENT |
115
+ | `MEETINGS-R-003` | `executeRegistrationStep()` marks a step `true` whenever its supplied promise resolves and rethrows a rejection without resetting other flags. `fetchUserPreferredWebexSite()` catches its own failures and resolves, while the `startReachability` registration callback catches that gather rejection and resolves; those two steps are therefore marked successful even when their underlying work failed. `unregister()` removes Locus, ROAP, and `ONLINE` Mercury listeners plus device state, but leaves the `OFFLINE` listener installed. | Registration status records wrapper settlement, not necessarily underlying site/reachability success; other rejected steps preserve partial progress until the next `register()` reset, and the residual `OFFLINE` listener must stay visible as a teardown gap. | `src/meetings/index.ts` | `test/unit/spec/meetings/index.js` | characterize absorbed site/reachability failures, partial status after a non-absorbed rejection, and the surviving `OFFLINE` callback | PRESENT |
116
+ | `MEETINGS-R-004` | `register()` starts site, geo, reachability, device-registration, and H.264 work together through `Promise.all`; Mercury connect is chained after device registration. Each wrapper-resolved step updates its own status, including the failure-absorbing site and reachability wrappers. `syncMeetings()` runs later from the Mercury `ONLINE` handler installed by `listenForEvents()`. | Registration readiness and active-meeting synchronization are distinct phases, and preserving wrapper-level settlement and actual concurrency prevents callers from depending on a nonexistent success definition or serial order. | `src/meetings/index.ts`, `src/meetings/meetings.types.ts` | `test/unit/spec/meetings/index.js` | none | PRESENT |
117
+ | `MEETINGS-R-007` | `emitWasmRuntimePerformance(correlationId)` is a `once()`-wrapped private probe that runs `WasmRuntimeProbe.check()` and reports `WASM_RUNTIME_PERFORMANCE` (`js_sdk_wasm_runtime_performance`) with `status`, `capability`, `reason`, the destructured measurements `divRatio`, `sqrtRatio`, `addNsPerOp`, `addMedianMs`, `divMedianMs`, `sqrtMedianMs`, and `correlation_id`. Each measurement defaults to `null` when `result.measurements` is absent or omits it. Both a probe rejection and a metric-submission rejection are caught and logged only. | The probe is diagnostic: it exists to find browsers where real-time WASM effects run poorly, so it must never be able to fail meeting creation. Explicit `null` defaults keep the metric schema fixed-width so the fields stay comparable across browsers that report partial measurements, and `once()` keeps one sample per plugin instance rather than one per meeting. | `src/meetings/index.ts`, `src/metrics/constants.ts` | `test/unit/spec/meetings/index.js` | none | PRESENT |
118
+ | `MEETINGS-R-005` | Mercury/Locus events resolve an existing meeting by supported keys before creating or routing a new object. | Stable meeting identity prevents duplicate Meeting objects and misrouted realtime updates. | `src/meetings/index.ts`, `src/meetings/collection.ts` | `test/unit/spec/meetings/index.js`, `test/unit/spec/meetings/collection.js` | none | PRESENT |
119
+ | `MEETINGS-R-006` | Reachability, geo hints, site preferences, PMR, and active-meeting queries delegate to their current request/controller boundaries. | Central plugin access must preserve host credentials, service discovery, and established response/error behavior. | `src/meetings/index.ts`, `src/meetings/request.ts` | `test/unit/spec/meetings/request.js` | none | PRESENT |
120
+
121
+ ## Design Overview
122
+
123
+ `Meetings` is the registered plugin facade and collection owner. `register()` starts site, geo, reachability, device-registration, and H.264 steps concurrently in `Promise.all`; Mercury connection follows successful device registration, and listeners are installed only after the aggregate succeeds. Site-preference fetching absorbs its own failures, and the registration callback absorbs a reachability rejection, so both wrappers can resolve and be marked successful without completing their underlying work. Synchronization is a separate `syncMeetings()` call triggered by the Mercury `ONLINE` handler.
124
+
125
+ ## Data Flow
126
+
127
+ ```mermaid
128
+ flowchart LR
129
+ Consumer[webex.meetings consumer] --> Plugin[index.ts]
130
+ Plugin --> Request[request.ts]
131
+ Plugin --> Info[src/meeting-info]
132
+ Plugin --> Collection[collection.ts]
133
+ Plugin --> Device[Webex device registration]
134
+ Plugin --> Mercury[Mercury connection and events]
135
+ Mercury --> Sync[syncMeetings]
136
+ Sync --> Request
137
+ Collection --> Meeting[src/meeting]
138
+ ```
139
+
140
+ ## Sequence Diagram(s)
141
+
142
+ Sequence coverage:
143
+
144
+ | Operation group | Diagram | Failure coverage |
145
+ |---|---|---|
146
+ | UC-1…UC-5 — Meetings registration and synchronization operation groups | Meetings registration and synchronization primary sequence | registration-step failure, independent setup requests, online sync rejection, and listener teardown |
147
+ | UC-1…UC-5 — Meetings registration and synchronization alternate/failure paths | Meetings registration and synchronization alternate/failure sequence | registration-step rejection, Mercury/device failure, unsupported destination, site-preference parameter error, or meeting-sync request failure |
148
+
149
+ ### Meetings registration and synchronization primary sequence
150
+
151
+ ```mermaid
152
+ sequenceDiagram
153
+ participant C as Consumer
154
+ participant M as Meetings
155
+ participant D as Device
156
+ participant Q as Mercury
157
+ participant R as MeetingRequest
158
+ C->>M: register(options)
159
+ par independent registration work
160
+ M->>M: site, geo, reachability, and H.264 steps
161
+ and device path
162
+ M->>D: register device
163
+ D-->>M: device registration succeeds
164
+ M->>Q: connect Mercury
165
+ end
166
+ M->>M: install listeners after Promise.all succeeds
167
+ M-->>C: registration result
168
+ Q-->>M: ONLINE
169
+ M->>M: syncMeetings({keepOnlyLocusMeetings:false})
170
+ M->>R: getActiveMeetings()
171
+ R-->>M: active Loci
172
+ M->>M: reconcile MeetingCollection
173
+ ```
174
+
175
+ ### Meetings registration and synchronization alternate/failure sequence
176
+
177
+ ```mermaid
178
+ sequenceDiagram
179
+ participant C as SDK consumer
180
+ participant M as Meetings
181
+ participant W as Webex registration dependencies
182
+ C->>M: register or unregister
183
+ alt registration
184
+ M->>W: run the configured steps; site/geo/reachability/H.264 setup may run in parallel
185
+ W-->>M: step result, absorbed site/reachability failure, or propagated rejection
186
+ M-->>C: registration result; absorbed steps are marked true and completed flags remain set on propagated rejection
187
+ else unregistration
188
+ M->>W: remove Mercury/device registration state
189
+ W-->>M: cleanup result
190
+ M-->>C: unregistration result
191
+ end
192
+ ```
193
+
194
+ ## Class / Component Relationships
195
+
196
+ ```mermaid
197
+ classDiagram
198
+ class Consumer
199
+ class Plugin
200
+ class Request
201
+ class Info
202
+ class Collection
203
+ class Device
204
+ class Mercury
205
+ class Sync
206
+ class Meeting
207
+ Consumer --> Plugin
208
+ Plugin --> Request
209
+ Plugin --> Info
210
+ Plugin --> Collection
211
+ Plugin --> Device
212
+ Plugin --> Mercury
213
+ Mercury --> Sync
214
+ Sync --> Request
215
+ Collection --> Meeting
216
+ ```
217
+
218
+ The arrows identify ownership and delegation inside `src/meetings/`; files that only declare types or constants are not presented as transports.
219
+
220
+ ## Use Cases
221
+
222
+ - **UC-1:** Register device and Meetings-owned listeners through tracked registration steps without treating active-meeting synchronization as part of `register()` itself. Evidence: `src/meetings/index.ts`.
223
+ - **UC-2:** On Mercury `ONLINE`, `Meetings.syncMeetings()` fetches active Loci through `MeetingRequest.getActiveMeetings()` and reconciles corresponding main/breakout Meeting models into the collection. Evidence: `src/meetings/index.ts`, `src/meetings/request.ts`.
224
+ - **UC-3:** Create or retrieve a Meeting by destination/type while reusing collection identity when a matching model exists. Evidence: `src/meetings/index.ts`, `src/meetings/collection.ts`.
225
+ - **UC-4:** Start/read reachability, fetch geo/site preferences, PMR, or basic meeting information through their independent request paths. Evidence: `src/meetings/index.ts`, `src/meetings/request.ts`.
226
+ - **UC-5:** Fetch, enable, or disable a static meeting link through the meeting-info V2 facade and preserve its typed outcomes. Evidence: `src/meetings/index.ts`, `src/meeting-info/meeting-info-v2.ts`.
227
+
228
+ ## State Model
229
+
230
+ Registration progress, meeting collection entries, sync state, and listener handles are held in memory for the plugin lifetime.
231
+
232
+ ## Business Rules & Invariants
233
+
234
+ - A realtime event is routed to its corresponding meeting before a new meeting is created; unregister removes Locus/ROAP/`ONLINE` listeners and registration state but currently leaves the `OFFLINE` listener installed. Enforced by `src/meetings/index.ts`.
235
+
236
+ ## Concurrency & Reactive Flow
237
+
238
+ - Registration steps run through one `Promise.all` aggregate, with Mercury connection chained behind device registration. `executeRegistrationStep()` sets a flag after its callback resolves. Site-preference fetching and the registration reachability callback absorb their own failures and therefore still set their flags; a rejection from another step propagates without clearing flags already set. Unregistration removes the Mercury/device registration owned by the plugin; individual meeting synchronization requests remain separate returned promises rather than silently changing registration success.
239
+
240
+ ## State Machine
241
+
242
+ ```mermaid
243
+ stateDiagram-v2
244
+ [*] --> unregistered
245
+ unregistered --> registering: register()
246
+ registering --> registered: required steps succeed
247
+ registering --> unregistered: aggregate rejects; completed step flags remain until next register()
248
+ registered --> syncing: Mercury ONLINE
249
+ syncing --> registered: collection reconciled or sync settles
250
+ registered --> unregistered: unregister()
251
+ ```
252
+
253
+ These labels summarize the concrete `registered`, registration-promise, registration-step, and Mercury-`ONLINE` transitions in `src/meetings/index.ts`.
254
+
255
+ ## Error Handling & Failure Modes
256
+
257
+ | Condition | Signal | Caller recovery |
258
+ |---|---|---|
259
+ | Site-preference fetching or the registration reachability call fails | The inner catch logs/absorbs the failure, `executeRegistrationStep()` observes resolution, and `fetchWebexSite` or `startReachability` is marked `true`; that failure alone does not reject registration. | Treat those flags as wrapper-completion indicators and inspect diagnostics/current data before assuming the underlying work succeeded. |
260
+ | Another registration step or Mercury/device registration rejects | The returned registration promise rejects. The failing step is not marked successful, and flags already set by concurrently completed steps are not reset until the next `register()` initializes registration status. | Correct the failing dependency and treat the next registration call as the status reset boundary. |
261
+ | `fetchSitePreferencesMeViaSite()` has neither `options.siteUrl` nor `preferredWebexSite` | `MeetingRequest.fetchSitePreferencesMeViaSite()` throws `ParameterError` synchronously before returning a promise; the non-`async` facade returns that direct call, so `.catch()` on a nonexistent result cannot observe the error. | Supply either site URL and wrap the call boundary in synchronous error handling when inputs may be absent. |
262
+ | Another destination or preference request rejects | Its returned request promise preserves the implemented rejection. | Supply supported input or handle the returned rejection for that specific operation. |
263
+ | Meeting synchronization request rejects | That sync request rejects independently of plugin registration state. | Handle or repeat synchronization under the owning meeting workflow. |
264
+ | The WASM runtime probe or its metric submission rejects | The rejection is caught and logged as an error; no event is emitted, no metric is retried, and meeting creation is unaffected. | Read the logged diagnostic; do not treat a missing `js_sdk_wasm_runtime_performance` metric as a meeting-creation failure. |
265
+
266
+ ## Pitfalls
267
+
268
+ - Registration is multi-step. Treating device registration, Mercury setup, and active-meeting sync as one opaque call loses the failing stage and can leak listeners.
269
+ - Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source helper is not exported directly.
270
+
271
+ ## Host Integration & Theming
272
+
273
+ The Webex SDK host supplies initialized request/device/Mercury/media capabilities and exposes this behavior through `webex.meetings` or its Meeting objects. The module renders no UI and has no theme contract.
274
+
275
+ ## Key Design Trade-off
276
+
277
+ - Central coordination favors consistent event routing and one meeting collection at the cost of a large orchestrator; feature behavior stays in child modules.
278
+
279
+ ## Test-Case Strategy (module)
280
+
281
+ Use the current mirrored suites: `test/unit/spec/meetings/collection.js`, `test/unit/spec/meetings/index.js`, `test/unit/spec/meetings/request.js`, `test/unit/spec/meetings/utils.js`. Characterize the meetings-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
282
+
283
+ | Behavior / Requirement | Existing test evidence | Gap |
284
+ |---|---|---|
285
+ | `MEETINGS-R-001` | `test/unit/spec/meetings/index.js` | cover registration, online sync, create/lookup, preferences, reachability, and static-link groups |
286
+ | `MEETINGS-R-002` | `test/unit/spec/meetings/index.js` | unregister does not remove the OFFLINE listener; retain as a targeted teardown gap |
287
+ | `MEETINGS-R-003` | `test/unit/spec/meetings/index.js` | assert absorbed site/reachability failures mark their wrapper steps true, plus exact listener removal and the surviving `OFFLINE` listener |
288
+ | `MEETINGS-R-004` | `test/unit/spec/meetings/index.js` | verify `Promise.all` concurrency, device-before-Mercury ordering, wrapper-settlement flags, and non-absorbed rejection without a failure reset |
289
+ | `MEETINGS-R-005` | `test/unit/spec/meetings/index.js`, `test/unit/spec/meetings/collection.js` | verify alternate-key collision cases |
290
+ | `MEETINGS-R-006` | `test/unit/spec/meetings/request.js` | none |
291
+ | `MEETINGS-R-007` | `test/unit/spec/meetings/index.js` | covered for the full-measurements payload, the `null` defaults when measurements are absent, and the swallowed probe rejection |
292
+
293
+ ## Traceability
294
+
295
+ - Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
296
+ - Coverage state and contracts baseline: `../../../.sdd/manifest.json`
@@ -219,19 +219,34 @@ export default class Meetings extends WebexPlugin {
219
219
  * @returns {void}
220
220
  */
221
221
  private emitWasmRuntimePerformance = once((correlationId: string): void => {
222
- // This check is designed to swallow any probe/metrics failure so it can never break meeting
223
- // creation, while still reporting the status so we can track browsers with WASM issues.
222
+ // Probe and telemetry failures must not prevent meeting creation.
224
223
  WasmRuntimeProbe.check()
225
224
  .then((result) => {
225
+ const {status, capability, reason, measurements} = result;
226
+ const {
227
+ divRatio = null,
228
+ sqrtRatio = null,
229
+ addNsPerOp = null,
230
+ addMedianMs = null,
231
+ divMedianMs = null,
232
+ sqrtMedianMs = null,
233
+ } = measurements ?? {};
234
+ const measurementsLog = JSON.stringify(measurements);
235
+
226
236
  LoggerProxy.logger.log(
227
- `Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status: ${result.status}, ratio: ${result.ratio}, wasmMs: ${result.wasmMs}, jsMs: ${result.jsMs}`
237
+ `Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status: ${status}, capability: ${capability}, reason: ${reason}, measurements: ${measurementsLog}`
228
238
  );
229
239
 
230
240
  return Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.WASM_RUNTIME_PERFORMANCE, {
231
- status: result.status,
232
- ratio: result.ratio,
233
- wasmMs: result.wasmMs,
234
- jsMs: result.jsMs,
241
+ status,
242
+ capability,
243
+ reason,
244
+ divRatio,
245
+ sqrtRatio,
246
+ addNsPerOp,
247
+ addMedianMs,
248
+ divMedianMs,
249
+ sqrtMedianMs,
235
250
  correlation_id: correlationId,
236
251
  });
237
252
  })
@@ -744,7 +759,14 @@ export default class Meetings extends WebexPlugin {
744
759
 
745
760
  // @ts-ignore
746
761
  this.webex.internal.mercury.on(ONLINE, () => {
747
- this.syncMeetings({keepOnlyLocusMeetings: false});
762
+ // Fire-and-forget sync on socket recovery. Unlike the reconnection manager (which awaits and
763
+ // retries), nothing consumes this promise, so catch its rejection to avoid an unhandled
764
+ // promise rejection (a transient guest classic-sync failure would otherwise crash Node hosts).
765
+ this.syncMeetings({keepOnlyLocusMeetings: false}).catch((error) => {
766
+ LoggerProxy.logger.warn(
767
+ `Meetings:index#listenForEvents --> syncMeetings after ONLINE event failed: ${error}`
768
+ );
769
+ });
748
770
  });
749
771
 
750
772
  // @ts-ignore
@@ -1470,7 +1492,11 @@ export default class Meetings extends WebexPlugin {
1470
1492
  * @memberof Meetings
1471
1493
  */
1472
1494
  private destroy(meeting: Meeting, reason: object) {
1473
- MeetingUtil.cleanUp(meeting);
1495
+ MeetingUtil.cleanUp(meeting, {preserveVoiceaChannel: false});
1496
+
1497
+ // Tear down hash tree parsers here (and not in MeetingUtil.cleanUp) so they survive
1498
+ // leave/endMeetingForAll to consume the final sentinel END message from Locus.
1499
+ meeting.locusInfo?.cleanUp();
1474
1500
  // keep some basic info about the deleted meeting forever
1475
1501
  this.deletedMeetings.set(meeting.id, {
1476
1502
  id: meeting.id,
@@ -1941,7 +1967,8 @@ export default class Meetings extends WebexPlugin {
1941
1967
  }
1942
1968
 
1943
1969
  /**
1944
- * Syncs all the meetings from server. Does nothing and returns immediately if unverified guest.
1970
+ * Syncs all the meetings from server. For unverified guests it skips the getActiveMeetings() call
1971
+ * (which Locus rejects for them) and instead resyncs each meeting individually via LocusInfo#sync.
1945
1972
  * @param {boolean} keepOnlyLocusMeetings - whether the sync should keep only locus meetings or any other meeting in meetingCollection
1946
1973
  * @returns {Promise<void>}
1947
1974
  * @public
@@ -1952,10 +1979,15 @@ export default class Meetings extends WebexPlugin {
1952
1979
  skipHashTreeSync = false,
1953
1980
  } = {}): Promise<void> {
1954
1981
  // @ts-ignore
1955
- if (this.webex.credentials.isUnverifiedGuest) {
1982
+ const isUnverifiedGuest = Boolean(this.webex.credentials.isUnverifiedGuest);
1983
+
1984
+ if (isUnverifiedGuest) {
1956
1985
  LoggerProxy.logger.info(
1957
1986
  'Meetings:index#syncMeetings --> user is unverified guest, skipping calling Locus for meeting sync'
1958
1987
  );
1988
+
1989
+ // Locus rejects getActiveMeetings() for unverified guests, so the per-meeting sync below
1990
+ // (with canSyncClassicLocus enabled) resyncs each classic meeting individually instead.
1959
1991
  } else {
1960
1992
  try {
1961
1993
  const locusArray = await this.request.getActiveMeetings();
@@ -2010,20 +2042,24 @@ export default class Meetings extends WebexPlugin {
2010
2042
  }
2011
2043
  }
2012
2044
 
2013
- if (!skipHashTreeSync) {
2014
- // Trigger hash tree syncs for all remaining meetings
2015
- const remainingMeetings = this.meetingCollection.getAll();
2016
- const syncPromises = [];
2017
-
2018
- for (const meeting of Object.values(remainingMeetings) as any[]) {
2019
- if (meeting.locusInfo) {
2020
- syncPromises.push(meeting.locusInfo.syncAllHashTreeDatasets());
2021
- }
2045
+ // Resync each remaining meeting via LocusInfo#sync, which routes to hash tree or classic. For
2046
+ // signed-in users classic meetings were already synced above, so only the hash tree sync runs.
2047
+ const remainingMeetings = this.meetingCollection.getAll();
2048
+ const syncPromises = [];
2049
+
2050
+ for (const meeting of Object.values(remainingMeetings) as any[]) {
2051
+ if (meeting.locusInfo) {
2052
+ syncPromises.push(
2053
+ meeting.locusInfo.sync(meeting, {
2054
+ canSyncClassicLocus: isUnverifiedGuest,
2055
+ canSyncHashTree: !skipHashTreeSync,
2056
+ })
2057
+ );
2022
2058
  }
2059
+ }
2023
2060
 
2024
- if (syncPromises.length > 0) {
2025
- await Promise.all(syncPromises);
2026
- }
2061
+ if (syncPromises.length > 0) {
2062
+ await Promise.all(syncPromises);
2027
2063
  }
2028
2064
  }
2029
2065
 
@@ -0,0 +1,196 @@
1
+ <!-- sdd-generated-metadata
2
+ doc_kind: module-spec
3
+ generated_from: module-spec@0.2.2
4
+ generator_plugin: repo-annotation@1.0.5+codex.20260818094939
5
+ generated_by: codex
6
+ approved_by: repository user
7
+ updated_at: 2026-08-22T15:21:29Z
8
+ validation_status: pass-with-warnings
9
+ -->
10
+ # MEMBER — SPEC
11
+
12
+ > Start here → root [`AGENTS.md`](../../../AGENTS.md) · router [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md) · system [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md). This is the canonical source-local spec for `src/member/`.
13
+
14
+ ## Metadata
15
+
16
+ | Field | Value |
17
+ |---|---|
18
+ | Module id | `member` |
19
+ | Source path(s) | `src/member/` |
20
+ | Parent spec | — |
21
+ | Doc kind | Module spec |
22
+ | Coverage score | 93% assessed 2026-08-22; 13/14 mandatory fields present; all critical and Important fields present; one noncritical polish gap remains; pending independent validation of the participant-role repair |
23
+ | Generated from | `module-spec` @ SDLC template library `0.2.2` |
24
+ | generated_by / approved_by / updated_at | codex / repository user / 2026-08-22T15:21:29Z |
25
+ | Validation status | pass-with-warnings |
26
+
27
+ ## Evidence Rules
28
+
29
+ Requirements cite current implementation and mirrored unit-test paths. Current code wins over retained prose when they conflict; commit and PR history are excluded by repository-owner decision. Missing test evidence is stated as a gap rather than inferred.
30
+
31
+ ## Source Material Register
32
+
33
+ | Source material | Scope | Decision | Detail location or disposition |
34
+ |---|---|---|---|
35
+ | Retained package consumer documentation | overview / API / behavior / tests | used and verified; participant property semantics and the participant-email privacy change were placed in public surface, invariants, and security |
36
+ | Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
37
+
38
+ ## Overview
39
+
40
+ `src/member/` contains 3 direct source/reference file(s) and has 2 mirrored unit-test file(s). This spec separates its public operations, runtime data movement, component ownership, state applicability, and verification boundary.
41
+
42
+ ## Purpose / Responsibility
43
+
44
+ Builds and updates the normalized client projection for one Locus participant.
45
+
46
+ ## Stack
47
+
48
+ TypeScript/JavaScript in the Node 22.14 Yarn workspace; Webex core/plugin abstractions and Mocha/Sinon/`@webex/test-helper-chai` tests. Build target: `yarn workspace @webex/plugin-meetings build:src`.
49
+
50
+ ## Folder / Package Structure
51
+
52
+ ```text
53
+ src/member/
54
+ ├── index.ts — module facade/controller or primary exports
55
+ ├── types.ts — module type declarations
56
+ ├── util.ts — normalization/helper functions
57
+ └── ai-docs/member-spec.md — canonical module specification
58
+ ```
59
+
60
+ ## Key Files (source of truth)
61
+
62
+ | File | Holds |
63
+ |---|---|
64
+ | `src/member/index.ts` | module facade/controller or primary exports |
65
+ | `src/member/types.ts` | module type declarations |
66
+ | `src/member/util.ts` | normalization/helper functions |
67
+ | `test/unit/spec/member/index.js` and 1 sibling test file(s) | mirrored characterization/unit coverage |
68
+
69
+ ## Public Surface
70
+
71
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
72
+ |---|---|---|---|---|---|---|
73
+ | `member.1` | SDK model | `Member` construction/update from `Participant` | Normalize participant person/device, roles, controls, status, media, and identifiers into the roster model. | Preserve the observable member fields consumed by `MembersCollection` and Meeting. | `src/member/index.ts`, `src/member/types.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
74
+ | `member.2` | SDK mutation | `processPairedDevice()`, `setIsHost()`, and `setIsSelf()` | Derive paired-device and local host/self flags from authoritative participant context. | Preserve each processor's synchronous throw-or-sentinel behavior; do not generalize all missing inputs into `ParameterError` or a remote rejection. | `src/member/index.ts`, `src/member/util.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
75
+ | `member.3` | SDK mutation | `setIsContentSharing()`, `processIsContentSharing()`, and `processIsRecording()` | Project current share and recording state onto the member without owning their transport. | Preserve boolean projection rules and synchronous updates. | `src/member/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
76
+ | `member.4` | exported participant contracts | `MemberId`, `IExternalRoles`, `ServerRoles`, `ServerRoleShape`, `MediaStatus`, `IMediaStatus`, `Csi`, `Direction`, `ParticipantUrl`, `MediaSession`, `Intent`, `ParticipantDevice`, `ParticipantPerson`, `ParticipantMediaStatus`, `ParticipantControls`, and `Participant` | Share the exact participant input vocabulary used by Locus parsing and roster reconciliation. | Add fields compatibly; role, direction, and media raw values remain package contracts. | `src/member/types.ts`, `src/member/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
77
+
78
+ Compatibility notes:
79
+ - Prefer additive options and payload fields. Preserve method/event names, rejection semantics, and cleanup timing; route public changes through `src/index.ts` or the documented owning object.
80
+
81
+ ## Requires (dependencies)
82
+
83
+ Locus participant payloads, member normalization utilities, and shared constants.
84
+
85
+ ## Requirements
86
+
87
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
88
+ |---|---|---|---|---|---|---|
89
+ | `MEMBER-R-001` | construct a member from participant data. | Builds and updates the normalized client projection for one Locus participant. | `src/member/index.ts` | `test/unit/spec/member/index.js` | none | PRESENT |
90
+ | `MEMBER-R-002` | update identity, roles, controls, status, and media properties. | Roster consumers rely on stable synchronous participant projections even as Locus fields arrive incrementally. | `src/member/index.ts`, `src/member/util.ts` | `test/unit/spec/member/index.js` | malformed paired-device/role inputs need synchronous error coverage | PRESENT |
91
+ | `MEMBER-R-003` | Missing participant input has processor-specific synchronous outcomes: validation-heavy helpers such as audio/video/hand/feature/recording/media-status processing and `canReclaimHost()` throw `ParameterError`; `canApproveAIEnablement()` and only the helpers whose implementations explicitly default a present participant's policy value return `false`; identity/name/recording-member extractors may return `null`; `extractStatus()` returns `_NOT_IN_MEETING_`. The module owns no asynchronous resource, listener, or timer. | Callers must preserve each helper's implemented sentinel or exception instead of treating all malformed or partial participant data as one failure contract. | `src/member/` | `test/unit/spec/member/index.js`, `test/unit/spec/member/util.js` | none | PRESENT |
92
+
93
+ ## Design Overview
94
+
95
+ `Member` is a local participant model. `util.ts` synchronously normalizes Locus participant/person/device fields into the model and `types.ts` defines shapes; the module performs no request or event transport.
96
+
97
+ ## Data Flow
98
+
99
+ ```mermaid
100
+ flowchart LR
101
+ LocusParticipant[Raw participant/person/device data] --> Util[util.ts normalization]
102
+ Types[types.ts] --> Util
103
+ Util --> Member[index.ts model]
104
+ Member --> Parent[Members collection / Meeting]
105
+ ```
106
+
107
+ ## Sequence Diagram(s)
108
+
109
+ Sequence coverage:
110
+
111
+ | Operation group | Diagram | Failure coverage |
112
+ |---|---|---|
113
+ | UC-1…UC-3 — member projection operation groups | Member projection primary sequence | malformed participant input and synchronous projection updates without transport cleanup |
114
+ | UC-1…UC-3 — member projection alternate/failure paths | Member projection alternate/failure sequence | partial/malformed participant data or absent optional person/device fields |
115
+
116
+ ### Member projection primary sequence
117
+
118
+ ```mermaid
119
+ sequenceDiagram
120
+ participant P as Members collection
121
+ participant U as member/util.ts
122
+ participant M as Member
123
+ P->>U: raw Locus participant
124
+ U-->>P: normalized member fields
125
+ P->>M: create or update model
126
+ M-->>P: current participant projection
127
+ ```
128
+
129
+ ### Member projection alternate/failure sequence
130
+
131
+ ```mermaid
132
+ sequenceDiagram
133
+ participant P as Locus participant input
134
+ participant U as member/util.ts
135
+ participant M as Member model
136
+ P->>U: participant and current model fields
137
+ alt processor requires participant and input is absent
138
+ U--xM: synchronous ParameterError
139
+ else sentinel-returning processor receives absent/partial input
140
+ U-->>M: false, null, or _NOT_IN_MEETING_
141
+ else participant is present
142
+ U->>U: derive identity, roles, controls, status, and media fields
143
+ U-->>M: normalized values and optional-field defaults
144
+ end
145
+ ```
146
+
147
+ ## Class / Component Relationships
148
+
149
+ ```mermaid
150
+ classDiagram
151
+ class LocusParticipant
152
+ class Util
153
+ class Types
154
+ class Member
155
+ class Parent
156
+ LocusParticipant --> Util
157
+ Types --> Util
158
+ Util --> Member
159
+ Member --> Parent
160
+ ```
161
+
162
+ The arrows identify ownership and delegation inside `src/member/`; files that only declare types or constants are not presented as transports.
163
+
164
+ ## Use Cases
165
+
166
+ - **UC-1:** Normalize a `Participant` with person, device, role, controls, status, and media data into one local `Member` projection. Evidence: `src/member/index.ts`.
167
+ - **UC-2:** Recompute host/self/paired-device flags when authoritative Locus context changes, preserving the selected processor's synchronous `ParameterError`, `false`, `null`, or `_NOT_IN_MEETING_` outcome for absent/partial input. Evidence: `src/member/index.ts`, `src/member/util.ts`.
168
+ - **UC-3:** Update content-sharing and recording projections without performing I/O; roster requests and update events remain owned by `src/members/`. Evidence: `src/member/index.ts`, `src/members/index.ts`.
169
+
170
+ ## State Model
171
+
172
+ One in-memory participant projection is updated in place as Locus/member data changes.
173
+
174
+ ## Business Rules & Invariants
175
+
176
+ - Participant identity and role/media/control fields derive from the newest supported payload; removed PII such as participant email is not reintroduced. Enforced by `src/member/index.ts` and supporting code under `src/member/`.
177
+
178
+ ## Pitfalls
179
+
180
+ - A participant can expose identity, person, device, and media fragments at different times; treat missing optional fragments as incomplete state, not deletion.
181
+ - Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source helper is not exported directly.
182
+
183
+ ## Test-Case Strategy (module)
184
+
185
+ Use the current mirrored suites: `test/unit/spec/member/index.js`, `test/unit/spec/member/util.js`. Characterize the member-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
186
+
187
+ | Behavior / Requirement | Existing test evidence | Gap |
188
+ |---|---|---|
189
+ | `MEMBER-R-001` | `test/unit/spec/member/index.js` | cover participant construction plus each synchronous projection processor |
190
+ | `MEMBER-R-002` | `test/unit/spec/member/index.js` | malformed paired-device/role inputs need synchronous error coverage |
191
+ | `MEMBER-R-003` | `test/unit/spec/member/index.js`, `test/unit/spec/member/util.js` | assert the per-helper `ParameterError`, `false`, `null`, and `_NOT_IN_MEETING_` matrix without inventing transport rejection or cleanup |
192
+
193
+ ## Traceability
194
+
195
+ - Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
196
+ - Coverage state and contracts baseline: `../../../.sdd/manifest.json`