docs(calling): onboard Calling SDK to standard SDD structure#5078
docs(calling): onboard Calling SDK to standard SDD structure#5078vivekv1504 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 567a57ecc1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| > ### Get the MetricManager Singleton | ||
| > | ||
| > ```typescript | ||
| > import {getMetricManager} from '@webex/calling'; |
There was a problem hiding this comment.
Stop documenting internal MetricManager as public
When a developer follows this canonical Metrics spec example, the import fails because getMetricManager is not exported from the package boundary (src/index.ts) or the TypeDoc entrypoint (src/api.ts); the manifest also describes Metrics as an internal singleton. This SDD route now promotes an unusable public API, so the example should either use a source-local internal import or avoid presenting getMetricManager as importable from @webex/calling.
Useful? React with 👍 / 👎.
| > ### Get the singleton and connect | ||
| > | ||
| > ```typescript | ||
| > import {getMobiusSocketInstance} from '@webex/calling/mobius-socket'; |
There was a problem hiding this comment.
Avoid advertising nonexistent Mobius subpath import
When this example is copied outside the source tree, @webex/calling/mobius-socket does not resolve: the package publishes dist only, has no exports-map alias for that subpath, and the public package boundary is src/index.ts rather than a root mobius-socket entry. This turns the internal singleton into an apparent public API and leaves generated examples/tests with a broken module specifier.
Useful? React with 👍 / 👎.
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
ciscoRankush
left a comment
There was a problem hiding this comment.
Few more comments and questions
- you do not want templates to be added to in the PR ? for future use
- in module specs , remove the path of the generated files
Question
- while migrating , which option you have selected ? why I am seeing old files references ? which model and which ai agent you have used ?
| | Module id | `call-history` | | ||
| | Source path(s) | `src/CallHistory/` | | ||
| | Doc kind | Module spec | | ||
| | Coverage score | 100% structural field coverage; `.generated/sdd/coverage-review-2026-07-04.md` | |
There was a problem hiding this comment.
For all the module specific specs
- remove the path like that in coverage :
.generated/sdd/coverage-review-2026-07-04.md
I am fixing it from the lib side , but for now , you can command ai agent to not include path of generated files in the specs
There was a problem hiding this comment.
this comment is valid for all the module specific specs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b9b43f1bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| > ```typescript | ||
| > const response = await contactClient.createContact({ | ||
| > contactId: 'custom-contact-uuid', | ||
| > contactType: ContactType.CUSTOM, |
There was a problem hiding this comment.
Stop using unexported ContactType in public example
When this consumer example is copied, ContactType is not available from @webex/calling: the package boundary only re-exports Contact, ContactResponse, GroupType, and IContacts from Contacts/types, and the preceding example import only includes createContactsClient. This leaves the canonical Contacts spec with an example that cannot compile for SDK users or generated tests; use the raw 'CUSTOM'/'CLOUD' values or export/import the enum explicitly.
Useful? React with 👍 / 👎.
| "mode": "reconcile", | ||
| "decided_by": "repository user", | ||
| "decided_at": "2026-07-04T00:00:00+05:30", | ||
| "decision_record": ".generated/sdd/spec-source-policy/decision.md" |
There was a problem hiding this comment.
Point SDD evidence at committed artifacts
This manifest now points the source-policy decision record into .generated, but this commit also ignores .generated/ and tracks no .generated files, so any SDD validator or agent following the manifest cannot read the evidence it is told to use. Please either commit the referenced evidence under a non-ignored docs path or change these manifest references to artifacts that are actually present in the repository.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 043c3f9149
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ```typescript | ||
| import {createCallRecordingClient} from '@webex/calling'; | ||
|
|
||
| const callRecording = createCallRecordingClient(webex, {level: 'info'}); |
There was a problem hiding this comment.
Use the LOGGER enum in TypeScript examples
When a TypeScript consumer copies this canonical factory example, it does not type-check because the logger parameter is typed as LoggerInterface.level: LOGGER, and string enum parameters do not accept the raw literal 'info'. The same {level: 'info'} pattern appears across the public factory examples, so the snippets should import/use the exported LOGGER.INFO (or otherwise show a correctly typed logger) instead of a bare string.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 400dd755a1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | `callingClient:outgoing_call` | `CALLING_CLIENT_EVENT_KEYS.OUTGOING_CALL` | `string` (callId) | Outbound call initiated | | ||
| | `callingClient:user_recent_sessions` | `CALLING_CLIENT_EVENT_KEYS.USER_SESSION_INFO` | `CallSessionEvent` | User session info from Janus | | ||
| | `callingClient:all_calls_cleared` | `CALLING_CLIENT_EVENT_KEYS.ALL_CALLS_CLEARED` | _(none)_ | All active calls have ended | |
There was a problem hiding this comment.
Stop listing events the client never emits
When consumers follow this events table and attach listeners to a CallingClient, these handlers never fire: a repo-wide search of CallingClient.ts/callManager.ts shows no emit for CALLING_CLIENT_EVENT_KEYS.OUTGOING_CALL, and ALL_CALLS_CLEARED is emitted by CallManager then consumed privately by registerCallsClearedListener rather than re-emitted on the CallingClient. Please either re-emit these from the client or remove them from the emitted-events table.
Useful? React with 👍 / 👎.
|
|
||
| ```typescript | ||
| try { | ||
| const response = await callingClient.uploadLogs(); |
There was a problem hiding this comment.
Don't call uploadLogs on the factory result
For consumers who create the client through the public createClient factory, this snippet does not type-check: createClient returns Promise<ICallingClient>, and ICallingClient in src/CallingClient/types.ts does not declare uploadLogs (the spec above even labels it class-only). Either make uploadLogs part of the public interface/exported surface or avoid showing it as callable on the factory result.
Useful? React with 👍 / 👎.
| | `postStatus` | `postStatus(): Promise<WebexRequestPayload>` | Send call keepalive to Mobius | | ||
| | `sendCallStateMachineEvt` | `sendCallStateMachineEvt(event: CallEvent): void` | Send event to call state machine | | ||
| | `sendMediaStateMachineEvt` | `sendMediaStateMachineEvt(event: RoapEvent): void` | Send event to media state machine | | ||
| | `postSSRequest` | `postSSRequest(context: unknown, type: SUPPLEMENTARY_SERVICES): Promise<SSResponse>` | Send supplementary service request (hold, resume, transfer) to Mobius | |
There was a problem hiding this comment.
Keep postSSRequest out of the public ICall table
For app code that obtains calls through ILine.makeCall or incoming line events, the static type is ICall, and ICall in src/CallingClient/calling/types.ts does not include postSSRequest; it is a class helper used internally by hold/resume/transfer flows. Listing it under the public ICall methods makes generated or consumer TypeScript call a method that is outside the exported interface.
Useful? React with 👍 / 👎.
| |---|---|---| | ||
| | `error` | 1 | Errors only | | ||
| | `warn` | 2 | Errors + warnings | | ||
| | `info` | 3 | + general messages | |
There was a problem hiding this comment.
🔴 BLOCKING — factually wrong, contradicts source AND RULES.md in this same PR.
This table has info=3 / log=4, but src/Logger/types.ts:16-20 defines log=3, info=4 (error=1, warn=2, log=3, info=4, trace=5). RULES.md:476 in this PR has it correct. Swap the info/log rows.
SDLC rule: source-grounded claims (README convention #9) + code-vs-spec match.
There was a problem hiding this comment.
updated the logging level table and now it is matching with rules.md and logger.ts files
|
|
||
| The `LOGGER` enum defines the string values: `'error'`, `'warn'`, `'info'`, `'log'`, `'trace'`. | ||
|
|
||
| Log format: `Calling SDK: <UTC timestamp>: [LEVEL]: file:<filename> - method:<methodName> - message:<content>` |
There was a problem hiding this comment.
🔴 BLOCKING — wrong log prefix. States Calling SDK:, but the real prefix is webex-calling (REPO_NAME in src/CallingClient/constants.ts:3, used in src/Logger/index.ts). RULES.md:465 uses the correct value.
There was a problem hiding this comment.
updated the log prefix with webex-calling and now it is matched with the src/Logger/index.ts and rules.md files
|
|
||
| > Root [`AGENTS.md`](../AGENTS.md) · router [`SPEC_INDEX.md`](SPEC_INDEX.md). Per-module behavior lives in the manifest-routed source-local module specs. | ||
|
|
||
| ## Design Overview |
There was a problem hiding this comment.
🟠 SHOULD-FIX — context-efficiency / detail-level (README convention #3 & #6). ## Design Overview should be 2-3 paragraphs of purpose+shape, but it runs ~350 lines duplicating module-spec-level detail (interface signatures, factory tables, CallingClientConfig fields, event maps). That belongs in the source-local module specs it already links to — link, don't restate. Also: Metrics is documented twice (≈696 & ≈714), the module inventory appears 3× (Component Inventory / Module Map / File Structure), and the Module Map + File Structure omit CallRecording and mobius-socket.
|
|
||
| ## Key Design Trade-off | ||
|
|
||
| Separate signaling and media state machines prevent transport events from directly mutating WebRTC state, but require explicit coordination of ROAP and call-control events. Evidence: `src/CallingClient/calling/call.ts`, `src/CallingClient/calling/callStateMachine.ts`, `src/CallingClient/calling/mediaStateMachine.ts`. |
There was a problem hiding this comment.
🔴 BLOCKING — fabricated evidence paths. Cites src/CallingClient/calling/callStateMachine.ts and mediaStateMachine.ts. Neither file exists — the XState machines are defined inline in call.ts. Point the evidence at the real file.
There was a problem hiding this comment.
remove fabricated evidence path (not existing in directory ) and add the new evidence path
|
|
||
| | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence | | ||
| |---|---|---|---|---|---|---| | ||
| | CALLING-R-001 | - Supports hold/resume, transfer, mute, DTMF, and media updates during active calls. | Routing mid-call actions through the Call lifecycle prevents hold, transfer, DTMF, mute, or media updates from bypassing signaling and media state guards. | `src/CallingClient/calling/CallerId/index.ts` | `src/CallingClient/calling/CallerId/index.test.ts` | none identified | PRESENT | |
There was a problem hiding this comment.
🔴 BLOCKING / SHOULD-FIX — mismatched & thin requirements. All three requirement rows cite CallerId/index.ts + CallerId/index.test.ts, but CALLING-R-001 is about hold/resume/transfer/mute/DTMF — behavior in call.ts (tests in call.test.ts/callManager.test.ts), not CallerId. Also only 3 requirements for the largest module (Call + CallManager + 2 state machines + ROAP + keepalive + supplementary services); core call-lifecycle/ROAP/state behaviors have no rows. WHAT fields also carry stray -/1. list markers. Same wrong mapping repeats in the Test-Case Strategy table (~:1967).
There was a problem hiding this comment.
updated new correct and related path for CALLING-R-001
|
|
||
| ## Key Files (source of truth) | ||
|
|
||
| | File | Holds | |
There was a problem hiding this comment.
🟠 SHOULD-FIX (systemic across all module specs) — generic-fill "Key Files (source of truth)" table. Every row's "Holds" is the identical boilerplate "Implementation, types, constants, or adapter behavior," and every test row is "Test/characterization evidence." Template says avoid generic fill — state what each authoritative file actually owns (the accurate per-file descriptions already exist in the File Structure block below). Same pattern in calling-client/calling/caller-id/line/registration/mobius-socket/metrics/contacts/voicemail/callsettings/callhistory/sdk-connector. Relatedly, the boilerplate "Error Handling & Failure Modes" table (~:724) has 3 identical placeholder rows instead of module-specific errors (real behavior is only in Pitfalls) — repeats in CallSettings/Contacts/Voicemail.
| - **Region Info / Mobius Servers metrics**: Always hardcode `ServiceIndicator.CALLING` regardless of constructor `indicator` param. | ||
| - **Registration metrics**: Uses `trackingId` (camelCase) as field key. Upload logs uses `tracking_id` (snake_case). | ||
|
|
||
| ### Conditional Submission |
There was a problem hiding this comment.
🟠 SHOULD-FIX — duplicated content. "Conditional Submission" appears 3× (~:189, :284, :373). Consolidate. (Metrics is otherwise the cleanest on evidence — internal-surface handling and CONTRACTS anchor verified.):333) and "Metric Data Structure" appears in both Design Overview (:273) and Data Flow (
| - Ask first for public exports/events, backend contracts, security, transport, performance, or irreversible operations. | ||
| - Never push, publish, deploy, delete data, or post externally without explicit approval. | ||
|
|
||
| ### Purpose |
There was a problem hiding this comment.
🟠 SHOULD-FIX — unflagged template-order break / altitude (README convention #4). This ~250-line migrated block (Purpose, Quick Start Workflow, Task Classification tree, Task Routing, Pre-Questions, Spec Summary Gate, Critical Rules, Documentation Update Gate) is injected between the universal Autonomy & Ask-First and Naming sections with no Include-if/condition-id or extension note. Much of it (task routing, spec-summary workflow) is AGENTS/SPEC_INDEX-owned content duplicated here. Move it behind a recorded repo-specific extension or route it to its owning doc. Universal sections themselves are present/in-order and content is source-grounded — this is structural.
| ### Correct | ||
|
|
||
| ```typescript | ||
| return serviceErrorCodeHandler(error, logger, context); |
There was a problem hiding this comment.
🟠 SHOULD-FIX — invented "Correct" example (_pattern-example.md requires it be copied from real source). Shows a 3-arg call serviceErrorCodeHandler(error, logger, context), but the real function src/common/Utils.ts:861 takes 2 args (err, loggerContext) and every call site uses 2 (e.g. CallHistory.ts:255). Fix the signature.
There was a problem hiding this comment.
I haven't updated this file in this PR
| @@ -0,0 +1,283 @@ | |||
| # SDKConnector — SPEC | |||
There was a problem hiding this comment.
🟡 NIT / reconcile — untracked 13th spec. This is the cleanest module spec (honest WEAK confidence, justified N/As, verified commit hash), but it's registered Untracked, is excluded from the PR's "12/12" count, and is the only module missing the AGENTS.md/ARCHITECTURE.md stub redirects its 12 siblings received. Either fold it into the tracked set (count + stubs) or explicitly document it as intentionally excluded.
COMPLETES # Migrate Calling SDK AI-docs to SDD
This pull request addresses
This PR completes the Calling SDK AI documentation migration/onboarding to the standard SDLC SDD documentation structure.
The Calling package already had existing
ai-docscontent across package-level and module-level areas. This change reconciles those existing docs into canonical SDD documentation without deleting or archiving the legacy docs. The onboarding was completed using the approved brownfield reconcile approach and independently validated with Claude Code.Validation status:
git diff --check: passedby making the following changes
packages/calling/.sdd/manifest.jsonfor Calling SDK SDD documentation routing.packages/calling/ai-docs/, including:SPEC_INDEX.mdARCHITECTURE.mdCONTRACTS.mdGETTING_STARTED.mdGLOSSARY.mdREVIEW_CHECKLIST.mdSECURITY.mdSERVICE_STATE.mdadr/README.mdpackages/calling/AGENTS.mdandpackages/calling/ai-docs/RULES.mdto align with the standard SDD structure.ai-docs; no legacy docs were deleted or archived in this PR..generated/to.gitignoreso local SDD validation/onboarding reports are not committed.Change Type
The following scenarios were tested
git diff --cached --checkpassed.ai-docswere preserved.The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.