@webex/plugin-meetings 3.12.0-llmrefactor.13 → 3.12.0-llmrefactor.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/.sdd/manifest.json +1312 -0
- package/.sdd/templates/.source.json +30 -0
- package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +111 -0
- package/.sdd/templates/component-repo/module-docs/module-spec.template.md +321 -0
- package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +59 -0
- package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +49 -0
- package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +42 -0
- package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +120 -0
- package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +206 -0
- package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +90 -0
- package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +68 -0
- package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +111 -0
- package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +57 -0
- package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +69 -0
- package/.sdd/templates/component-repo/standing-docs/RULES.template.md +96 -0
- package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +84 -0
- package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +82 -0
- package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +94 -0
- package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +64 -0
- package/.sdd/templates/component-repo/template-map.json +112 -0
- package/AGENTS.md +130 -4
- package/ai-docs/ARCHITECTURE.md +207 -0
- package/ai-docs/CONTRACTS.md +267 -0
- package/ai-docs/DATA_MODEL.md +64 -0
- package/ai-docs/GETTING_STARTED.md +73 -0
- package/ai-docs/GLOSSARY.md +56 -0
- package/ai-docs/REVIEW_CHECKLIST.md +45 -0
- package/ai-docs/RULES.md +79 -0
- package/ai-docs/SECURITY.md +74 -0
- package/ai-docs/SERVICE_STATE.md +59 -0
- package/ai-docs/SPEC_INDEX.md +85 -0
- package/ai-docs/TEST_INDEX.md +45 -0
- package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
- package/ai-docs/patterns/defensive-error-propagation.md +55 -0
- package/ai-docs/patterns/event-scope-emission.md +46 -0
- package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
- package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
- package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/interpretation/index.js +46 -12
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meeting/in-meeting-actions.js +2 -0
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +4 -0
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/util.js +3 -1
- package/dist/meeting/util.js.map +1 -1
- package/dist/meetings/index.js +8 -4
- package/dist/meetings/index.js.map +1 -1
- package/dist/types/meeting/in-meeting-actions.d.ts +2 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +20 -20
- package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
- package/src/annotation/ai-docs/annotation-spec.md +236 -0
- package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
- package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
- package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
- package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
- package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
- package/src/interpretation/index.ts +38 -1
- package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
- package/src/media/ai-docs/media-spec.md +267 -0
- package/src/meeting/ai-docs/meeting-spec.md +401 -0
- package/src/meeting/in-meeting-actions.ts +4 -0
- package/src/meeting/index.ts +4 -0
- package/src/meeting/util.ts +5 -2
- package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
- package/src/meetings/ai-docs/meetings-spec.md +296 -0
- package/src/meetings/index.ts +4 -0
- package/src/member/ai-docs/member-spec.md +196 -0
- package/src/members/ai-docs/members-spec.md +256 -0
- package/src/metrics/ai-docs/metrics-spec.md +185 -0
- package/src/multistream/ai-docs/multistream-spec.md +292 -0
- package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
- package/src/reachability/ai-docs/reachability-spec.md +261 -0
- package/src/reactions/ai-docs/reactions-spec.md +198 -0
- package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
- package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
- package/src/roap/ai-docs/roap-spec.md +241 -0
- package/src/webinar/ai-docs/webinar-spec.md +243 -0
- package/test/unit/spec/interpretation/index.ts +93 -0
- package/test/unit/spec/meeting/in-meeting-actions.ts +2 -0
- package/test/unit/spec/meeting/index.js +5 -0
- package/test/unit/spec/meeting/utils.js +26 -15
- package/test/unit/spec/meetings/index.js +11 -0
|
@@ -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`
|
|
@@ -0,0 +1,256 @@
|
|
|
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
|
+
# MEMBERS — 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/members/`.
|
|
13
|
+
|
|
14
|
+
## Metadata
|
|
15
|
+
|
|
16
|
+
| Field | Value |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Module id | `members` |
|
|
19
|
+
| Source path(s) | `src/members/` |
|
|
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; member collection properties, mutations, and events were distributed across the public surface, requirements, and use cases |
|
|
36
|
+
| Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
|
|
37
|
+
|
|
38
|
+
## Overview
|
|
39
|
+
|
|
40
|
+
`src/members/` 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.
|
|
41
|
+
|
|
42
|
+
## Purpose / Responsibility
|
|
43
|
+
|
|
44
|
+
Owns the meeting roster collection, reconciles participant updates, performs participant mutations, and emits member events.
|
|
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/members/
|
|
54
|
+
├── collection.ts — module-owned collection
|
|
55
|
+
├── index.ts — module facade/controller or primary exports
|
|
56
|
+
├── request.ts — HTTP request boundary
|
|
57
|
+
├── types.ts — module type declarations
|
|
58
|
+
├── util.ts — normalization/helper functions
|
|
59
|
+
└── ai-docs/members-spec.md — canonical module specification
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Key Files (source of truth)
|
|
63
|
+
|
|
64
|
+
| File | Holds |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `src/members/collection.ts` | module-owned collection |
|
|
67
|
+
| `src/members/index.ts` | module facade/controller or primary exports |
|
|
68
|
+
| `src/members/request.ts` | HTTP request boundary |
|
|
69
|
+
| `src/members/types.ts` | module type declarations |
|
|
70
|
+
| `src/members/util.ts` | normalization/helper functions |
|
|
71
|
+
| `test/unit/spec/members/collection.js` and 3 sibling test file(s) | mirrored characterization/unit coverage |
|
|
72
|
+
|
|
73
|
+
## Public Surface
|
|
74
|
+
|
|
75
|
+
| Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
|
|
76
|
+
|---|---|---|---|---|---|---|
|
|
77
|
+
| `members.1` | SDK collection | `MembersCollection.set()`, `setAll()`, `get()`, `getAll()`, `remove()`, and `reset()` | Store member models by identity and support atomic roster replacement/reset. | Preserve collection keying and returned model identity. | `src/members/collection.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
78
|
+
| `members.2` | SDK / Locus input | `locusSelfUpdate()`, `locusHostUpdate()`, `locusParticipantsUpdate()`, `locusMediaSharesUpdate()`, `locusUrlUpdate()`, `locusFullStateTypeUpdate()`, `setLocusUrl()`, `setHostId()`, `setType()`, `setSelfId()`, `setMediaShareContentId()`, `setMediaShareWhiteboardId()`, and `clearMembers()` | Reconcile authoritative Locus roster/context into the current collection. | Preserve one `MEMBERS_UPDATE` emission with `{delta, full, isReplace}`; the nested delta carries added/updated/removed ids/models. | `src/members/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
79
|
+
| `members.3` | SDK / model mutation | `addMember()` and participant reconciliation | Create/update `Member` projections and compute the ids reported in the roster update payload. | Preserve member identity and local comparison behavior. | `src/members/index.ts`, `src/member/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
80
|
+
| `members.4` | SDK / remote | `cancelPhoneInvite()`, `cancelInviteByMemberId()`, `admitMembers()`, `removeMember()`, and `muteMember()` | Execute invitation/lobby/removal/mute operations against current Locus/member URLs. | Preserve request inputs and each method's actual caller-visible failure boundary: returned rejections are common, while `admitMembers()` can surface a synchronous `MembersRequest.admitMember()` validation throw. No blanket local capability pre-check exists for every operation. | `src/members/index.ts`, `src/members/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
81
|
+
| `members.5` | SDK / remote | `assignRoles()`, `moveToLobby()`, `raiseOrLowerHand()`, `lowerAllHands()`, and `transferHostToMember()` | Mutate participant roles, lobby placement, hand state, or host assignment. | Preserve role/action body shapes and current per-method validation. | `src/members/index.ts`, `src/members/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
82
|
+
| `members.6` | SDK / remote | `sendDialPadKey()` and `editDisplayName()` | Send member-scoped DTMF or display-name changes through the request adapter. | Preserve target member/session context and caller-visible request errors. | `src/members/index.ts`, `src/members/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
83
|
+
| `members.7` | SDK / query | `findMemberByCsi()` and `getCsisForMember()` | Resolve media CSI/member relationships from the current roster projection. | Preserve null/empty outcomes for unresolved mappings. | `src/members/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
84
|
+
| `members.8` | request/types | `MembersRequest.addMembers()`, `admitMember()`, `removeMember()`, `muteMember()`, `assignRolesMember()`, `moveToLobbyMember()`, `raiseOrLowerHandMember()`, `lowerAllHandsMember()`, `editDisplayNameMember()`, `transferHostToMember()`, `sendDialPadKey()`, `cancelPhoneInvite()`, and `cancelInviteByMemberId()` plus `ServerRoles`, `ServerRoleShape`, `RoleAssignmentOptions`, `RoleAssignmentBody`, and `RoleAssignmentRequest` | Provide the direct HTTP boundary and exact role-assignment vocabulary used by the facade. | Request helpers do not own roster mutation; role raw values are compatibility-sensitive. | `src/members/request.ts`, `src/members/types.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
85
|
+
|
|
86
|
+
### Emitted events
|
|
87
|
+
|
|
88
|
+
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.
|
|
89
|
+
|
|
90
|
+
| Event literal | Constant / expression | Emission evidence |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| `members:clear` | `EVENT_TRIGGERS.MEMBERS_CLEAR` | `src/members/index.ts` |
|
|
93
|
+
| `members:content:update` | `EVENT_TRIGGERS.MEMBERS_CONTENT_UPDATE` | `src/members/index.ts` |
|
|
94
|
+
| `members:host:update` | `EVENT_TRIGGERS.MEMBERS_HOST_UPDATE` | `src/members/index.ts` |
|
|
95
|
+
| `members:self:update` | `EVENT_TRIGGERS.MEMBERS_SELF_UPDATE` | `src/members/index.ts` |
|
|
96
|
+
| `members:update` | `EVENT_TRIGGERS.MEMBERS_UPDATE` | `src/members/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
|
+
Locus participant updates, Member models, meeting/Locus URLs, request helper, event utilities, and role/capability state.
|
|
104
|
+
|
|
105
|
+
## Requirements
|
|
106
|
+
|
|
107
|
+
| ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
|
|
108
|
+
|---|---|---|---|---|---|---|
|
|
109
|
+
| `MEMBERS-R-001` | initialize and reconcile the members collection. | Owns the meeting roster collection, reconciles participant updates, performs participant mutations, and emits member events. | `src/members/index.ts` | `test/unit/spec/members/index.js` | none | PRESENT |
|
|
110
|
+
| `MEMBERS-R-002` | admit/remove/mute/transfer-role and related participant controls. | Participant controls target distinct URLs/bodies, while roster state changes only from authoritative Locus updates. | `src/members/index.ts`, `src/members/request.ts` | `test/unit/spec/members/index.js` | mixed add/update/remove reconciliation needs one-payload assertions | PRESENT |
|
|
111
|
+
| `MEMBERS-R-003` | Server failures reject their caller, while validation may either return a rejected promise or throw synchronously at the request-helper boundary; malformed/stale roster updates follow existing diff rules, and collection reset removes the local models owned by this module. | Callers must handle the actual synchronous-versus-promise boundary, while roster consumers need one authoritative update payload and a deterministic local reset. | `src/members/` | `test/unit/spec/members/index.js`, `test/unit/spec/members/request.js` | none | PRESENT |
|
|
112
|
+
| `MEMBERS-R-004` | Roster reconciliation preserves one Member per participant id and emits `{delta, full, isReplace}`; `delta` contains the added/updated models and removed ids, while `full` is the current collection. | Stable object identity and the exact wrapper shape let consumers distinguish incremental versus replacement updates without inventing top-level changed/removed fields. | `src/members/index.ts`, `src/members/collection.ts` | `test/unit/spec/members/index.js`, `test/unit/spec/members/collection.js` | none | PRESENT |
|
|
113
|
+
| `MEMBERS-R-005` | Host, self, and active-content changes emit their dedicated member events with active/ended ids. | These roles/streams can change independently of general participant fields and consumers need focused transitions. | `src/members/index.ts`, `src/members/types.ts` | `test/unit/spec/members/index.js` | none | PRESENT |
|
|
114
|
+
| `MEMBERS-R-006` | Participant mutations use current Locus/device/participant context and propagate server rejection. | Admit, remove, mute, and role changes are privileged remote state, not optimistic local edits. | `src/members/index.ts`, `src/members/request.ts` | `test/unit/spec/members/request.js` | none | PRESENT |
|
|
115
|
+
|
|
116
|
+
## Design Overview
|
|
117
|
+
|
|
118
|
+
`Members` owns roster collection reconciliation and member-control requests. `index.ts` computes the added/updated/removed delta in `update()`; `handleLocusInfoUpdatedParticipants()` updates contextual ids, delegates participant reconciliation to `update()`, and applies removed participant ids before `locusParticipantsUpdate()` wraps the result with the full collection and `isReplace`. `collection.ts` stores `Member` models and `request.ts` sends admit/remove/mute/role operations to current Locus URLs.
|
|
119
|
+
|
|
120
|
+
## Data Flow
|
|
121
|
+
|
|
122
|
+
```mermaid
|
|
123
|
+
flowchart LR
|
|
124
|
+
Locus[Locus participant updates] --> Controller[index.ts]
|
|
125
|
+
Controller --> Delta[index.ts update and handleLocusInfoUpdatedParticipants]
|
|
126
|
+
Delta --> Collection[collection.ts]
|
|
127
|
+
Collection --> Member[src/member]
|
|
128
|
+
Caller[Meeting / consumer] --> Controller
|
|
129
|
+
Controller --> Request[request.ts]
|
|
130
|
+
Request --> Locus
|
|
131
|
+
Controller --> Events[members update/host/self/content events]
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Sequence Diagram(s)
|
|
135
|
+
|
|
136
|
+
Sequence coverage:
|
|
137
|
+
|
|
138
|
+
| Operation group | Diagram | Failure coverage |
|
|
139
|
+
|---|---|---|
|
|
140
|
+
| UC-1…UC-5 — roster and member-control operation groups | Roster and member-control primary sequence | stale roster input, request rejection, single update payload, and collection reset |
|
|
141
|
+
| UC-1…UC-5 — roster and member-control alternate/failure paths | Roster and member-control alternate/failure sequence | missing member/Locus URL, request rejection, or inconsistent roster update; no blanket local capability gate |
|
|
142
|
+
|
|
143
|
+
### Roster and member-control primary sequence
|
|
144
|
+
|
|
145
|
+
```mermaid
|
|
146
|
+
sequenceDiagram
|
|
147
|
+
participant L as Locus update
|
|
148
|
+
participant M as Members index.ts
|
|
149
|
+
participant D as index.ts delta methods
|
|
150
|
+
participant C as collection.ts
|
|
151
|
+
participant E as roster consumers
|
|
152
|
+
L-->>M: participant projection
|
|
153
|
+
M->>D: update / handleLocusInfoUpdatedParticipants
|
|
154
|
+
D-->>M: added/updated models and removed ids
|
|
155
|
+
M->>C: reconcile Member models
|
|
156
|
+
M->>M: wrap {delta, full, isReplace}
|
|
157
|
+
M-->>E: emit scoped roster/host/self/content changes
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Roster and member-control alternate/failure sequence
|
|
161
|
+
|
|
162
|
+
```mermaid
|
|
163
|
+
sequenceDiagram
|
|
164
|
+
participant L as Locus roster update
|
|
165
|
+
participant M as Members
|
|
166
|
+
participant U as Members index.ts reconciliation methods
|
|
167
|
+
participant C as Member collection
|
|
168
|
+
participant A as Calling Meeting / consumer
|
|
169
|
+
participant E as External roster event consumers
|
|
170
|
+
L-->>M: current participants and roster delta
|
|
171
|
+
M->>U: update / handleLocusInfoUpdatedParticipants / handleMembersUpdate
|
|
172
|
+
U-->>M: delta and current full collection
|
|
173
|
+
M->>C: add, update, or remove Member models
|
|
174
|
+
alt member action request rejects
|
|
175
|
+
M--xA: caller-visible rejection or synchronous validation throw
|
|
176
|
+
else roster reconciliation succeeds
|
|
177
|
+
M-->>E: scoped roster/host/self/content events through Trigger
|
|
178
|
+
end
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Class / Component Relationships
|
|
182
|
+
|
|
183
|
+
```mermaid
|
|
184
|
+
classDiagram
|
|
185
|
+
class Locus
|
|
186
|
+
class Controller
|
|
187
|
+
class Collection
|
|
188
|
+
class Member
|
|
189
|
+
class Caller
|
|
190
|
+
class Request
|
|
191
|
+
class Events
|
|
192
|
+
Locus --> Controller
|
|
193
|
+
Controller --> Collection
|
|
194
|
+
Collection --> Member
|
|
195
|
+
Caller --> Controller
|
|
196
|
+
Controller --> Request
|
|
197
|
+
Request --> Locus
|
|
198
|
+
Controller --> Events
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The arrows identify ownership and delegation inside `src/members/`; files that only declare types or constants are not presented as transports.
|
|
202
|
+
|
|
203
|
+
## Use Cases
|
|
204
|
+
|
|
205
|
+
- **UC-1:** Replace or incrementally reconcile Locus participants into stable `Member` models and emit one `MEMBERS_UPDATE` payload shaped as `{delta, full, isReplace}`. Evidence: `src/members/index.ts`, `src/members/collection.ts`.
|
|
206
|
+
- **UC-2:** Resolve member/CSI relationships for media consumers from the current roster. Evidence: `src/members/index.ts`.
|
|
207
|
+
- **UC-3:** Cancel invitations, admit lobby members, remove or mute a participant using current Locus/member request context. Evidence: `src/members/index.ts`, `src/members/request.ts`.
|
|
208
|
+
- **UC-4:** Assign roles, move to lobby, raise/lower hands, lower all hands, or transfer host using each method's actual validation/body. Evidence: `src/members/index.ts`, `src/members/request.ts`.
|
|
209
|
+
- **UC-5:** Send member DTMF or edit a display name and propagate the request adapter's outcome. Evidence: `src/members/index.ts`, `src/members/request.ts`.
|
|
210
|
+
|
|
211
|
+
## State Model
|
|
212
|
+
|
|
213
|
+
The roster collection, self/host/participant indexes, and event-listener state are scoped to a meeting.
|
|
214
|
+
|
|
215
|
+
## Business Rules & Invariants
|
|
216
|
+
|
|
217
|
+
- Each participant id maps to one current Member and removed participants leave the collection. Remote mutations validate their own ids/Locus context, but `Members` does not apply a blanket meeting-capability check before sending them. Enforced by `src/members/index.ts` and supporting code under `src/members/`.
|
|
218
|
+
|
|
219
|
+
## Concurrency & Reactive Flow
|
|
220
|
+
|
|
221
|
+
- Roster reconciliation keys additions, updates, and removals by current participant/member identity before mutating the collection. `reset()` removes the local member models; member-control requests settle independently and do not turn a rejected server action into a local optimistic update.
|
|
222
|
+
|
|
223
|
+
## Error Handling & Failure Modes
|
|
224
|
+
|
|
225
|
+
| Condition | Signal | Caller recovery |
|
|
226
|
+
|---|---|---|
|
|
227
|
+
| Required input to a synchronous context setter such as `setLocusUrl()`, `setHostId()`, `setType()`, or `setSelfId()` is absent | The setter throws `ParameterError` synchronously. | Supply the direct value or its accepted Locus/full-state container before calling. |
|
|
228
|
+
| `admitMembers()` receives an empty member-id array | It returns a rejected `ParameterError` promise before constructing request options. | Supply at least one member id and handle the returned rejection. |
|
|
229
|
+
| `admitMembers()` receives member ids but its generated request options lack `locusUrl` | `MembersRequest.admitMember()` throws `ParameterError` synchronously; `admitMembers()` is not `async`, so a chained `.catch()` does not observe this validation error. | Refresh Locus context and catch at the synchronous call boundary when it may be absent. |
|
|
230
|
+
| `sendDialPadKey()` cannot resolve the member | It returns a rejected `ParameterError` promise. | Refresh the roster and retry with a current member id. |
|
|
231
|
+
| `sendDialPadKey()` resolves the member but lacks a Locus URL or SIP device URL | It returns a rejected plain `Error` promise, not `ParameterError`. | Restore the meeting/device call-control context before retrying. |
|
|
232
|
+
| Member-control request rejects | The request promise rejects and no successful server mutation is claimed. | Handle the rejection before attempting a later action. |
|
|
233
|
+
| Accepted roster update adds, changes, or removes participants | The collection reconciles the affected `Member` models and emits only the scoped roster/host/self/content changes. | Consume the updated collection projection. |
|
|
234
|
+
|
|
235
|
+
## Pitfalls
|
|
236
|
+
|
|
237
|
+
- Roster snapshots and deltas may represent the same participant differently. Replacing the collection wholesale can lose object identity and event semantics.
|
|
238
|
+
- Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source helper is not exported directly.
|
|
239
|
+
|
|
240
|
+
## Test-Case Strategy (module)
|
|
241
|
+
|
|
242
|
+
Use the current mirrored suites: `test/unit/spec/members/collection.js`, `test/unit/spec/members/index.js`, `test/unit/spec/members/request.js`, `test/unit/spec/members/utils.js`. Characterize the members-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
|
|
243
|
+
|
|
244
|
+
| Behavior / Requirement | Existing test evidence | Gap |
|
|
245
|
+
|---|---|---|
|
|
246
|
+
| `MEMBERS-R-001` | `test/unit/spec/members/index.js` | cover collection reconciliation, CSI queries, and every member request family |
|
|
247
|
+
| `MEMBERS-R-002` | `test/unit/spec/members/index.js` | mixed add/update/remove reconciliation needs one-payload assertions |
|
|
248
|
+
| `MEMBERS-R-003` | `test/unit/spec/members/index.js` | assert the exact `{delta, full, isReplace}` payload and per-operation request rejection without a fabricated global capability gate |
|
|
249
|
+
| `MEMBERS-R-004` | `test/unit/spec/members/index.js`, `test/unit/spec/members/collection.js` | none |
|
|
250
|
+
| `MEMBERS-R-005` | `test/unit/spec/members/index.js` | verify simultaneous host/content changes |
|
|
251
|
+
| `MEMBERS-R-006` | `test/unit/spec/members/request.js` | verify service rejection and confirm the facade does not invent a local capability-denied branch |
|
|
252
|
+
|
|
253
|
+
## Traceability
|
|
254
|
+
|
|
255
|
+
- Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
|
|
256
|
+
- Coverage state and contracts baseline: `../../../.sdd/manifest.json`
|
|
@@ -0,0 +1,185 @@
|
|
|
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
|
+
# METRICS — 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/metrics/`.
|
|
13
|
+
|
|
14
|
+
## Metadata
|
|
15
|
+
|
|
16
|
+
| Field | Value |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Module id | `metrics` |
|
|
19
|
+
| Source path(s) | `src/metrics/` |
|
|
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
|
+
| No routed legacy module spec | overview / API / behavior / tests | none; generated from current metrics implementation/constants and tests |
|
|
36
|
+
| Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
|
|
37
|
+
|
|
38
|
+
## Overview
|
|
39
|
+
|
|
40
|
+
`src/metrics/` contains 2 direct source/reference file(s) and has 1 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
|
+
Initializes meeting behavioral telemetry, flattens metric fields, and submits established metric names/tags through the Webex metrics host.
|
|
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/metrics/
|
|
54
|
+
├── constants.ts — module constants and wire values
|
|
55
|
+
├── index.ts — module facade/controller or primary exports
|
|
56
|
+
└── ai-docs/metrics-spec.md — canonical module specification
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Key Files (source of truth)
|
|
60
|
+
|
|
61
|
+
| File | Holds |
|
|
62
|
+
|---|---|
|
|
63
|
+
| `src/metrics/constants.ts` | module constants and wire values |
|
|
64
|
+
| `src/metrics/index.ts` | module facade/controller or primary exports |
|
|
65
|
+
| `test/unit/spec/metrics/index.js` | mirrored characterization/unit coverage |
|
|
66
|
+
|
|
67
|
+
## Public Surface
|
|
68
|
+
|
|
69
|
+
| Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
|
|
70
|
+
|---|---|---|---|---|---|---|
|
|
71
|
+
| `metrics.1` | singleton setup | default singleton `initialSetup(webex)` | Store the Webex host used by later behavioral submissions. | Repeated setup replaces the host; there is no one-time guard or readiness check. | `src/metrics/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
72
|
+
| `metrics.2` | pure normalization | `prepareMetricFields(payload, prefix)` | Flatten nested objects/arrays and wrap root literals for clients that reject nested metric fields. | Preserve underscore path construction, array indices, and `{value}` root-literal behavior. | `src/metrics/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
73
|
+
| `metrics.3` | remote side effect | `sendBehavioralMetric(metricName, metricFields, metricTags)` | Forward the metric name, configured metrics type, fields, and tags to `submitClientMetrics()`. | The method returns `void` and does not expose an operational-metric API or promise. | `src/metrics/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
74
|
+
|
|
75
|
+
Compatibility notes:
|
|
76
|
+
- 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.
|
|
77
|
+
|
|
78
|
+
## Requires (dependencies)
|
|
79
|
+
|
|
80
|
+
Webex metrics plugin/host, behavioral metric constants, logging/error handling, and callers in meeting/feature modules.
|
|
81
|
+
|
|
82
|
+
## Requirements
|
|
83
|
+
|
|
84
|
+
| ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
|
|
85
|
+
|---|---|---|---|---|---|---|
|
|
86
|
+
| `METRICS-R-001` | `initialSetup(webex)` replaces the singleton's stored Webex host on every call. | Later behavioral submissions must use the host supplied by the owning SDK instance without implying an idempotence guard the implementation does not have. | `src/metrics/index.ts` | `test/unit/spec/metrics/index.js` | repeat setup is not covered explicitly | PRESENT |
|
|
87
|
+
| `METRICS-R-002` | `prepareMetricFields` recursively flattens objects and arrays into underscore-delimited keys and wraps a top-level literal as `{value}`. | The behavioral metrics client cannot accept nested field objects, so callers need a deterministic flattening helper. | `src/metrics/index.ts` | `test/unit/spec/metrics/index.js` | no cycle or size bound is implemented | PRESENT |
|
|
88
|
+
| `METRICS-R-003` | `sendBehavioralMetric` calls `webex.internal.metrics.submitClientMetrics` with the configured metric type, supplied fields, and tags; the method returns no independent result. | The facade must preserve the actual behavioral-metrics boundary without inventing an operational-metrics API or lifecycle guarantee. | `src/metrics/index.ts` | `test/unit/spec/metrics/index.js` | thrown dependency errors propagate synchronously | PRESENT |
|
|
89
|
+
|
|
90
|
+
## Design Overview
|
|
91
|
+
|
|
92
|
+
`src/metrics/index.ts` is a singleton facade that stores the current Webex host, flattens caller-supplied fields, and forwards behavioral metrics to `submitClientMetrics`. `constants.ts` defines meeting metric names and fields. The module owns no listener, timer, or remote controller.
|
|
93
|
+
|
|
94
|
+
## Data Flow
|
|
95
|
+
|
|
96
|
+
```mermaid
|
|
97
|
+
flowchart LR
|
|
98
|
+
Owner[Meeting feature owner] --> Metrics[index.ts]
|
|
99
|
+
Constants[constants.ts] --> Metrics
|
|
100
|
+
Metrics --> Flatten[prepareMetricFields recursive flattening]
|
|
101
|
+
Metrics --> Behavioral[sendBehavioralMetric to submitClientMetrics]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Sequence Diagram(s)
|
|
105
|
+
|
|
106
|
+
Sequence coverage:
|
|
107
|
+
|
|
108
|
+
| Operation group | Diagram | Failure coverage |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| UC-1…UC-2 — behavioral metrics operation groups | Behavioral metrics primary sequence | uninitialized host submission failure and nested/array/literal field normalization |
|
|
111
|
+
| UC-2 — field preparation | Behavioral metrics alternate/failure sequence | literal, array, object, and optional-prefix branches |
|
|
112
|
+
|
|
113
|
+
### Behavioral metrics primary sequence
|
|
114
|
+
|
|
115
|
+
```mermaid
|
|
116
|
+
sequenceDiagram
|
|
117
|
+
participant O as Meeting feature owner
|
|
118
|
+
participant M as Metrics
|
|
119
|
+
participant W as Webex metrics client
|
|
120
|
+
O->>M: sendBehavioralMetric(name, fields, tags)
|
|
121
|
+
M->>W: submitClientMetrics(name, type, fields, tags)
|
|
122
|
+
W-->>M: synchronous return or throw
|
|
123
|
+
M-->>O: undefined, unless the dependency throws
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Behavioral metrics alternate/failure sequence
|
|
127
|
+
|
|
128
|
+
```mermaid
|
|
129
|
+
sequenceDiagram
|
|
130
|
+
participant C as Caller / current input owner
|
|
131
|
+
participant M as Metrics
|
|
132
|
+
C->>M: prepareMetricFields(value, optional prefix)
|
|
133
|
+
M->>M: recursively visit objects and arrays
|
|
134
|
+
alt nested value
|
|
135
|
+
M-->>C: flattened underscore-delimited object
|
|
136
|
+
else top-level literal or null
|
|
137
|
+
M-->>C: value wrapped as {value}
|
|
138
|
+
end
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Class / Component Relationships
|
|
142
|
+
|
|
143
|
+
```mermaid
|
|
144
|
+
classDiagram
|
|
145
|
+
class Owner
|
|
146
|
+
class Metrics
|
|
147
|
+
class Constants
|
|
148
|
+
class Flatten
|
|
149
|
+
class Behavioral
|
|
150
|
+
Owner --> Metrics
|
|
151
|
+
Constants --> Metrics
|
|
152
|
+
Metrics --> Flatten
|
|
153
|
+
Metrics --> Behavioral
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
The arrows identify ownership and delegation inside `src/metrics/`; files that only declare types or constants are not presented as transports.
|
|
157
|
+
|
|
158
|
+
## Use Cases
|
|
159
|
+
|
|
160
|
+
- **UC-1:** Initialize the singleton with a Webex host and forward a named behavioral metric with configured type plus caller-supplied fields/tags. Evidence: `src/metrics/index.ts`.
|
|
161
|
+
- **UC-2:** Flatten nested objects, arrays, prefixed values, null, and root literals into the exact field shape accepted by the metrics client. Evidence: `src/metrics/index.ts`.
|
|
162
|
+
|
|
163
|
+
## Business Rules & Invariants
|
|
164
|
+
|
|
165
|
+
- Behavioral submission requires `initialSetup` to have assigned a Webex host; the facade does not validate metric names or remove sensitive fields. Flattening is deterministic but unbounded, so callers remain responsible for bounded, non-sensitive input. Enforced under `src/metrics/`.
|
|
166
|
+
|
|
167
|
+
## Pitfalls
|
|
168
|
+
|
|
169
|
+
- Flattening arbitrary service payloads can create unbounded or sensitive tags. Callers must submit an intentional bounded projection.
|
|
170
|
+
- Verify both typed constants/enums and raw wire values before changing a logical condition in this legacy package.
|
|
171
|
+
|
|
172
|
+
## Test-Case Strategy (module)
|
|
173
|
+
|
|
174
|
+
Use the current mirrored suites: `test/unit/spec/metrics/index.js`. Characterize the metrics-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
|
|
175
|
+
|
|
176
|
+
| Behavior / Requirement | Existing test evidence | Gap |
|
|
177
|
+
|---|---|---|
|
|
178
|
+
| `METRICS-R-001` | `test/unit/spec/metrics/index.js` | cover singleton setup, submission, and recursive flattening branches |
|
|
179
|
+
| `METRICS-R-002` | `test/unit/spec/metrics/index.js` | extend the flattening matrix for nested arrays, prefixed primitives, and null values |
|
|
180
|
+
| `METRICS-R-003` | `test/unit/spec/metrics/index.js` | assert the exact `submitClientMetrics` call and the method's `undefined` return |
|
|
181
|
+
|
|
182
|
+
## Traceability
|
|
183
|
+
|
|
184
|
+
- Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
|
|
185
|
+
- Coverage state and contracts baseline: `../../../.sdd/manifest.json`
|