Skip to content

docs(calling): onboard Calling SDK to standard SDD structure#5078

Open
vivekv1504 wants to merge 5 commits into
webex:nextfrom
vivekv1504:migrate-aidoc-callingsdk-pacakge
Open

docs(calling): onboard Calling SDK to standard SDD structure#5078
vivekv1504 wants to merge 5 commits into
webex:nextfrom
vivekv1504:migrate-aidoc-callingsdk-pacakge

Conversation

@vivekv1504

@vivekv1504 vivekv1504 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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-docs content 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:

  • Gate: open
  • Blocking findings: 0
  • Informational warnings: 3, accepted
  • Capability specifications: 12/12
  • Manifest schema: passed
  • git diff --check: passed
  • Source/test code changes: none

by making the following changes

  • Added packages/calling/.sdd/manifest.json for Calling SDK SDD documentation routing.
  • Added standard package-level SDD docs under packages/calling/ai-docs/, including:
    • SPEC_INDEX.md
    • ARCHITECTURE.md
    • CONTRACTS.md
    • GETTING_STARTED.md
    • GLOSSARY.md
    • REVIEW_CHECKLIST.md
    • SECURITY.md
    • SERVICE_STATE.md
    • adr/README.md
  • Updated packages/calling/AGENTS.md and packages/calling/ai-docs/RULES.md to align with the standard SDD structure.
  • Added 12 canonical module specifications for the Calling SDK capability boundaries:
    • CallHistory
    • CallRecording
    • CallSettings
    • CallingClient
    • Calling
    • CallerId
    • Line
    • Registration
    • Contacts
    • Metrics
    • Voicemail
    • Mobius socket
  • Preserved existing legacy ai-docs; no legacy docs were deleted or archived in this PR.
  • Added .generated/ to .gitignore so local SDD validation/onboarding reports are not committed.

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

  • Validated the Calling SDK SDD manifest schema.
  • Ran generated-document conformance checks.
  • Ran coverage review across all 12 Calling SDK capability specs.
  • Completed independent Claude Code spec validation with 0 Blocking findings.
  • Verified git diff --cached --check passed.
  • Verified no production source or test files were modified.
  • Verified legacy ai-docs were preserved.

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - codex,claude cli
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

@vivekv1504 vivekv1504 requested a review from a team as a code owner July 4, 2026 08:20

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@vivekv1504 vivekv1504 added the validated If the pull request is validated for automation. label Jul 4, 2026
@aws-amplify-us-east-2

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-5078.d3m3l2kee0btzx.amplifyapp.com

@github-actions github-actions Bot removed the validated If the pull request is validated for automation. label Jul 6, 2026

@ciscoRankush ciscoRankush left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment is valid for all the module specific specs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread packages/calling/.sdd/manifest.json Outdated
"mode": "reconcile",
"decided_by": "repository user",
"decided_at": "2026-07-04T00:00:00+05:30",
"decision_record": ".generated/sdd/spec-source-policy/decision.md"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@vivekv1504 vivekv1504 added the validated If the pull request is validated for automation. label Jul 6, 2026
@github-actions github-actions Bot removed the validated If the pull request is validated for automation. label Jul 6, 2026
@vivekv1504 vivekv1504 added the validated If the pull request is validated for automation. label Jul 6, 2026
@github-actions github-actions Bot removed the validated If the pull request is validated for automation. label Jul 6, 2026
@vivekv1504 vivekv1504 added the validated If the pull request is validated for automation. label Jul 6, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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'});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@github-actions github-actions Bot removed the validated If the pull request is validated for automation. label Jul 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +189 to +191
| `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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@vivekv1504 vivekv1504 added the validated If the pull request is validated for automation. label Jul 8, 2026
|---|---|---|
| `error` | 1 | Errors only |
| `warn` | 2 | Errors + warnings |
| `info` | 3 | + general messages |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated new correct and related path for CALLING-R-001


## Key Files (source of truth)

| File | Holds |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 SHOULD-FIX — duplicated content. "Conditional Submission" appears 3× (~:189, :284, :333) and "Metric Data Structure" appears in both Design Overview (:273) and Data Flow (:373). Consolidate. (Metrics is otherwise the cleanest on evidence — internal-surface handling and CONTRACTS anchor verified.)

- 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't updated this file in this PR

@@ -0,0 +1,283 @@
# SDKConnector — SPEC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants