@webex/plugin-meetings 3.12.0-webex-services-ready.4 → 3.13.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +208 -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/assets/README.md +28 -0
- package/assets/e2ee-0.0.1.js +2 -0
- package/assets/e2ee-0.0.1.wasm +0 -0
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/annotation/index.js +55 -19
- package/dist/annotation/index.js.map +1 -1
- package/dist/assets/e2ee-0.0.1.js +2 -0
- package/dist/assets/e2ee-0.0.1.wasm +0 -0
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +39 -5
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +7 -2
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +6 -5
- package/dist/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +101 -48
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interceptors/dataChannelAuthToken.js +41 -59
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
- package/dist/interceptors/locusRetry.js +1 -1
- package/dist/interceptors/locusRetry.js.map +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/locus-info/index.js +236 -80
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/types.js +2 -1
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +225 -175
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/meeting/index.js +355 -299
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/util.js +8 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.js +2 -1
- package/dist/meeting/voicea-meeting.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +10 -3
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +72 -31
- package/dist/meetings/index.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +32 -4
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +11 -1
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/types/annotation/index.d.ts +19 -0
- package/dist/types/common/errors/webex-errors.d.ts +6 -2
- package/dist/types/config.d.ts +1 -0
- package/dist/types/constants.d.ts +2 -1
- package/dist/types/hashTree/hashTreeParser.d.ts +12 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/locus-info/index.d.ts +45 -1
- package/dist/types/locus-info/types.d.ts +1 -0
- package/dist/types/media/MediaConnectionAwaiter.d.ts +61 -53
- package/dist/types/meeting/index.d.ts +49 -12
- package/dist/types/meeting/util.d.ts +3 -1
- package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
- package/dist/types/meetings/index.d.ts +2 -1
- package/dist/types/multistream/remoteMediaManager.d.ts +18 -0
- package/dist/types/multistream/sendSlotManager.d.ts +5 -1
- package/dist/webinar/index.js +298 -255
- package/dist/webinar/index.js.map +1 -1
- package/package.json +25 -23
- package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
- package/src/annotation/ai-docs/annotation-spec.md +236 -0
- package/src/annotation/index.ts +61 -29
- package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
- package/src/breakouts/index.ts +35 -2
- package/src/common/errors/webex-errors.ts +8 -2
- package/src/config.ts +5 -1
- package/src/constants.ts +2 -1
- 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/hashTree/hashTreeParser.ts +67 -3
- package/src/index.ts +1 -0
- package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
- package/src/interceptors/dataChannelAuthToken.ts +48 -77
- package/src/interceptors/locusRetry.ts +1 -1
- 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/locus-info/index.ts +156 -35
- package/src/locus-info/types.ts +1 -0
- package/src/media/MediaConnectionAwaiter.ts +223 -207
- package/src/media/ai-docs/media-spec.md +267 -0
- package/src/meeting/ai-docs/meeting-spec.md +404 -0
- package/src/meeting/index.ts +332 -296
- package/src/meeting/util.ts +7 -4
- package/src/meeting/voicea-meeting.ts +1 -1
- package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
- package/src/meeting-info/meeting-info-v2.ts +7 -2
- package/src/meetings/ai-docs/meetings-spec.md +296 -0
- package/src/meetings/index.ts +59 -23
- 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 +295 -0
- package/src/multistream/remoteMediaManager.ts +23 -1
- package/src/multistream/sendSlotManager.ts +15 -1
- 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/src/webinar/index.ts +168 -188
- package/test/unit/spec/annotation/index.ts +214 -182
- package/test/unit/spec/breakouts/index.ts +145 -13
- package/test/unit/spec/hashTree/hashTreeParser.ts +212 -1
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +81 -99
- package/test/unit/spec/interceptors/locusRetry.ts +29 -1
- package/test/unit/spec/interpretation/index.ts +93 -0
- package/test/unit/spec/locus-info/index.js +397 -0
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +426 -19
- package/test/unit/spec/media/properties.ts +3 -3
- package/test/unit/spec/meeting/index.js +1219 -723
- package/test/unit/spec/meeting/utils.js +52 -18
- package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
- package/test/unit/spec/meeting-info/meetinginfov2.js +69 -1
- package/test/unit/spec/meetings/index.js +145 -43
- package/test/unit/spec/multistream/remoteMediaManager.ts +46 -0
- package/test/unit/spec/multistream/sendSlotManager.ts +30 -2
- package/test/unit/spec/webinar/index.ts +886 -718
|
@@ -0,0 +1,272 @@
|
|
|
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
|
+
# RECONNECTION MANAGER — 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/reconnection-manager/`.
|
|
13
|
+
|
|
14
|
+
## Metadata
|
|
15
|
+
|
|
16
|
+
| Field | Value |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Module id | `reconnection-manager` |
|
|
19
|
+
| Source path(s) | `src/reconnection-manager/` |
|
|
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 recovery state machine and tests |
|
|
36
|
+
| Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
|
|
37
|
+
|
|
38
|
+
## Overview
|
|
39
|
+
|
|
40
|
+
`src/reconnection-manager/` contains 1 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
|
+
Coordinates bounded network/media recovery, escalating from reconnecting media to rejoining the meeting when required.
|
|
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/reconnection-manager/
|
|
54
|
+
├── index.ts — module facade/controller or primary exports
|
|
55
|
+
└── ai-docs/reconnection-manager-spec.md — canonical module specification
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Key Files (source of truth)
|
|
59
|
+
|
|
60
|
+
| File | Holds |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `src/reconnection-manager/index.ts` | module facade/controller or primary exports |
|
|
63
|
+
| `test/unit/spec/reconnection-manager/index.js` | mirrored characterization/unit coverage |
|
|
64
|
+
|
|
65
|
+
## Public Surface
|
|
66
|
+
|
|
67
|
+
| Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
|
|
68
|
+
|---|---|---|---|---|---|---|
|
|
69
|
+
| `reconnection-manager.1` | SDK / state | `ReconnectionManager.isReconnectInProgress()`, `reset()`, and `cleanUp()` | Expose the duplicate-run guard and reset only reconnection status plus rejoin attempts. | `cleanUp()` calls `reset()`; neither clears `iceState.timer` nor settles/clears the ICE defer. Use `resetReconnectionTimer()` for that separate state. | `src/reconnection-manager/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
70
|
+
| `reconnection-manager.2` | SDK / ICE wait | `waitForIceReconnect()`, `iceReconnected()`, and `resetReconnectionTimer()` | Wait for a bounded ICE recovery signal and settle/clear the owned timer/defer. | Preserve timeout duration, settlement, and reset ordering. | `src/reconnection-manager/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
71
|
+
| `reconnection-manager.3` | SDK / recovery | `reconnect()` | Run one guarded recovery sequence, emitting success after the ordinary recovery/completion-callback path and failure on terminal errors. | A successful auto-rejoin returns before `MEETING_RECONNECTION_SUCCESS`; disabled/duplicate starts throw, and terminal failure resets status/attempts in `finally`. | `src/reconnection-manager/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
72
|
+
| `reconnection-manager.4` | SDK / recovery | `reconnectMedia()` | Retry the current media reconnection path within configured attempt limits. | Preserve attempt bounds and escalation to meeting rejoin. | `src/reconnection-manager/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
73
|
+
| `reconnection-manager.5` | SDK / recovery | `rejoinMeeting()` | Rejoin the meeting and stop a share that was active at recovery start with the recovery reason. | Current code does not restore or republish sharing after recovery. | `src/reconnection-manager/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
74
|
+
|
|
75
|
+
### Emitted events
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
|
|
79
|
+
| Event literal | Constant / expression | Emission evidence |
|
|
80
|
+
|---|---|---|
|
|
81
|
+
| `meeting:reconnectionFailure` | `EVENT_TRIGGERS.MEETING_RECONNECTION_FAILURE` | `src/reconnection-manager/index.ts` |
|
|
82
|
+
| `meeting:reconnectionStarting` | `EVENT_TRIGGERS.MEETING_RECONNECTION_STARTING` | `src/reconnection-manager/index.ts` |
|
|
83
|
+
| `meeting:reconnectionSuccess` | `EVENT_TRIGGERS.MEETING_RECONNECTION_SUCCESS` | `src/reconnection-manager/index.ts` |
|
|
84
|
+
| `meeting:stoppedSharingLocal` | `EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL` | `src/meeting/index.ts`, `src/reconnection-manager/index.ts` |
|
|
85
|
+
|
|
86
|
+
`MEETING_RECONNECTION_SUCCESS` is emitted only after `executeReconnection()` and any completion callback finish on the ordinary path. When a `NeedsRejoinError` is handled by successful automatic rejoin, `reconnect()` returns immediately after `rejoinMeeting()` and skips that success event. Terminal errors still emit `MEETING_RECONNECTION_FAILURE`.
|
|
87
|
+
|
|
88
|
+
Compatibility notes:
|
|
89
|
+
- 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.
|
|
90
|
+
|
|
91
|
+
## Requires (dependencies)
|
|
92
|
+
|
|
93
|
+
Meeting lifecycle/media methods, network state callbacks, timers, retry configuration, logging, events, and metrics.
|
|
94
|
+
|
|
95
|
+
## Requirements
|
|
96
|
+
|
|
97
|
+
| ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
|
|
98
|
+
|---|---|---|---|---|---|---|
|
|
99
|
+
| `RECONNECTION-MANAGER-R-001` | start/reset/inspect reconnection state. | Coordinates bounded network/media recovery, escalating from reconnecting media to rejoining the meeting when required. | `src/reconnection-manager/index.ts` | `test/unit/spec/reconnection-manager/index.js` | none | PRESENT |
|
|
100
|
+
| `RECONNECTION-MANAGER-R-002` | retry media reconnection with timers. | Attempt limits and timers determine when recovery stays in media reconnect versus escalating to a full rejoin. | `src/reconnection-manager/index.ts` | `test/unit/spec/reconnection-manager/index.js` | ICE event/timeout races at the final attempt boundary need explicit coverage | PRESENT |
|
|
101
|
+
| `RECONNECTION-MANAGER-R-003` | Duplicate starts throw `ReconnectionNotStartedError`. Ordinary successful recovery emits `MEETING_RECONNECTION_SUCCESS` after its completion callback, but successful automatic rejoin returns before that emission. Terminal recovery failures emit `MEETING_RECONNECTION_FAILURE` and reject with `ReconnectionError`; some inner paths assign `FAILURE`, but the outer `finally` calls `reset()` and returns status to the default value. | Callers must not treat success-event presence as proof of every successful recovery mode, and must rely on the returned rejection/failure event rather than assume that `FAILURE` persists after settlement. | `src/reconnection-manager/index.ts` | `test/unit/spec/reconnection-manager/index.js` | characterize the absent success event after successful auto-rejoin | PRESENT |
|
|
102
|
+
| `RECONNECTION-MANAGER-R-004` | `status === IN_PROGRESS` prevents a second recovery run; `rejoinAttempts` is bounded by `maxRejoinAttempts` and both fields are reset by `reconnect()` cleanup. The separate ICE-wait path owns `iceState.timer` and clears it through `resetReconnectionTimer()`; `cleanUp()` does not invoke that method. | Concurrent network/media callbacks must not launch duplicate media negotiations or meeting joins, and lifecycle cleanup must not be documented as settling an independent ICE wait that current code leaves intact. | `src/reconnection-manager/index.ts` | `test/unit/spec/reconnection-manager/index.js` | characterize `cleanUp()` while an ICE wait is pending | PRESENT |
|
|
103
|
+
| `RECONNECTION-MANAGER-R-005` | Recovery first reconnects media where allowed, then escalates to meeting rejoin. If recovery started while sharing, current code calls `stopLocalShareStream` with `MEDIA_RECONNECTION` or `MEETING_REJOIN`; it does not republish or restore sharing. | This records the observable behavior and prevents a future test or caller from assuming restoration that does not exist. | `src/reconnection-manager/index.ts` | `test/unit/spec/reconnection-manager/index.js` | Possible product defect: user intent may be to restore prior sharing after recovery, but no restoration path exists. | PRESENT |
|
|
104
|
+
|
|
105
|
+
## Design Overview
|
|
106
|
+
|
|
107
|
+
The manager serializes one recovery run, first attempting its own `reconnectMedia()` operation and then calling `Meeting.join()` when rejoin is required. It owns retry counters/timers and `stopLocalShareStream()`; its media operation reaches into the Meeting's ROAP and media-connection dependencies rather than calling a `Meeting.reconnectMedia()` method.
|
|
108
|
+
|
|
109
|
+
## Data Flow
|
|
110
|
+
|
|
111
|
+
```mermaid
|
|
112
|
+
flowchart LR
|
|
113
|
+
Network[network / media failure] --> Manager[index.ts]
|
|
114
|
+
Manager --> Media[manager-owned reconnectMedia using Meeting ROAP/media properties]
|
|
115
|
+
Manager --> Meeting[Meeting join and stream-unpublish dependencies]
|
|
116
|
+
Manager --> Rejoin[Meeting.join rejoin path]
|
|
117
|
+
Manager --> Timer[bounded retry timer]
|
|
118
|
+
Manager --> Events[start; ordinary-path success; terminal failure]
|
|
119
|
+
Manager --> ShareStop[stopLocalShareStream with recovery reason]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Sequence Diagram(s)
|
|
123
|
+
|
|
124
|
+
Sequence coverage:
|
|
125
|
+
|
|
126
|
+
| Operation group | Diagram | Failure coverage |
|
|
127
|
+
|---|---|---|
|
|
128
|
+
| UC-1…UC-4 — reconnection and rejoin operation groups | Reconnection and rejoin primary sequence | disabled/duplicate start, ICE timeout, bounded retry escalation, and terminal reset |
|
|
129
|
+
| UC-1…UC-4 — reconnection and rejoin alternate/failure paths | Reconnection and rejoin alternate/failure sequence | duplicate start, exhausted retry count, media reconnection rejection, meeting rejoin rejection, or network state change during recovery |
|
|
130
|
+
|
|
131
|
+
### Reconnection and rejoin primary sequence
|
|
132
|
+
|
|
133
|
+
```mermaid
|
|
134
|
+
sequenceDiagram
|
|
135
|
+
participant N as Network/media callback
|
|
136
|
+
participant R as ReconnectionManager
|
|
137
|
+
participant M as Meeting
|
|
138
|
+
N-->>R: reconnect trigger
|
|
139
|
+
alt reconnection is disabled or another reconnect is already IN_PROGRESS
|
|
140
|
+
R--xN: ReconnectionNotStartedError without resetting status
|
|
141
|
+
else new recovery run
|
|
142
|
+
R->>R: set IN_PROGRESS
|
|
143
|
+
end
|
|
144
|
+
alt ordinary media reconnection succeeds after a new start
|
|
145
|
+
R->>R: stopLocalShareStream(MEDIA_RECONNECTION) when wasSharing
|
|
146
|
+
R->>R: reconnectMedia() using Meeting ROAP/media dependencies
|
|
147
|
+
R->>R: run completion callback when supplied
|
|
148
|
+
R-->>N: MEETING_RECONNECTION_SUCCESS and resolved promise
|
|
149
|
+
else NeedsRejoinError and auto-rejoin is enabled
|
|
150
|
+
R->>M: join({rejoin:true})
|
|
151
|
+
R->>R: stopLocalShareStream(MEETING_REJOIN) when wasSharing
|
|
152
|
+
R-->>N: resolved promise without MEETING_RECONNECTION_SUCCESS
|
|
153
|
+
else terminal recovery error
|
|
154
|
+
R--xN: MEETING_RECONNECTION_FAILURE and ReconnectionError
|
|
155
|
+
end
|
|
156
|
+
R->>R: finally resets status and rejoin attempts
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Reconnection and rejoin alternate/failure sequence
|
|
160
|
+
|
|
161
|
+
```mermaid
|
|
162
|
+
sequenceDiagram
|
|
163
|
+
participant N as Network / media trigger
|
|
164
|
+
participant R as ReconnectionManager
|
|
165
|
+
participant M as Meeting
|
|
166
|
+
N->>R: reconnect while local share may be active
|
|
167
|
+
alt status is default and recovery is enabled
|
|
168
|
+
alt ordinary media reconnection
|
|
169
|
+
R->>R: stopLocalShareStream(MEDIA_RECONNECTION) when sharing
|
|
170
|
+
R->>R: reconnectMedia()
|
|
171
|
+
else automatic meeting rejoin
|
|
172
|
+
R->>M: join({rejoin:true})
|
|
173
|
+
R->>R: stopLocalShareStream(MEETING_REJOIN) when sharing
|
|
174
|
+
end
|
|
175
|
+
R-->>N: ordinary success event, successful auto-rejoin without that event, or failure event and ReconnectionError
|
|
176
|
+
else reconnection is disabled or another reconnect is already IN_PROGRESS
|
|
177
|
+
R--xN: ReconnectionNotStartedError
|
|
178
|
+
end
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Class / Component Relationships
|
|
182
|
+
|
|
183
|
+
```mermaid
|
|
184
|
+
classDiagram
|
|
185
|
+
class Network
|
|
186
|
+
class Manager
|
|
187
|
+
class Meeting
|
|
188
|
+
class Media
|
|
189
|
+
class Rejoin
|
|
190
|
+
class Timer
|
|
191
|
+
class Events
|
|
192
|
+
class ShareStop
|
|
193
|
+
Network --> Manager
|
|
194
|
+
Manager --> Meeting
|
|
195
|
+
Manager --> Media
|
|
196
|
+
Manager --> Rejoin
|
|
197
|
+
Manager --> Timer
|
|
198
|
+
Manager --> Events
|
|
199
|
+
Manager --> ShareStop
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The arrows identify ownership and delegation inside `src/reconnection-manager/`; files that only declare types or constants are not presented as transports.
|
|
203
|
+
|
|
204
|
+
## Use Cases
|
|
205
|
+
|
|
206
|
+
- **UC-1:** Reject recovery when reconnection is disabled or another `reconnect()` already owns the `IN_PROGRESS` state. Evidence: `src/reconnection-manager/index.ts`.
|
|
207
|
+
- **UC-2:** Wait for bounded ICE reconnection, clearing the timer/defer when ICE returns or the wait resets. Evidence: `src/reconnection-manager/index.ts`.
|
|
208
|
+
- **UC-3:** Retry media reconnection within configured limits, then escalate to meeting rejoin. Emit success only after the ordinary recovery/completion-callback path; a successful automatic rejoin resolves without that event, while terminal errors emit failure. Evidence: `src/reconnection-manager/index.ts`.
|
|
209
|
+
- **UC-4:** When recovery began while sharing, stop the local share stream with the matching recovery reason; current code does not restore or republish it. Evidence: `src/reconnection-manager/index.ts`.
|
|
210
|
+
|
|
211
|
+
## State Model
|
|
212
|
+
|
|
213
|
+
The manager stores reconnection `status`, `rejoinAttempts`, configured attempt limits, and `iceState` (`disconnected`, resolver, timer, timeout). Sharing is read from the owning Meeting when recovery starts; there is no stored reconnect promise or last-recovery-mode field.
|
|
214
|
+
|
|
215
|
+
## Business Rules & Invariants
|
|
216
|
+
|
|
217
|
+
- Only one recovery run is active and retries are bounded. `reconnect()` success/failure resets reconnection status and attempts; the independent ICE timer/defer is cleared only through `iceReconnected()`/`resetReconnectionTimer()`, not by `cleanUp()`. A previously active share is stopped with a recovery-specific reason and is not restored by this module. Evidence: `src/reconnection-manager/index.ts`.
|
|
218
|
+
|
|
219
|
+
## Concurrency & Reactive Flow
|
|
220
|
+
|
|
221
|
+
- `status === IN_PROGRESS` is the duplicate-run guard for the duration of `reconnect()`. The outer `finally` resets status and `rejoinAttempts`; the independent ICE-wait timer is cleared by `iceReconnected()`/`resetReconnectionTimer()`. A share active at recovery start is stopped with the concrete recovery reason and is not republished by a later completion.
|
|
222
|
+
|
|
223
|
+
## State Machine
|
|
224
|
+
|
|
225
|
+
```mermaid
|
|
226
|
+
stateDiagram-v2
|
|
227
|
+
state "'' (default)" as DEFAULT
|
|
228
|
+
[*] --> DEFAULT
|
|
229
|
+
DEFAULT --> IN_PROGRESS: reconnect()
|
|
230
|
+
IN_PROGRESS --> DEFAULT: recovery succeeds / reset()
|
|
231
|
+
IN_PROGRESS --> FAILURE: terminal recovery error
|
|
232
|
+
FAILURE --> DEFAULT: reset()
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
The diagram uses the concrete `''`, `IN_PROGRESS`, and `FAILURE` values declared for reconnection status.
|
|
236
|
+
|
|
237
|
+
## Error Handling & Failure Modes
|
|
238
|
+
|
|
239
|
+
| Condition | Signal | Caller recovery |
|
|
240
|
+
|---|---|---|
|
|
241
|
+
| Reconnection is disabled or status is already `IN_PROGRESS` | `reconnect()` throws `ReconnectionNotStartedError`. | Wait for the active run to settle or enable recovery before a new attempt. |
|
|
242
|
+
| Media/WebSocket/rejoin recovery reaches a terminal failure | The manager emits `MEETING_RECONNECTION_FAILURE`, rejects with `ReconnectionError`, and `finally` resets status/attempts; inner `FAILURE` assignments are not persistent terminal state. | Handle the failure event/rejection and inspect current meeting state before another run. |
|
|
243
|
+
| `NeedsRejoinError` is handled by a successful automatic rejoin | `reconnect()` resolves after `rejoinMeeting()` and returns before `MEETING_RECONNECTION_SUCCESS` or the recovered metric is emitted. | Treat the resolved operation/current meeting state as the outcome; do not wait for a success event on this path. |
|
|
244
|
+
| Recovery began while local sharing was active | Current code unpublishes/stops the local share with `MEDIA_RECONNECTION` or `MEETING_REJOIN`; it does not restore or republish it. | Treat restoration as a separate product decision/operation. |
|
|
245
|
+
| `cleanUp()` runs while `waitForIceReconnect()` is pending | Status and rejoin attempts reset, but the ICE timer/defer remain active because `cleanUp()` does not call `resetReconnectionTimer()`. | Explicitly invoke the ICE reset path when the owner intends to settle that pending wait. |
|
|
246
|
+
|
|
247
|
+
## Pitfalls
|
|
248
|
+
|
|
249
|
+
- Network and media events can request recovery concurrently. Starting a second timer/promise produces duplicate joins and stale completion callbacks.
|
|
250
|
+
- `cleanUp()` is not a full ICE-wait teardown: it resets status/attempts only. An owner that needs to settle and clear `iceState` must call `resetReconnectionTimer()` explicitly.
|
|
251
|
+
- Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source helper is not exported directly.
|
|
252
|
+
|
|
253
|
+
## Key Design Trade-off
|
|
254
|
+
|
|
255
|
+
- Escalating recovery favors continuity over immediate failure, with bounded delay and more lifecycle complexity.
|
|
256
|
+
|
|
257
|
+
## Test-Case Strategy (module)
|
|
258
|
+
|
|
259
|
+
Use the current mirrored suites: `test/unit/spec/reconnection-manager/index.js`. Characterize the reconnection-manager-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
|
|
260
|
+
|
|
261
|
+
| Behavior / Requirement | Existing test evidence | Gap |
|
|
262
|
+
|---|---|---|
|
|
263
|
+
| `RECONNECTION-MANAGER-R-001` | `test/unit/spec/reconnection-manager/index.js` | cover state reset, ICE wait, media retry, rejoin, and sharing-stop groups |
|
|
264
|
+
| `RECONNECTION-MANAGER-R-002` | `test/unit/spec/reconnection-manager/index.js` | ICE event/timeout races at the final attempt boundary need explicit coverage |
|
|
265
|
+
| `RECONNECTION-MANAGER-R-003` | `test/unit/spec/reconnection-manager/index.js` | assert successful auto-rejoin resolves without `MEETING_RECONNECTION_SUCCESS`, both recovery reasons stop an active share, and no completion path republishes it |
|
|
266
|
+
| `RECONNECTION-MANAGER-R-004` | `test/unit/spec/reconnection-manager/index.js` | verify concurrent triggers and exhausted retries |
|
|
267
|
+
| `RECONNECTION-MANAGER-R-005` | `test/unit/spec/reconnection-manager/index.js` | characterize both `stopLocalShareStream` recovery reasons; restoration remains a product-decision gap |
|
|
268
|
+
|
|
269
|
+
## Traceability
|
|
270
|
+
|
|
271
|
+
- Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
|
|
272
|
+
- Coverage state and contracts baseline: `../../../.sdd/manifest.json`
|
|
@@ -0,0 +1,223 @@
|
|
|
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
|
+
# RECORDING CONTROLLER — 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/recording-controller/`.
|
|
13
|
+
|
|
14
|
+
## Metadata
|
|
15
|
+
|
|
16
|
+
| Field | Value |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Module id | `recording-controller` |
|
|
19
|
+
| Source path(s) | `src/recording-controller/` |
|
|
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 recording controller/util/enums and tests |
|
|
36
|
+
| Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
|
|
37
|
+
|
|
38
|
+
## Overview
|
|
39
|
+
|
|
40
|
+
`src/recording-controller/` 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
|
+
Validates consumer recording actions against display hints/policy, selects cloud or premise recording, and returns the owning request method's promise.
|
|
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/recording-controller/
|
|
54
|
+
├── enums.ts — declared action/control enum values
|
|
55
|
+
├── index.ts — module facade/controller or primary exports
|
|
56
|
+
├── util.ts — normalization/helper functions
|
|
57
|
+
└── ai-docs/recording-controller-spec.md — canonical module specification
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Key Files (source of truth)
|
|
61
|
+
|
|
62
|
+
| File | Holds |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `src/recording-controller/enums.ts` | declared action/control enum values |
|
|
65
|
+
| `src/recording-controller/index.ts` | module facade/controller or primary exports |
|
|
66
|
+
| `src/recording-controller/util.ts` | normalization/helper functions |
|
|
67
|
+
| `test/unit/spec/recording-controller/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
|
+
| `recording-controller.1` | SDK / configuration | `RecordingController.set()`, `setLocusUrl()`, `setDisplayHints()`, `setUserPolicy()`, `setSessionId()`, `setServiceUrl()`, `getLocusUrl()`, `getLocusId()`, `getSessionId()`, `getServiceUrl()`, and `getDisplayHints()` | Refresh/read the request context and capability inputs used by later recording actions. | Preserve derived Locus id and getter/setter behavior; no recording status is stored. | `src/recording-controller/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
74
|
+
| `recording-controller.2` | SDK / remote | `startRecording()` | Validate the current start capability and send a `START` action with the selected `RecordingType`. | Preserve action/type values and selected service-vs-Locus route. | `src/recording-controller/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
75
|
+
| `recording-controller.3` | SDK / remote | `pauseRecording()` and `resumeRecording()` | Map pause/resume intent to the permitted recording action under current display hints/policy. | Rejections remain the selected facade promise; the controller applies no response state. | `src/recording-controller/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
76
|
+
| `recording-controller.4` | SDK / remote | `stopRecording()` | Send the permitted `STOP` action through the current recording route. | Preserve caller-visible rejection and remote-authority ownership of final status. | `src/recording-controller/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
77
|
+
| `recording-controller.5` | exported enums | `RecordingAction` and `RecordingType` | Define the exact action/type vocabulary serialized by controller operations. | Existing raw enum values are request contracts; additions must be compatible. | `src/recording-controller/enums.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
78
|
+
|
|
79
|
+
Compatibility notes:
|
|
80
|
+
- 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.
|
|
81
|
+
|
|
82
|
+
## Requires (dependencies)
|
|
83
|
+
|
|
84
|
+
Meeting request access, Locus URL/state, recording action/type enums, capability state, and utility validation.
|
|
85
|
+
|
|
86
|
+
## Requirements
|
|
87
|
+
|
|
88
|
+
| ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
|
|
89
|
+
|---|---|---|---|---|---|---|
|
|
90
|
+
| `RECORDING-CONTROLLER-R-001` | `startRecording`, `pauseRecording`, `resumeRecording`, and `stopRecording` call `recordingFacade()` immediately. The facade derives the recording type, checks the corresponding display hint/self policy, rejects a denied action before transport, and otherwise returns the selected request promise. | The permission decision belongs inside the facade, while accepted actions must preserve the actual request result without inventing local state application. | `src/recording-controller/index.ts` | `test/unit/spec/recording-controller/index.js` | none | PRESENT |
|
|
91
|
+
| `RECORDING-CONTROLLER-R-002` | select recording type/action payload. | Recording action/type pairs choose the remote transition and cannot be generalized without changing service behavior. | `src/recording-controller/index.ts`, `src/recording-controller/util.ts` | `test/unit/spec/recording-controller/index.js` | service and Locus paths need the same action/type rejection matrix | PRESENT |
|
|
92
|
+
| `RECORDING-CONTROLLER-R-003` | Invalid action/type/capability inputs or request failures reject the returned promise; this controller allocates no independent listener, lock, or timer. | Remote recording state remains authoritative, so rejection cannot be masked by a fabricated local transition. | `src/recording-controller/` | `test/unit/spec/recording-controller/index.js` | none | PRESENT |
|
|
93
|
+
|
|
94
|
+
## Design Overview
|
|
95
|
+
|
|
96
|
+
`RecordingController` stores request context, validates actions through `util.ts`, selects cloud or premise recording, and delegates either to `request.request` for the recording service or `request.locusDeltaRequest` for legacy Locus controls. It returns that promise and does not inspect the response or apply recording state. It owns no listeners or timers.
|
|
97
|
+
|
|
98
|
+
## Data Flow
|
|
99
|
+
|
|
100
|
+
```mermaid
|
|
101
|
+
flowchart LR
|
|
102
|
+
Consumer[Meeting recording API] --> Controller[index.ts]
|
|
103
|
+
Enums[enums.ts action/type values] --> Controller
|
|
104
|
+
Controller --> Util[util.ts payload builder]
|
|
105
|
+
Util --> Controller
|
|
106
|
+
Controller --> Meeting[owning Meeting request method]
|
|
107
|
+
Meeting --> Locus[Locus recording operation]
|
|
108
|
+
Locus --> Meeting
|
|
109
|
+
Meeting --> Controller
|
|
110
|
+
Controller --> Consumer
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Sequence Diagram(s)
|
|
114
|
+
|
|
115
|
+
Sequence coverage:
|
|
116
|
+
|
|
117
|
+
| Operation group | Diagram | Failure coverage |
|
|
118
|
+
|---|---|---|
|
|
119
|
+
| UC-1…UC-3 — recording control operation groups | Recording control primary sequence | denied action/type, service-vs-Locus request rejection, and no local state application |
|
|
120
|
+
| UC-1…UC-3 — recording control alternate/failure paths | Recording control alternate/failure sequence | unsupported action/type combination, missing recording capability, or recording request rejection |
|
|
121
|
+
|
|
122
|
+
### Recording control primary sequence
|
|
123
|
+
|
|
124
|
+
```mermaid
|
|
125
|
+
sequenceDiagram
|
|
126
|
+
participant C as Meeting consumer
|
|
127
|
+
participant R as RecordingController
|
|
128
|
+
participant U as util.ts
|
|
129
|
+
participant M as Meeting request owner
|
|
130
|
+
C->>R: start / pause / resume / stop
|
|
131
|
+
R->>R: call recordingFacade(action)
|
|
132
|
+
R->>U: derive recording type and test capability
|
|
133
|
+
U-->>R: route/type and allowed or denied
|
|
134
|
+
R->>M: send service or Locus request when allowed
|
|
135
|
+
M-->>R: request result or rejection
|
|
136
|
+
R-->>C: same request promise outcome
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Recording control alternate/failure sequence
|
|
140
|
+
|
|
141
|
+
```mermaid
|
|
142
|
+
sequenceDiagram
|
|
143
|
+
participant C as Meeting recording consumer
|
|
144
|
+
participant R as RecordingController
|
|
145
|
+
participant U as util.ts
|
|
146
|
+
participant F as recordingFacade
|
|
147
|
+
C->>R: start, pause, resume, or stop
|
|
148
|
+
R->>F: recordingFacade(action)
|
|
149
|
+
F->>U: derive recording type and check display hint/self policy
|
|
150
|
+
alt action is allowed
|
|
151
|
+
F->>F: send selected recording request
|
|
152
|
+
F-->>C: same request promise result or rejection
|
|
153
|
+
else action is unsupported
|
|
154
|
+
F--xC: PermissionError promise rejection before transport
|
|
155
|
+
end
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Class / Component Relationships
|
|
159
|
+
|
|
160
|
+
```mermaid
|
|
161
|
+
classDiagram
|
|
162
|
+
class Consumer
|
|
163
|
+
class Controller
|
|
164
|
+
class Enums
|
|
165
|
+
class Util
|
|
166
|
+
class Meeting
|
|
167
|
+
class Locus
|
|
168
|
+
Consumer --> Controller
|
|
169
|
+
Enums --> Controller
|
|
170
|
+
Controller --> Util
|
|
171
|
+
Util --> Controller
|
|
172
|
+
Controller --> Meeting
|
|
173
|
+
Meeting --> Locus
|
|
174
|
+
Locus --> Meeting
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The arrows identify ownership and delegation inside `src/recording-controller/`; files that only declare types or constants are not presented as transports.
|
|
178
|
+
|
|
179
|
+
## Use Cases
|
|
180
|
+
|
|
181
|
+
- **UC-1:** Refresh Locus/service/session/display-hint/policy context without creating a local recording-status projection. Evidence: `src/recording-controller/index.ts`.
|
|
182
|
+
- **UC-2:** Map start, pause, resume, and stop to the exact `RecordingAction`/`RecordingType` payload allowed by current hints and policy. Evidence: `src/recording-controller/index.ts`.
|
|
183
|
+
- **UC-3:** Route through the recording service when `serviceUrl` is present; otherwise send the derived `record` body through `locusDeltaRequest`, returning the selected dependency promise unchanged. Evidence: `src/recording-controller/index.ts`.
|
|
184
|
+
|
|
185
|
+
## State Model
|
|
186
|
+
|
|
187
|
+
The controller stores `serviceUrl`, `sessionId`, `locusUrl`, derived `locusId`, `displayHints`, and `selfUserPolicies`. It does not store current recording status or apply a response projection; the recording service/Locus remains authoritative.
|
|
188
|
+
|
|
189
|
+
## Business Rules & Invariants
|
|
190
|
+
|
|
191
|
+
- Only actions allowed by the current display hints/self policy are sent. Presence of `serviceUrl` selects the recording-service PUT; absence selects the Locus controls PATCH. The controller itself makes no recording-state change. Enforced under `src/recording-controller/`.
|
|
192
|
+
|
|
193
|
+
## Concurrency & Reactive Flow
|
|
194
|
+
|
|
195
|
+
- Each accepted action returns an independent request promise. The controller has no queue, cancellation, response ordering, or supersession guard; callers and the remote recording authority determine the outcome of overlapping actions.
|
|
196
|
+
|
|
197
|
+
## Error Handling & Failure Modes
|
|
198
|
+
|
|
199
|
+
| Condition | Signal | Caller recovery |
|
|
200
|
+
|---|---|---|
|
|
201
|
+
| Display hint/self policy does not permit the requested operation | The public method calls `recordingFacade()`; the facade returns a rejected `PermissionError` promise before selecting either transport request. | Refresh recording controls and issue only a currently allowed action. |
|
|
202
|
+
| `recordingFacade` request rejects | The controller returns that rejected promise; it does not apply a fabricated local recording state. | Handle the request failure and wait for authoritative recording state. |
|
|
203
|
+
| Recording action is accepted | The caller receives the facade request result for the selected typed payload. | Continue from service/Locus-projected recording state. |
|
|
204
|
+
|
|
205
|
+
## Pitfalls
|
|
206
|
+
|
|
207
|
+
- Action names and recording types are separate enums. Conflating them produces a syntactically valid request with the wrong server meaning.
|
|
208
|
+
- Verify both typed constants/enums and raw wire values before changing a logical condition in this legacy package.
|
|
209
|
+
|
|
210
|
+
## Test-Case Strategy (module)
|
|
211
|
+
|
|
212
|
+
Use the current mirrored suites: `test/unit/spec/recording-controller/index.js`, `test/unit/spec/recording-controller/util.js`. Characterize the recording-controller-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
|
|
213
|
+
|
|
214
|
+
| Behavior / Requirement | Existing test evidence | Gap |
|
|
215
|
+
|---|---|---|
|
|
216
|
+
| `RECORDING-CONTROLLER-R-001` | `test/unit/spec/recording-controller/index.js` | cover configuration plus each recording action on service and Locus routes |
|
|
217
|
+
| `RECORDING-CONTROLLER-R-002` | `test/unit/spec/recording-controller/index.js` | cover every action/type payload against both service and Locus routing contexts |
|
|
218
|
+
| `RECORDING-CONTROLLER-R-003` | `test/unit/spec/recording-controller/index.js` | assert facade rejection is returned unchanged and no local recording status is applied |
|
|
219
|
+
|
|
220
|
+
## Traceability
|
|
221
|
+
|
|
222
|
+
- Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
|
|
223
|
+
- Coverage state and contracts baseline: `../../../.sdd/manifest.json`
|