Skip to content

Comments

docs(contact-center): add config service AI documentation-Architecture#4731

Open
Shreyas281299 wants to merge 2 commits intowebex:nextfrom
Shreyas281299:SDD-config-arch
Open

docs(contact-center): add config service AI documentation-Architecture#4731
Shreyas281299 wants to merge 2 commits intowebex:nextfrom
Shreyas281299:SDD-config-arch

Conversation

@Shreyas281299
Copy link
Contributor

@Shreyas281299 Shreyas281299 commented Feb 20, 2026

COMPLETES # https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-775683

This pull request addresses

< DESCRIBE THE CONTEXT OF THE ISSUE >

by making the following changes

< DESCRIBE YOUR CHANGES >

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

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

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 - Please Specify
  • 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.

@Shreyas281299 Shreyas281299 requested a review from a team as a code owner February 20, 2026 09:56
@Shreyas281299 Shreyas281299 added the validated If the pull request is validated for automation. label Feb 20, 2026
@Shreyas281299
Copy link
Contributor Author

@codex review

Copy link

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

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: 3bbf1f4e5c

ℹ️ 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 149 to 150
listTeams: (orgId, page, pageSize, filter) =>
`/organization/${orgId}/team?page=${page}&pageSize=${pageSize}&filter=${filter}`,

Choose a reason for hiding this comment

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

P2 Badge Correct endpoint map examples to match service routes

This section states the snippet is Defined in constants.ts, but these paths do not match the implemented endPointMap routes (for example, listTeams in src/services/config/constants.ts uses organization/${orgId}/v2/team..., and several others include different v2 paths/query params). If engineers use this architecture doc to implement or troubleshoot config calls, they will hit incorrect URLs and 404s, so the examples should reflect the real constants.

Useful? React with 👍 / 👎.

…TURE.md

Update the API Endpoints section to match the actual endPointMap in
constants.ts. Fix incorrect paths (missing v2/, wrong routes), add
missing query parameters (agentView=true), and include previously
omitted endpoints (multimediaProfile, urlMapping, queueList,
entryPointList, addressBookEntries).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

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

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: 576b1ca3af

ℹ️ 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 +247 to +248
agentId: userData.id,
agentName: `${userData.firstName} ${userData.lastName}`,

Choose a reason for hiding this comment

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

P2 Badge Correct parseAgentConfigs example to use ciUserId

The parseAgentConfigs example maps agentId to userData.id, but the real implementation in services/config/Util.ts maps agentId from userData.ciUserId and uses userData.id for analyserUserId; this mismatch can lead engineers to propagate the wrong identifier when they copy this architecture guidance for profile shaping or downstream lookups that key on CI user ID.

Useful? React with 👍 / 👎.

Copy link

@ciscoRankush ciscoRankush left a comment

Choose a reason for hiding this comment

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

Review Summary

This PR adds architecture documentation for the config service, which aligns with the ai-docs framework. The Mermaid diagrams are a nice addition for visualizing data flow. CI is passing since this is docs-only.

However, there are several factual inaccuracies when cross-referenced with the actual source code. These would mislead developers and AI agents who use this documentation as a reference.

Blocking (Must Fix)

B1. agentId mapped to wrong field (line 248)
Doc shows agentId: userData.id but Util.ts:191 uses agentId: userData.ciUserId. userData.id is actually mapped to analyserUserId. This is a critical factual error.

B2. parseAgentConfigs example misrepresents actual logic (lines 240-260)

  • teams: teamData.map(...) — actual code (Util.ts:185) passes teams: teamData directly, no mapping.
  • idleCodes/wrapupCodes filtering — real code uses getFilterAuxCodes() with complex logic (active status, specificCodes, hardcoded "Available" state). The simple .filter() hides critical business logic.

Suggestions (Should Fix)

S1. PR description template not filled out — FedRAMP compliance fields, change type, and test sections are empty. Template states this will result in PR rejection.

S2. Sequence diagram misrepresents getAllTeams concurrency (lines 110-128) — Shows it as sequential, but actual code starts it in parallel with other promises via Promise.all().

S3. Event constants subset is arbitrary (lines 276-309) — Shows only 4 of 18 agent events and 3 of 50+ task events. Should either show full list or clearly point to types.ts as canonical source.

S4. Error handling uses fabricated method names (lines 314-345) — Uses getSomeData, endPointMap.someEndpoint. Better to use an actual method like getUserUsingCI.

Nits

  • N1. Uses page = 0 literal instead of DEFAULT_PAGE constant (line 221)
  • N2. ConfigData type (line 237) does not exist in the codebase; actual function uses inline type
  • N3. Troubleshooting section is generic — could include actual log string patterns

// Build Profile object
return {
agentId: userData.id,
agentName: `${userData.firstName} ${userData.lastName}`,

Choose a reason for hiding this comment

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

[Blocking] agentId: userData.id is incorrect. The actual code in Util.ts:191 uses agentId: userData.ciUserId. userData.id is mapped to analyserUserId (Util.ts:239). This would cause AI agents or developers to use the wrong identifier for agent identification.

agentId: userData.id,
agentName: `${userData.firstName} ${userData.lastName}`,
teams: teamData.map(t => ({ teamId: t.id, teamName: t.name })),
idleCodes: auxCodes.filter(c => c.workTypeCode === 'IDLE_CODE'),

Choose a reason for hiding this comment

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

[Blocking] teams: teamData.map(t => ({ teamId: t.id, teamName: t.name })) — The actual code at Util.ts:185 just does teams: teamData (passes the raw TeamList[] directly, no mapping).

Also, idleCodes and wrapupCodes filtering is oversimplified. The real code uses getFilterAuxCodes() which checks active status, specificCodes access level, and pushes a hardcoded "Available" state entry (Util.ts:169-180). The simple .filter() shown here hides critical business logic.

API-->>WR: Teams
WR-->>Cfg: Team list

Cfg->>Cfg: parseAgentConfigs(allData)

Choose a reason for hiding this comment

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

[Suggestion] The sequence diagram shows getAllTeams happening sequentially after the dial plan check. In the actual code (index.ts:84-86), the userTeamPromise is started in parallel alongside other promises and all are awaited via Promise.all(). The diagram misrepresents the concurrency model.

teamData,
tenantData,
orgInfoData,
auxCodes,

Choose a reason for hiding this comment

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

[Nit] The ConfigData type referenced here does not exist in the codebase. The actual parseAgentConfigs function in Util.ts uses an inline object type parameter, not a named type.

}

return allTeams;
}

Choose a reason for hiding this comment

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

[Nit] Uses let page = 0; literal. The actual code uses let page = DEFAULT_PAGE; (imported constant from constants.ts).

method: HTTP_METHODS.GET,
});

if (response.statusCode !== 200) {

Choose a reason for hiding this comment

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

[Suggestion] The error handling example uses fabricated method names (getSomeData, METHODS.GET_SOME_DATA, endPointMap.someEndpoint). Since this doc describes the actual architecture, consider using a real method like getUserUsingCI as the example.

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.

2 participants