@webex/plugin-meetings 3.13.0-next.13 → 3.13.0-next.15
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.
- package/.repo-context.json +577 -0
- package/.sdd/manifest.json +1320 -428
- package/AGENTS.md +528 -72
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/config.js +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/webinar/index.js +1 -1
- package/docs/adr/0001-migrate-existing-docs-into-sdd.md +141 -0
- package/docs/adr/index.md +26 -0
- package/docs/architecture.md +816 -0
- package/docs/getting-started.md +177 -0
- package/docs/index.md +53 -0
- package/docs/specs/README.md +126 -0
- package/package.json +21 -21
- package/schemas/repo-context.schema.json +796 -0
- package/src/aiEnableRequest/docs/README.md +376 -0
- package/src/annotation/docs/README.md +402 -0
- package/src/breakouts/docs/README.md +643 -0
- package/src/controls-options-manager/docs/README.md +365 -0
- package/src/hashTree/docs/README.md +566 -0
- package/src/interceptors/docs/README.md +434 -0
- package/src/interpretation/docs/README.md +420 -0
- package/src/locus-info/docs/README.md +609 -0
- package/src/media/docs/README.md +488 -0
- package/src/meeting/docs/README.md +834 -0
- package/src/meeting-info/docs/README.md +352 -0
- package/src/meetings/docs/README.md +549 -0
- package/src/member/docs/README.md +347 -0
- package/src/members/docs/README.md +514 -0
- package/src/metrics/docs/README.md +287 -0
- package/src/multistream/docs/README.md +523 -0
- package/src/personal-meeting-room/docs/README.md +322 -0
- package/src/reachability/docs/README.md +548 -0
- package/src/reactions/docs/README.md +296 -0
- package/src/reconnection-manager/docs/README.md +485 -0
- package/src/recording-controller/docs/README.md +335 -0
- package/src/roap/docs/README.md +444 -0
- package/src/webinar/docs/README.md +425 -0
- package/.sdd/templates/.source.json +0 -30
- package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +0 -111
- package/.sdd/templates/component-repo/module-docs/module-spec.template.md +0 -321
- package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +0 -59
- package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +0 -49
- package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +0 -42
- package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +0 -120
- package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +0 -206
- package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +0 -90
- package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +0 -68
- package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +0 -111
- package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +0 -57
- package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +0 -69
- package/.sdd/templates/component-repo/standing-docs/RULES.template.md +0 -96
- package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +0 -84
- package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +0 -82
- package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +0 -94
- package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +0 -64
- package/.sdd/templates/component-repo/template-map.json +0 -112
- package/ai-docs/ARCHITECTURE.md +0 -208
- package/ai-docs/CONTRACTS.md +0 -267
- package/ai-docs/DATA_MODEL.md +0 -64
- package/ai-docs/GETTING_STARTED.md +0 -73
- package/ai-docs/GLOSSARY.md +0 -56
- package/ai-docs/REVIEW_CHECKLIST.md +0 -45
- package/ai-docs/RULES.md +0 -79
- package/ai-docs/SECURITY.md +0 -74
- package/ai-docs/SERVICE_STATE.md +0 -59
- package/ai-docs/SPEC_INDEX.md +0 -85
- package/ai-docs/TEST_INDEX.md +0 -45
- package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +0 -61
- package/ai-docs/patterns/defensive-error-propagation.md +0 -55
- package/ai-docs/patterns/event-scope-emission.md +0 -46
- package/ai-docs/patterns/source-to-test-path-mirroring.md +0 -45
- package/ai-docs/patterns/stateless-plugin-request-classes.md +0 -53
- package/ai-docs/patterns/typed-constants-and-enum-values.md +0 -47
- package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +0 -223
- package/src/annotation/ai-docs/annotation-spec.md +0 -236
- package/src/breakouts/ai-docs/breakouts-spec.md +0 -324
- package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +0 -243
- package/src/hashTree/ai-docs/hash-tree-spec.md +0 -267
- package/src/interceptors/ai-docs/interceptors-spec.md +0 -247
- package/src/interpretation/ai-docs/interpretation-spec.md +0 -256
- package/src/locus-info/ai-docs/locus-info-spec.md +0 -293
- package/src/media/ai-docs/media-spec.md +0 -267
- package/src/meeting/ai-docs/meeting-spec.md +0 -404
- package/src/meeting-info/ai-docs/meeting-info-spec.md +0 -261
- package/src/meetings/ai-docs/meetings-spec.md +0 -298
- package/src/member/ai-docs/member-spec.md +0 -196
- package/src/members/ai-docs/members-spec.md +0 -256
- package/src/metrics/ai-docs/metrics-spec.md +0 -185
- package/src/multistream/ai-docs/multistream-spec.md +0 -295
- package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +0 -234
- package/src/reachability/ai-docs/reachability-spec.md +0 -261
- package/src/reactions/ai-docs/reactions-spec.md +0 -198
- package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +0 -272
- package/src/recording-controller/ai-docs/recording-controller-spec.md +0 -223
- package/src/roap/ai-docs/roap-spec.md +0 -241
- package/src/webinar/ai-docs/webinar-spec.md +0 -243
|
@@ -1,261 +0,0 @@
|
|
|
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
|
-
# REACHABILITY — 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/reachability/`.
|
|
13
|
-
|
|
14
|
-
## Metadata
|
|
15
|
-
|
|
16
|
-
| Field | Value |
|
|
17
|
-
|---|---|
|
|
18
|
-
| Module id | `reachability` |
|
|
19
|
-
| Source path(s) | `src/reachability/` |
|
|
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
|
-
| No routed legacy module spec | overview / API / behavior / tests | none; generated from current cluster/probe/request code and tests |
|
|
36
|
-
| Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
|
|
37
|
-
|
|
38
|
-
## Overview
|
|
39
|
-
|
|
40
|
-
`src/reachability/` contains 6 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.
|
|
41
|
-
|
|
42
|
-
## Purpose / Responsibility
|
|
43
|
-
|
|
44
|
-
Discovers media clusters, probes protocol reachability with peer connections, determines NAT characteristics, and reports results.
|
|
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/reachability/
|
|
54
|
-
├── clusterReachability.ts — clusterReachability implementation responsibility
|
|
55
|
-
├── index.ts — module facade/controller or primary exports
|
|
56
|
-
├── reachability.types.ts — module type declarations
|
|
57
|
-
├── reachabilityPeerConnection.ts — reachabilityPeerConnection implementation responsibility
|
|
58
|
-
├── request.ts — HTTP request boundary
|
|
59
|
-
├── util.ts — normalization/helper functions
|
|
60
|
-
└── ai-docs/reachability-spec.md — canonical module specification
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Key Files (source of truth)
|
|
64
|
-
|
|
65
|
-
| File | Holds |
|
|
66
|
-
|---|---|
|
|
67
|
-
| `src/reachability/clusterReachability.ts` | clusterReachability implementation responsibility |
|
|
68
|
-
| `src/reachability/index.ts` | module facade/controller or primary exports |
|
|
69
|
-
| `src/reachability/reachability.types.ts` | module type declarations |
|
|
70
|
-
| `src/reachability/reachabilityPeerConnection.ts` | reachabilityPeerConnection implementation responsibility |
|
|
71
|
-
| `src/reachability/request.ts` | HTTP request boundary |
|
|
72
|
-
| `src/reachability/util.ts` | normalization/helper functions |
|
|
73
|
-
| `test/unit/spec/reachability/clusterReachability.ts` and 3 sibling test file(s) | mirrored characterization/unit coverage |
|
|
74
|
-
|
|
75
|
-
## Public Surface
|
|
76
|
-
|
|
77
|
-
| Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
|
|
78
|
-
|---|---|---|---|---|---|---|
|
|
79
|
-
| `reachability.1` | SDK / remote | `Reachability.getClusters()` and `gatherReachability()` | Fetch cluster discovery data, cache the join cookie, and start a configured reachability run. | Disabled reachability rejects before the catch boundary; missing WebRTC capability or caught discovery/probe failure returns `{}`; a started successful run resolves its defer promise with `undefined` after storing results. | `src/reachability/index.ts`, `src/reachability/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
80
|
-
| `reachability.2` | SDK / async | `ClusterReachability.getResult()`, `start()`, `abort()` and `ReachabilityPeerConnection.getResult()`, `start()`, `abort()` | Run and settle per-cluster/per-protocol WebRTC probes with owned timers and peer connections. | Preserve the `udp`, `tcp`, and `xtls` protocol names and one-settlement cleanup. | `src/reachability/clusterReachability.ts`, `src/reachability/reachabilityPeerConnection.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
81
|
-
| `reachability.3` | SDK / lifecycle | `gatherReachabilityFallback()` and `stopReachability()` | Restart with fallback discovery when the minimum cluster target is missed, or abort an active run. | Both paths absorb their documented internal failures; stop emits `reachability:stopped` only for an active timer. | `src/reachability/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
82
|
-
| `reachability.4` | SDK / query | `isSubnetReachable()`, `isAnyPublicClusterReachable()`, `isWebexMediaBackendUnreachable()`, and `isAnyClusterReachableViaProtocol()` | Answer media-selection questions from the latest in-memory cluster results. | Preserve boolean/null semantics and current public/video-mesh distinctions. | `src/reachability/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
83
|
-
| `reachability.5` | SDK / report | `getJoinCookie()`, `getReachabilityReport()`, `getReachabilityMetrics()`, `getReachabilityResults()`, `getClientMediaPreferences()`, and `getReachabilityReportToAttachToRoap()` | Read cached/in-memory results and format local metrics, media preferences, or ROAP attachment data. | These methods construct/return data; they do not submit a reachability report to the service. | `src/reachability/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
84
|
-
| `reachability.6` | exported utilities | `resolveReachabilityProtocols()`, `isReachabilityEnabled()`, `convertStunUrlToTurn()`, and `convertStunUrlToTurnTls()` | Resolve configured protocol sets and transform validated STUN URLs for probe setup. | Invalid STUN input throws; preserve `xtls` and URL conversion behavior. | `src/reachability/util.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
85
|
-
| `reachability.7` | exported events/types | `Events`, `ResultEventData`, `ClientMediaIpsUpdatedEventData`, `NatTypeUpdatedEventData`, `Protocol`, `ResolvedReachabilityProtocols`, `ReachabilityProtocolConfig`, `EnableReachabilityChecksConfig`, `ReachabilityPeerConnectionEvents`, `TransportResult`, `NatType`, `ClusterReachabilityResult`, `ReachabilityMetrics`, `TransportResultForBackend`, `ReachabilityResultForBackend`, `ReachabilityResultsForBackend`, `ReachabilityResults`, `ReachabilityReportV0`, `ReachabilityReportV1`, `ClientMediaPreferences`, `GetClustersTrigger`, `ClusterNode`, and `ClusterList` | Share the exact probe/result vocabulary with Meetings, metrics, and ROAP code. | Add fields compatibly and preserve raw result/protocol/NAT values. | `src/reachability/clusterReachability.ts`, `src/reachability/reachability.types.ts`, `src/reachability/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
86
|
-
| `reachability.8` | dormant request helper | `ReachabilityRequest.remoteSDPForClusters()` | POST local SDP offers to the reachability resource and return remote SDP bodies when called directly. | No current package code invokes this exported helper; do not present it as part of `gatherReachability()`. | `src/reachability/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
87
|
-
|
|
88
|
-
### Emitted events
|
|
89
|
-
|
|
90
|
-
Current source emits these observable literals from the `Reachability` controller. Preserve literal values and the current terminal/progress timing.
|
|
91
|
-
|
|
92
|
-
| Event literal | Constant / expression | Emission evidence |
|
|
93
|
-
|---|---|---|
|
|
94
|
-
| `reachability:done` | inline literal | `src/reachability/index.ts` |
|
|
95
|
-
| `reachability:firstResultAvailable` | inline literal | `src/reachability/index.ts` |
|
|
96
|
-
| `reachability:stopped` | inline literal | `src/reachability/index.ts` |
|
|
97
|
-
|
|
98
|
-
Compatibility notes:
|
|
99
|
-
- 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.
|
|
100
|
-
|
|
101
|
-
## Requires (dependencies)
|
|
102
|
-
|
|
103
|
-
Webex reachability services, browser RTCPeerConnection, STUN/TURN candidates, timers, and metrics/request access.
|
|
104
|
-
|
|
105
|
-
## Requirements
|
|
106
|
-
|
|
107
|
-
| ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
|
|
108
|
-
|---|---|---|---|---|---|---|
|
|
109
|
-
| `REACHABILITY-R-001` | fetch and normalize candidate clusters. | Discovers media clusters, probes protocol reachability with peer connections, determines NAT characteristics, and reports results. | `src/reachability/index.ts` | `test/unit/spec/reachability/index.ts` | none | PRESENT |
|
|
110
|
-
| `REACHABILITY-R-002` | Run the `udp`, `tcp`, and `xtls` reachability probes used by code and metric keys. | Callers and telemetry consumers need the exact wire/field name rather than an ambiguous prose-only TLS label. | `src/reachability/index.ts`, `src/reachability/clusterReachability.ts`, `src/reachability/reachability.types.ts` | `test/unit/spec/reachability/index.ts` | none | PRESENT |
|
|
111
|
-
| `REACHABILITY-R-003` | `gatherReachability()` throws from its `async` body when reachability is disabled before entering its `try`, so the returned promise rejects; it returns `{}` when WebRTC is unavailable or when discovery/probe setup fails inside the `try`. A started successful run returns the defer promise, which resolves with `undefined` after results are stored. `getClusters()` retries once and can reject its direct caller on the second failure; fallback catches and logs its own failures. | Callers must distinguish the disabled-config rejection, empty-object skip/failure sentinel, and successful void settlement instead of treating every gather outcome as `{}` or a rejection. | `src/reachability/index.ts`, `src/reachability/clusterReachability.ts`, `src/reachability/reachabilityPeerConnection.ts` | `test/unit/spec/reachability/index.ts`, `test/unit/spec/reachability/clusterReachability.ts` | none | PRESENT |
|
|
112
|
-
| `REACHABILITY-R-004` | Each cluster/protocol probe settles once, closes its peer connection/timer, and contributes an explicit reachable/unreachable result. | ICE events and timeouts race; deterministic cleanup and aggregation prevent false success and leaks. | `src/reachability/clusterReachability.ts`, `src/reachability/reachabilityPeerConnection.ts` | `test/unit/spec/reachability/clusterReachability.ts` | none | PRESENT |
|
|
113
|
-
| `REACHABILITY-R-005` | The aggregate report preserves IP version, NAT/protocol/cluster outcomes, previous-report context, and trigger. | The backend and media selection need comparable current results rather than a single boolean. | `src/reachability/index.ts`, `src/reachability/reachability.types.ts`, `src/reachability/request.ts` | `test/unit/spec/reachability/index.ts`, `test/unit/spec/reachability/request.js` | none | PRESENT |
|
|
114
|
-
|
|
115
|
-
## Design Overview
|
|
116
|
-
|
|
117
|
-
`Reachability` fetches media clusters with `request.ts`, builds a `ClusterReachability` aggregate per cluster, and runs UDP/TCP/`xtls` probes through `ReachabilityPeerConnection`; each probe owns and closes its peer connection and timeout.
|
|
118
|
-
|
|
119
|
-
## Data Flow
|
|
120
|
-
|
|
121
|
-
```mermaid
|
|
122
|
-
flowchart LR
|
|
123
|
-
Caller[Meetings registration / diagnostics] --> Reach[index.ts]
|
|
124
|
-
Reach --> Request[request.ts cluster discovery]
|
|
125
|
-
Request --> Service[reachability service]
|
|
126
|
-
Reach --> Cluster[clusterReachability.ts]
|
|
127
|
-
Cluster --> Probe[reachabilityPeerConnection.ts]
|
|
128
|
-
Probe --> ICE[WebRTC ICE candidate gathering]
|
|
129
|
-
Probe --> Cluster
|
|
130
|
-
Cluster --> Reach
|
|
131
|
-
Reach --> Local[local report / metrics / ROAP attachment]
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
## Sequence Diagram(s)
|
|
135
|
-
|
|
136
|
-
Sequence coverage:
|
|
137
|
-
|
|
138
|
-
| Operation group | Diagram | Failure coverage |
|
|
139
|
-
|---|---|---|
|
|
140
|
-
| UC-1…UC-5 — reachability discovery and probe operation groups | Reachability discovery and probe primary sequence | second discovery failure, absorbed gather failure, probe timeout/abort, and peer cleanup |
|
|
141
|
-
| UC-1…UC-5 — reachability discovery and probe alternate/failure paths | Reachability discovery and probe alternate/failure sequence | cluster discovery failure, ICE timeout, peer-connection failure, unsupported protocol, or explicit stop |
|
|
142
|
-
|
|
143
|
-
### Reachability discovery and probe primary sequence
|
|
144
|
-
|
|
145
|
-
```mermaid
|
|
146
|
-
sequenceDiagram
|
|
147
|
-
participant C as Caller
|
|
148
|
-
participant R as Reachability index.ts
|
|
149
|
-
participant Q as request.ts
|
|
150
|
-
participant P as ReachabilityPeerConnection
|
|
151
|
-
C->>R: gatherReachability()
|
|
152
|
-
R->>Q: fetch clusters
|
|
153
|
-
Q-->>R: candidate cluster list
|
|
154
|
-
loop UDP, TCP, xtls per cluster
|
|
155
|
-
R->>P: start probe
|
|
156
|
-
P-->>R: reachable/unreachable after ICE or timeout
|
|
157
|
-
end
|
|
158
|
-
R->>R: build in-memory results/report data
|
|
159
|
-
R-->>C: defer settles undefined; disabled rejects; skipped/caught failure returns empty object
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Reachability discovery and probe alternate/failure sequence
|
|
163
|
-
|
|
164
|
-
```mermaid
|
|
165
|
-
sequenceDiagram
|
|
166
|
-
participant R as Reachability
|
|
167
|
-
participant P as Protocol probe
|
|
168
|
-
participant W as RTCPeerConnection
|
|
169
|
-
R->>P: probe cluster with udp, tcp, or xtls
|
|
170
|
-
P->>W: gather ICE candidates
|
|
171
|
-
alt candidate proves reachable
|
|
172
|
-
W-->>P: matching candidate
|
|
173
|
-
P-->>R: reachable result; close connection/timer
|
|
174
|
-
else timeout or terminal probe error
|
|
175
|
-
W--xP: timeout/error
|
|
176
|
-
P-->>R: unreachable result or rejection; close connection/timer
|
|
177
|
-
end
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
## Class / Component Relationships
|
|
181
|
-
|
|
182
|
-
```mermaid
|
|
183
|
-
classDiagram
|
|
184
|
-
class Caller
|
|
185
|
-
class Reach
|
|
186
|
-
class Request
|
|
187
|
-
class Service
|
|
188
|
-
class Cluster
|
|
189
|
-
class Probe
|
|
190
|
-
class ICE
|
|
191
|
-
Caller --> Reach
|
|
192
|
-
Reach --> Request
|
|
193
|
-
Request --> Service
|
|
194
|
-
Reach --> Cluster
|
|
195
|
-
Cluster --> Probe
|
|
196
|
-
Probe --> ICE
|
|
197
|
-
Probe --> Cluster
|
|
198
|
-
Cluster --> Reach
|
|
199
|
-
Reach --> Request
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
The arrows identify ownership and delegation inside `src/reachability/`; files that only declare types or constants are not presented as transports.
|
|
203
|
-
|
|
204
|
-
## Use Cases
|
|
205
|
-
|
|
206
|
-
- **UC-1:** Fetch clusters with one retry, store the returned join cookie, and start enabled `udp`, `tcp`, and `xtls` probes. Evidence: `src/reachability/index.ts`, `src/reachability/request.ts`.
|
|
207
|
-
- **UC-2:** Settle each cluster/protocol probe once and close its timer and peer connection on success, failure, timeout, or abort. Evidence: `src/reachability/clusterReachability.ts`, `src/reachability/reachabilityPeerConnection.ts`.
|
|
208
|
-
- **UC-3:** Reject before probing when reachability is disabled, return `{}` when WebRTC is unavailable or a discovery/probe setup failure is caught, and otherwise resolve the run's defer with `undefined` after storing results. Evidence: `src/reachability/index.ts`.
|
|
209
|
-
- **UC-4:** Trigger fallback discovery when the minimum reachable-cluster threshold is missed, aborting the previous run before probing the replacement list. Evidence: `src/reachability/index.ts`.
|
|
210
|
-
- **UC-5:** Read results as metrics, client media preferences, or a ROAP attachment without calling the dormant `ReachabilityRequest.remoteSDPForClusters()` helper. Evidence: `src/reachability/index.ts`, `src/reachability/request.ts`.
|
|
211
|
-
|
|
212
|
-
## State Model
|
|
213
|
-
|
|
214
|
-
Cluster/protocol probe state, peer connections, timers, partial results, and cached report data exist for one reachability run.
|
|
215
|
-
|
|
216
|
-
## Business Rules & Invariants
|
|
217
|
-
|
|
218
|
-
- Each probe settles once and closes its peer connection/timer; unsupported or failed protocols are reported rather than inferred reachable. Enforced by `src/reachability/index.ts` and supporting code under `src/reachability/`.
|
|
219
|
-
|
|
220
|
-
## Concurrency & Reactive Flow
|
|
221
|
-
|
|
222
|
-
- Each cluster/protocol probe owns one peer connection and timeout, settles once from its ICE/error/timeout path, and closes both resources before contributing to the aggregate. Cluster discovery is requested remotely; report/metric/ROAP shapes are constructed locally. Only failures inside `gatherReachability()`'s `try` are absorbed as `{}`; disabled configuration rejects before that boundary.
|
|
223
|
-
|
|
224
|
-
## Protocol / Wire Format
|
|
225
|
-
|
|
226
|
-
- External payloads are parsed/serialized by files under `src/reachability/` and existing Webex/media dependencies. Preserve current field names, enum/raw values, sequence identifiers, and compatibility behavior; do not treat the normalized client model as the wire schema.
|
|
227
|
-
|
|
228
|
-
## Error Handling & Failure Modes
|
|
229
|
-
|
|
230
|
-
| Condition | Signal | Caller recovery |
|
|
231
|
-
|---|---|---|
|
|
232
|
-
| Reachability is disabled in configuration | `gatherReachability()` throws `enableReachabilityChecks is disabled in config` from its `async` body before entering the catch block, which rejects the returned promise. | Enable the configured checks or handle the rejection; do not expect `{}` for this path. |
|
|
233
|
-
| Cluster discovery still fails after `getClusters()` retries once | A direct `getClusters()` caller receives the rejection; `gatherReachability()` and fallback callers catch it and resolve with their documented empty/void outcome. | Distinguish direct discovery from the failure-absorbing gather APIs. |
|
|
234
|
-
| ICE timeout or supported probe cannot establish reachability | The probe settles on its current unreachable/rejection path and closes its peer connection and timeout. | Record the explicit unreachable result; do not retain the probe connection. |
|
|
235
|
-
| All `udp`, `tcp`, and `xtls` probes settle | The module stores aggregate protocol/cluster/NAT/IP-version results, emits completion, and resolves the gather defer with `undefined`; no report-submission call is made. | Read the stored/local report through the query/report helpers rather than expecting the gather promise to carry the result object. |
|
|
236
|
-
|
|
237
|
-
## Pitfalls
|
|
238
|
-
|
|
239
|
-
- Browser ICE callbacks and timeout can race. Cleanup must be idempotent and partial results must not be presented as a complete success.
|
|
240
|
-
- Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source helper is not exported directly.
|
|
241
|
-
|
|
242
|
-
## Key Design Trade-off
|
|
243
|
-
|
|
244
|
-
- Parallel probes reduce startup time but require per-probe isolation and deterministic aggregation.
|
|
245
|
-
|
|
246
|
-
## Test-Case Strategy (module)
|
|
247
|
-
|
|
248
|
-
Use the current mirrored suites: `test/unit/spec/reachability/clusterReachability.ts`, `test/unit/spec/reachability/index.ts`, `test/unit/spec/reachability/request.js`, `test/unit/spec/reachability/util.ts`. Characterize the reachability-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
|
|
249
|
-
|
|
250
|
-
| Behavior / Requirement | Existing test evidence | Gap |
|
|
251
|
-
|---|---|---|
|
|
252
|
-
| `REACHABILITY-R-001` | `test/unit/spec/reachability/index.ts` | cover discovery, probe, fallback, stop, query, and report-format groups |
|
|
253
|
-
| `REACHABILITY-R-002` | `test/unit/spec/reachability/index.ts` | second discovery failure versus absorbed gather failure needs paired assertions |
|
|
254
|
-
| `REACHABILITY-R-003` | `test/unit/spec/reachability/index.ts` | keep paired assertions for disabled-config rejection, WebRTC/caught-failure `{}`, successful `undefined` defer settlement, and no `remoteSDPForClusters()` invocation |
|
|
255
|
-
| `REACHABILITY-R-004` | `test/unit/spec/reachability/clusterReachability.ts` | verify callback/timeout races |
|
|
256
|
-
| `REACHABILITY-R-005` | `test/unit/spec/reachability/index.ts`, `test/unit/spec/reachability/request.js` | verify partial/mixed protocol reports |
|
|
257
|
-
|
|
258
|
-
## Traceability
|
|
259
|
-
|
|
260
|
-
- Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
|
|
261
|
-
- Coverage state and contracts baseline: `../../../.sdd/manifest.json`
|
|
@@ -1,198 +0,0 @@
|
|
|
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
|
-
# REACTIONS — 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/reactions/`.
|
|
13
|
-
|
|
14
|
-
## Metadata
|
|
15
|
-
|
|
16
|
-
| Field | Value |
|
|
17
|
-
|---|---|
|
|
18
|
-
| Module id | `reactions` |
|
|
19
|
-
| Source path(s) | `src/reactions/` |
|
|
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 source and mirrored tests. Current code wins over retained prose when they conflict; commit and PR history are excluded. Missing evidence stays a gap.
|
|
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; reaction availability and event/request meaning were placed into the public surface and invariants |
|
|
36
|
-
| Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
|
|
37
|
-
|
|
38
|
-
## Overview
|
|
39
|
-
|
|
40
|
-
`src/reactions/` contains 3 direct source/reference file(s) and has 0 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
|
-
Defines static reaction and skin-tone catalogs plus TypeScript shapes for reaction, sender, and relay payloads; owning Meeting code performs runtime lookup and fallback.
|
|
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.
|
|
49
|
-
|
|
50
|
-
## Folder / Package Structure
|
|
51
|
-
|
|
52
|
-
```text
|
|
53
|
-
src/reactions/
|
|
54
|
-
├── constants.ts — module constants and wire values
|
|
55
|
-
├── reactions.ts — reactions implementation responsibility
|
|
56
|
-
├── reactions.type.ts — reactions.type implementation responsibility
|
|
57
|
-
└── ai-docs/reactions-spec.md — canonical module specification
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Key Files (source of truth)
|
|
61
|
-
|
|
62
|
-
| File | Holds |
|
|
63
|
-
|---|---|
|
|
64
|
-
| `src/reactions/constants.ts` | module constants and wire values |
|
|
65
|
-
| `src/reactions/reactions.ts` | reactions implementation responsibility |
|
|
66
|
-
| `src/reactions/reactions.type.ts` | reactions.type implementation responsibility |
|
|
67
|
-
| no source-local mirrored test directory | explicit characterization gap |
|
|
68
|
-
|
|
69
|
-
## Public Surface
|
|
70
|
-
|
|
71
|
-
| Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
|
|
72
|
-
|---|---|---|---|---|---|---|
|
|
73
|
-
| `reactions.1` | exported catalogs | `REACTION_RELAY_TYPES`, `Reactions`, and `SkinTones` | Define the supported relay, reaction, and skin-tone values consumed by Meeting request/event code. | Preserve existing raw values; add new catalog members compatibly. | `src/reactions/constants.ts`, `src/reactions/reactions.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
74
|
-
| `reactions.2` | exported types | `EmoticonData`, `SkinTone`, `Reaction`, `ReactionServerType`, `SkinToneType`, `Sender`, `ProcessedReaction`, and `RelayEvent` | Type the sender, relay, server, and normalized reaction payloads crossing the Meeting boundary. | Type changes must remain compatible with existing relay and sender shapes. | `src/reactions/reactions.type.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
75
|
-
|
|
76
|
-
### Emitted events
|
|
77
|
-
|
|
78
|
-
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.
|
|
79
|
-
|
|
80
|
-
| Event literal | Constant / expression | Emission evidence |
|
|
81
|
-
|---|---|---|
|
|
82
|
-
| `meeting:receiveReactions` | `EVENT_TRIGGERS.MEETING_RECEIVE_REACTIONS` | `src/meeting/index.ts` |
|
|
83
|
-
|
|
84
|
-
Compatibility notes:
|
|
85
|
-
- Prefer additive fields/options and preserve current return and rejection semantics. Internal helpers are not public merely because they are exported within the source directory.
|
|
86
|
-
|
|
87
|
-
## Requires (dependencies)
|
|
88
|
-
|
|
89
|
-
Reaction constants/types and Meeting reaction request/event paths.
|
|
90
|
-
|
|
91
|
-
## Requirements
|
|
92
|
-
|
|
93
|
-
| ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
|
|
94
|
-
|---|---|---|---|---|---|---|
|
|
95
|
-
| `REACTIONS-R-001` | Export the supported `Reactions` and `SkinTones` record values without executable normalization or transport behavior. | Owning Meeting code needs one stable catalog of server type/codepoint/shortcode values while retaining responsibility for selection and fallback. | `src/reactions/reactions.ts` | `test/unit/spec/meeting/index.js`, `test/unit/spec/meeting/request.js` | no source-local mirrored test exists | PRESENT |
|
|
96
|
-
| `REACTIONS-R-002` | type reaction, sender, and relay payloads. | Meeting serialization depends on the exact reaction, skin-tone, sender, and relay type vocabulary. | `src/reactions/reactions.ts`, `src/reactions/reactions.type.ts` | `test/unit/spec/meeting/request.js` | catalog values need an exhaustive serializer compatibility matrix in the owning Meeting tests | PRESENT |
|
|
97
|
-
| `REACTIONS-R-003` | The catalogs are plain records and perform no validation, parsing, serialization, or fallible I/O; `Meeting.sendReaction` passes an unknown reaction type through and falls back to the normal skin tone for an unknown tone. | The spec must not turn static data declarations into a runtime normalization API or rejection contract. | `src/reactions/`, `src/meeting/index.ts` | `test/unit/spec/meeting/index.js`, `test/unit/spec/meeting/request.js` | none | PRESENT |
|
|
98
|
-
|
|
99
|
-
## Design Overview
|
|
100
|
-
|
|
101
|
-
`reactions.ts` and `constants.ts` export static reaction/skin-tone values, while `reactions.type.ts` supplies compile-time payload shapes. The module has no runtime transport or lifecycle state.
|
|
102
|
-
|
|
103
|
-
## Data Flow
|
|
104
|
-
|
|
105
|
-
```mermaid
|
|
106
|
-
flowchart LR
|
|
107
|
-
Consumer[Meeting/request/event code] --> Catalog[reactions.ts]
|
|
108
|
-
Constants[constants.ts wire values] --> Catalog
|
|
109
|
-
Types[reactions.type.ts payload types] --> Consumer
|
|
110
|
-
Catalog --> Payload[reaction + skin-tone value]
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
## Sequence Diagram(s)
|
|
114
|
-
|
|
115
|
-
Sequence coverage:
|
|
116
|
-
|
|
117
|
-
| Operation group | Diagram | Failure coverage |
|
|
118
|
-
|---|---|---|
|
|
119
|
-
| UC-1…UC-2 — reaction catalog and payload operation groups | Reaction catalog and payload primary sequence | catalog/type-only behavior and owning Meeting serialization/request failure |
|
|
120
|
-
| UC-1…UC-2 — reaction catalog and payload alternate/failure paths | Reaction catalog and payload alternate/failure sequence | consumer supplies a value outside the exported catalog or an owning request rejects it |
|
|
121
|
-
|
|
122
|
-
### Reaction catalog and payload primary sequence
|
|
123
|
-
|
|
124
|
-
```mermaid
|
|
125
|
-
sequenceDiagram
|
|
126
|
-
participant C as Meeting feature code
|
|
127
|
-
participant R as Reactions catalog
|
|
128
|
-
C->>R: select reaction and skin tone
|
|
129
|
-
R-->>C: declared wire values
|
|
130
|
-
C->>C: place values in request/event payload
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Reaction catalog and payload alternate/failure sequence
|
|
134
|
-
|
|
135
|
-
```mermaid
|
|
136
|
-
sequenceDiagram
|
|
137
|
-
participant C as Caller / current input owner
|
|
138
|
-
participant M as Meeting.sendReaction
|
|
139
|
-
participant R as Reactions/SkinTones records
|
|
140
|
-
C->>M: sendReaction(reactionType, skinToneType)
|
|
141
|
-
M->>R: look up catalog entries
|
|
142
|
-
alt known reaction/tone
|
|
143
|
-
R-->>M: declared catalog values
|
|
144
|
-
else unknown value
|
|
145
|
-
M->>M: pass through custom reaction type; use normal tone fallback
|
|
146
|
-
end
|
|
147
|
-
M-->>C: request promise, or plain Error rejection when reactionChannelUrl is absent
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
## Class / Component Relationships
|
|
151
|
-
|
|
152
|
-
```mermaid
|
|
153
|
-
classDiagram
|
|
154
|
-
class Consumer
|
|
155
|
-
class Catalog
|
|
156
|
-
class Constants
|
|
157
|
-
class Types
|
|
158
|
-
class Payload
|
|
159
|
-
Consumer --> Catalog
|
|
160
|
-
Constants --> Catalog
|
|
161
|
-
Types --> Consumer
|
|
162
|
-
Catalog --> Payload
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
The arrows identify ownership and delegation inside `src/reactions/`; files that only declare types or constants are not presented as transports.
|
|
166
|
-
|
|
167
|
-
## Use Cases
|
|
168
|
-
|
|
169
|
-
- **UC-1:** Resolve consumer reaction and skin-tone choices from the exported `Reactions` and `SkinTones` catalogs before `Meeting.sendReaction()` serializes them. Evidence: `src/reactions/reactions.ts`, `src/meeting/index.ts`.
|
|
170
|
-
- **UC-2:** Carry sender identity and relay payloads through the exported reaction types while leaving parsing, validation, and transport to Meeting. Evidence: `src/reactions/reactions.type.ts`, `src/meeting/index.ts`.
|
|
171
|
-
|
|
172
|
-
## Business Rules & Invariants
|
|
173
|
-
|
|
174
|
-
- Consumer/server reaction and skin-tone values use declared enums/catalogs; participant sender data follows package privacy rules. Enforced under `src/reactions/`.
|
|
175
|
-
|
|
176
|
-
## Protocol / Wire Format
|
|
177
|
-
|
|
178
|
-
- `src/reactions/` declares catalog values and TypeScript payload shapes used by owning request/event code. Preserve type names, enum/raw values, sender identity fields, and relay structure; parsing and serialization occur outside this module.
|
|
179
|
-
|
|
180
|
-
## Pitfalls
|
|
181
|
-
|
|
182
|
-
- Display glyph/name and server relay type are different representations. Send the declared server value, not an arbitrary UI label.
|
|
183
|
-
- Verify both typed constants/enums and raw wire values before changing a logical condition in this legacy package.
|
|
184
|
-
|
|
185
|
-
## Test-Case Strategy (module)
|
|
186
|
-
|
|
187
|
-
No mirrored module test directory exists. Characterize the reactions-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
|
|
188
|
-
|
|
189
|
-
| Behavior / Requirement | Existing test evidence | Gap |
|
|
190
|
-
|---|---|---|
|
|
191
|
-
| `REACTIONS-R-001` | `test/unit/spec/meeting/request.js` | cover every exported catalog value and payload shape through owning Meeting serialization tests |
|
|
192
|
-
| `REACTIONS-R-002` | `test/unit/spec/meeting/request.js` | keep serializer coverage tied to every exported reaction and skin-tone raw value |
|
|
193
|
-
| `REACTIONS-R-003` | `test/unit/spec/meeting/request.js` | add a boundary case showing transport failure belongs to Meeting rather than this catalog/type module |
|
|
194
|
-
|
|
195
|
-
## Traceability
|
|
196
|
-
|
|
197
|
-
- Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
|
|
198
|
-
- Coverage state and contracts baseline: `../../../.sdd/manifest.json`
|