@webex/contact-center 3.12.0-next.9 → 3.12.0-next.91
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 +876 -0
- package/AGENTS.md +94 -0
- package/ai-docs/ARCHITECTURE.md +168 -0
- package/ai-docs/CONTRACTS.md +46 -0
- package/ai-docs/GETTING_STARTED.md +168 -0
- package/ai-docs/GLOSSARY.md +43 -0
- package/ai-docs/README.md +138 -0
- package/ai-docs/REVIEW_CHECKLIST.md +41 -0
- package/ai-docs/RULES.md +444 -0
- package/ai-docs/SECURITY.md +52 -0
- package/ai-docs/SERVICE_STATE.md +48 -0
- package/ai-docs/SPEC_INDEX.md +65 -0
- package/ai-docs/adr/0001-spec-source-policy.md +55 -0
- package/ai-docs/adr/README.md +8 -0
- package/ai-docs/adr/_adr-template.md +31 -0
- package/ai-docs/contact-center-spec.md +341 -0
- package/ai-docs/features/generated-spec-conformance-fidelity-remediation/spec/feature-spec.md +117 -0
- package/ai-docs/features/residual-warning-coverage-completion/spec/feature-spec.md +203 -0
- package/ai-docs/features/validator-code-fidelity-drift-fix/spec/feature-spec.md +315 -0
- package/ai-docs/patterns/event-driven-patterns.md +485 -0
- package/ai-docs/patterns/testing-patterns.md +480 -0
- package/ai-docs/patterns/typescript-patterns.md +365 -0
- package/ai-docs/templates/README.md +102 -0
- package/ai-docs/templates/documentation/create-agents-md.md +240 -0
- package/ai-docs/templates/documentation/create-architecture-md.md +295 -0
- package/ai-docs/templates/existing-service/bug-fix.md +254 -0
- package/ai-docs/templates/existing-service/feature-enhancement.md +450 -0
- package/ai-docs/templates/new-method/00-master.md +80 -0
- package/ai-docs/templates/new-method/01-requirements.md +232 -0
- package/ai-docs/templates/new-method/02-implementation.md +295 -0
- package/ai-docs/templates/new-method/03-tests.md +201 -0
- package/ai-docs/templates/new-method/04-validation.md +141 -0
- package/ai-docs/templates/new-service/00-master.md +109 -0
- package/ai-docs/templates/new-service/01-pre-questions.md +159 -0
- package/ai-docs/templates/new-service/02-code-generation.md +346 -0
- package/ai-docs/templates/new-service/03-integration.md +178 -0
- package/ai-docs/templates/new-service/04-test-generation.md +205 -0
- package/ai-docs/templates/new-service/05-validation.md +145 -0
- package/dist/cc.js +265 -29
- package/dist/cc.js.map +1 -1
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +17 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/dist/metrics/behavioral-events.js +101 -0
- package/dist/metrics/behavioral-events.js.map +1 -1
- package/dist/metrics/constants.js +25 -4
- package/dist/metrics/constants.js.map +1 -1
- package/dist/services/ApiAiAssistant.js +153 -8
- package/dist/services/ApiAiAssistant.js.map +1 -1
- package/dist/services/UserPreference.js +427 -0
- package/dist/services/UserPreference.js.map +1 -0
- package/dist/services/config/Util.js +3 -3
- package/dist/services/config/Util.js.map +1 -1
- package/dist/services/config/constants.js +23 -2
- package/dist/services/config/constants.js.map +1 -1
- package/dist/services/config/types.js +49 -9
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/core/Err.js.map +1 -1
- package/dist/services/core/Utils.js +107 -32
- package/dist/services/core/Utils.js.map +1 -1
- package/dist/services/core/websocket/WebSocketManager.js +2 -1
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
- package/dist/services/core/websocket/types.js.map +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/task/Task.js +688 -0
- package/dist/services/task/Task.js.map +1 -0
- package/dist/services/task/TaskFactory.js +45 -0
- package/dist/services/task/TaskFactory.js.map +1 -0
- package/dist/services/task/TaskManager.js +728 -527
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/TaskUtils.js +162 -26
- package/dist/services/task/TaskUtils.js.map +1 -1
- package/dist/services/task/constants.js +9 -2
- package/dist/services/task/constants.js.map +1 -1
- package/dist/services/task/dialer.js +78 -0
- package/dist/services/task/dialer.js.map +1 -1
- package/dist/services/task/digital/Digital.js +77 -0
- package/dist/services/task/digital/Digital.js.map +1 -0
- package/dist/services/task/state-machine/TaskStateMachine.js +837 -0
- package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
- package/dist/services/task/state-machine/actions.js +543 -0
- package/dist/services/task/state-machine/actions.js.map +1 -0
- package/dist/services/task/state-machine/constants.js +161 -0
- package/dist/services/task/state-machine/constants.js.map +1 -0
- package/dist/services/task/state-machine/guards.js +340 -0
- package/dist/services/task/state-machine/guards.js.map +1 -0
- package/dist/services/task/state-machine/index.js +53 -0
- package/dist/services/task/state-machine/index.js.map +1 -0
- package/dist/services/task/state-machine/types.js +54 -0
- package/dist/services/task/state-machine/types.js.map +1 -0
- package/dist/services/task/state-machine/uiControlsComputer.js +553 -0
- package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
- package/dist/services/task/taskDataNormalizer.js +99 -0
- package/dist/services/task/taskDataNormalizer.js.map +1 -0
- package/dist/services/task/types.js +212 -4
- package/dist/services/task/types.js.map +1 -1
- package/dist/services/task/voice/Voice.js +1042 -0
- package/dist/services/task/voice/Voice.js.map +1 -0
- package/dist/services/task/voice/WebRTC.js +149 -0
- package/dist/services/task/voice/WebRTC.js.map +1 -0
- package/dist/types/cc.d.ts +94 -1
- package/dist/types/config.d.ts +6 -0
- package/dist/types/constants.d.ts +17 -1
- package/dist/types/index.d.ts +21 -6
- package/dist/types/metrics/constants.d.ts +21 -1
- package/dist/types/services/ApiAiAssistant.d.ts +22 -4
- package/dist/types/services/UserPreference.d.ts +118 -0
- package/dist/types/services/config/constants.d.ts +21 -0
- package/dist/types/services/config/types.d.ts +171 -10
- package/dist/types/services/core/Err.d.ts +4 -0
- package/dist/types/services/core/Utils.d.ts +33 -13
- package/dist/types/services/core/websocket/WebSocketManager.d.ts +1 -0
- package/dist/types/services/core/websocket/types.d.ts +1 -1
- package/dist/types/services/index.d.ts +1 -1
- package/dist/types/services/task/Task.d.ts +157 -0
- package/dist/types/services/task/TaskFactory.d.ts +12 -0
- package/dist/types/services/task/TaskUtils.d.ts +46 -2
- package/dist/types/services/task/constants.d.ts +7 -0
- package/dist/types/services/task/dialer.d.ts +30 -0
- package/dist/types/services/task/digital/Digital.d.ts +22 -0
- package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +1144 -0
- package/dist/types/services/task/state-machine/actions.d.ts +10 -0
- package/dist/types/services/task/state-machine/constants.d.ts +107 -0
- package/dist/types/services/task/state-machine/guards.d.ts +90 -0
- package/dist/types/services/task/state-machine/index.d.ts +13 -0
- package/dist/types/services/task/state-machine/types.d.ts +267 -0
- package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
- package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
- package/dist/types/services/task/types.d.ts +603 -66
- package/dist/types/services/task/voice/Voice.d.ts +184 -0
- package/dist/types/services/task/voice/WebRTC.d.ts +53 -0
- package/dist/types/types.d.ts +135 -0
- package/dist/types/webex.d.ts +1 -0
- package/dist/types.js +118 -2
- package/dist/types.js.map +1 -1
- package/dist/webex.js +14 -2
- package/dist/webex.js.map +1 -1
- package/package.json +15 -12
- package/src/cc.ts +329 -30
- package/src/config.ts +6 -0
- package/src/constants.ts +17 -1
- package/src/index.ts +23 -5
- package/src/metrics/ai-docs/AGENTS.md +350 -0
- package/src/metrics/ai-docs/ARCHITECTURE.md +338 -0
- package/src/metrics/ai-docs/metrics-spec.md +854 -0
- package/src/metrics/behavioral-events.ts +106 -0
- package/src/metrics/constants.ts +27 -4
- package/src/services/ApiAiAssistant.ts +203 -8
- package/src/services/UserPreference.ts +509 -0
- package/src/services/agent/ai-docs/AGENTS.md +240 -0
- package/src/services/agent/ai-docs/ARCHITECTURE.md +304 -0
- package/src/services/agent/ai-docs/agent-spec.md +504 -0
- package/src/services/ai-docs/AGENTS.md +386 -0
- package/src/services/ai-docs/services-spec.md +492 -0
- package/src/services/config/Util.ts +3 -3
- package/src/services/config/ai-docs/AGENTS.md +255 -0
- package/src/services/config/ai-docs/ARCHITECTURE.md +426 -0
- package/src/services/config/ai-docs/config-spec.md +669 -0
- package/src/services/config/constants.ts +25 -1
- package/src/services/config/types.ts +174 -11
- package/src/services/core/Err.ts +2 -0
- package/src/services/core/Utils.ts +123 -37
- package/src/services/core/ai-docs/AGENTS.md +381 -0
- package/src/services/core/ai-docs/ARCHITECTURE.md +698 -0
- package/src/services/core/ai-docs/core-spec.md +783 -0
- package/src/services/core/websocket/WebSocketManager.ts +2 -0
- package/src/services/core/websocket/types.ts +1 -1
- package/src/services/index.ts +1 -1
- package/src/services/task/Task.ts +837 -0
- package/src/services/task/TaskFactory.ts +55 -0
- package/src/services/task/TaskManager.ts +739 -614
- package/src/services/task/TaskUtils.ts +205 -25
- package/src/services/task/ai-docs/AGENTS.md +457 -0
- package/src/services/task/ai-docs/ARCHITECTURE.md +594 -0
- package/src/services/task/ai-docs/task-spec.md +1319 -0
- package/src/services/task/constants.ts +7 -0
- package/src/services/task/dialer.ts +80 -0
- package/src/services/task/digital/Digital.ts +95 -0
- package/src/services/task/state-machine/TaskStateMachine.ts +1077 -0
- package/src/services/task/state-machine/actions.ts +685 -0
- package/src/services/task/state-machine/ai-docs/AGENTS.md +458 -0
- package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1137 -0
- package/src/services/task/state-machine/ai-docs/task-state-machine-spec.md +2115 -0
- package/src/services/task/state-machine/constants.ts +172 -0
- package/src/services/task/state-machine/guards.ts +406 -0
- package/src/services/task/state-machine/index.ts +28 -0
- package/src/services/task/state-machine/types.ts +241 -0
- package/src/services/task/state-machine/uiControlsComputer.ts +867 -0
- package/src/services/task/taskDataNormalizer.ts +137 -0
- package/src/services/task/types.ts +710 -71
- package/src/services/task/voice/Voice.ts +1267 -0
- package/src/services/task/voice/WebRTC.ts +187 -0
- package/src/types.ts +166 -2
- package/src/utils/AGENTS.md +278 -0
- package/src/utils/ai-docs/utils-spec.md +381 -0
- package/src/webex.js +2 -0
- package/test/unit/spec/cc.ts +343 -23
- package/test/unit/spec/logger-proxy.ts +70 -0
- package/test/unit/spec/services/ApiAiAssistant.ts +178 -20
- package/test/unit/spec/services/UserPreference.ts +401 -0
- package/test/unit/spec/services/WebCallingService.ts +7 -1
- package/test/unit/spec/services/config/index.ts +30 -30
- package/test/unit/spec/services/core/Utils.ts +425 -8
- package/test/unit/spec/services/core/websocket/WebSocketManager.ts +66 -40
- package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
- package/test/unit/spec/services/task/Task.ts +477 -0
- package/test/unit/spec/services/task/TaskFactory.ts +62 -0
- package/test/unit/spec/services/task/TaskManager.ts +834 -1704
- package/test/unit/spec/services/task/TaskUtils.ts +206 -0
- package/test/unit/spec/services/task/dialer.ts +190 -0
- package/test/unit/spec/services/task/digital/Digital.ts +105 -0
- package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +1825 -0
- package/test/unit/spec/services/task/state-machine/guards.ts +479 -0
- package/test/unit/spec/services/task/state-machine/types.ts +18 -0
- package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +2020 -0
- package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
- package/test/unit/spec/services/task/voice/Voice.ts +631 -0
- package/test/unit/spec/services/task/voice/WebRTC.ts +235 -0
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
- package/dist/services/task/index.js +0 -1525
- package/dist/services/task/index.js.map +0 -1
- package/dist/types/services/task/index.d.ts +0 -650
- package/src/services/task/index.ts +0 -1801
- package/test/unit/spec/services/task/index.ts +0 -2184
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# Feature Spec — Residual Warning and Coverage Completion
|
|
2
|
+
|
|
3
|
+
> Start here → package root [`AGENTS.md`](../../../../AGENTS.md) · router [`SPEC_INDEX.md`](../../../SPEC_INDEX.md) · system [`ARCHITECTURE.md`](../../../ARCHITECTURE.md). This is a documentation-only protected-spec delta; it does not authorize runtime or manifest-status changes.
|
|
4
|
+
|
|
5
|
+
## Metadata
|
|
6
|
+
|
|
7
|
+
| Field | Value |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Feature / ticket key | `CC-SDD-RESIDUAL-COVERAGE-20260707` |
|
|
10
|
+
| Title | Residual validator warning and coverage completion |
|
|
11
|
+
| Status | verified — independent clean revalidation PASS; 0 Blocking, 0 warnings |
|
|
12
|
+
| Change class | documentation-only MODIFIED drift and coverage delta |
|
|
13
|
+
| created_by / approved_by / date | Codex generator / developer-approved warning cleanup and focused gap backfill / 2026-07-07 |
|
|
14
|
+
| Generated from | `feature-spec` @ SDLC template library `0.2.1` |
|
|
15
|
+
|
|
16
|
+
## Problem & Goal (WHAT + WHY)
|
|
17
|
+
|
|
18
|
+
**What:** Remove the ten non-blocking findings in the independent revalidation report and add the ten code-answerable security/auth, rollout, and observability applicability statements identified by coverage review.
|
|
19
|
+
|
|
20
|
+
**Why:** The independent Blocking gate is clear, but internally contradictory secondary documentation and six incomplete module profiles prevent a clean validator result and keep module coverage at 3/9.
|
|
21
|
+
|
|
22
|
+
## Stakeholders & Open Questions
|
|
23
|
+
|
|
24
|
+
| Stakeholder / role | Interest | Sign-off needed? |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| Contact Center maintainers | Canonical specs remain internally consistent and evidence-backed | yes — supplied 2026-07-07 |
|
|
27
|
+
| SDK consumers | No fictional APIs, paths, fields, or timeout behavior | covered by independent revalidation |
|
|
28
|
+
| Coverage reviewer | All mandatory applicability fields are explicit | deterministic review required |
|
|
29
|
+
|
|
30
|
+
**Open questions:** None. The developer explicitly approved all ten warning corrections and all ten coverage applicability statements, with no manifest promotion.
|
|
31
|
+
|
|
32
|
+
## Scope
|
|
33
|
+
|
|
34
|
+
**In scope:**
|
|
35
|
+
|
|
36
|
+
- Correct `IMP-S1`, `IMP-C1`, `IMP-C2`, `MED-1` through `MED-3`, and `MIN-1` through `MIN-4` from the independent revalidation report.
|
|
37
|
+
- Backfill the ten measured applicability gaps across Metrics, Services, Core, Task, Task state machine, and Utils.
|
|
38
|
+
- Refresh source-fidelity inventories, generated-document conformance, coverage measurement, module coverage metadata, and decision logs.
|
|
39
|
+
|
|
40
|
+
**Out of scope:**
|
|
41
|
+
|
|
42
|
+
- Runtime source or test changes.
|
|
43
|
+
- New APIs, events, fields, flags, transports, or behavior.
|
|
44
|
+
- `.sdd/manifest.json` status/evidence promotion or any `Partial` → `Specced` transition.
|
|
45
|
+
- External posting or committing local run-record and audit artifacts.
|
|
46
|
+
|
|
47
|
+
## Requirements
|
|
48
|
+
|
|
49
|
+
| Req ID | Requirement (WHAT) | Rationale (WHY) | Acceptance (how proven) | State |
|
|
50
|
+
|---|---|---|---|---|
|
|
51
|
+
| COMPLETION-R-001 | Make every secondary timeout, config, example, diagram, taxonomy, path, count, and field description agree with its authoritative section and current source. | A canonical spec is unsafe when correct primary material coexists with contradictory examples. | All ten validator warnings are absent from deterministic scans and a later independent revalidation. | Approved |
|
|
52
|
+
| COMPLETION-R-002 | Add each of the ten measured security/auth, rollout, and observability applicability statements with concrete source evidence. | Coverage fields scored WEAK when ownership or N/A boundaries were implicit. | All nine module specs score 15/15 mandatory fields in coverage review. | Approved |
|
|
53
|
+
| COMPLETION-R-003 | Preserve runtime behavior, tests, public semver, and manifest coverage states. | This pass documents current behavior; it does not change or promote it. | No non-documentation runtime/test diff and no manifest edit. | Approved |
|
|
54
|
+
| COMPLETION-R-004 | Preserve migration source fidelity and template/profile conformance. | Focused edits must not discard routed legacy detail or bypass the generated-document contract. | All source-fidelity inventories and the new conformance report pass. | Approved |
|
|
55
|
+
|
|
56
|
+
## Acceptance Criteria
|
|
57
|
+
|
|
58
|
+
- The three Important, three Medium, and four Minor revalidation findings have no remaining matching contradictory text.
|
|
59
|
+
- Metrics explicitly states host-auth inheritance and no credential ownership.
|
|
60
|
+
- Services explicitly states host-auth inheritance and that its composition root owns no rollout flag.
|
|
61
|
+
- Core explicitly distinguishes timeout/recovery constants from rollout flags and states that Core owns no feature gate.
|
|
62
|
+
- Task explicitly states authenticated transport is delegated through routing/Core and Task owns no credentials.
|
|
63
|
+
- Task state machine explicitly states its security, rollout/config, and observability ownership boundaries.
|
|
64
|
+
- Utils explicitly states its credential/data boundary and absence of rollout flags.
|
|
65
|
+
- Coverage measures 135/135 mandatory fields and 9/9 COMPLETE modules while manifest statuses remain `Partial`.
|
|
66
|
+
- No non-Markdown runtime file or test file changes, and `.sdd/manifest.json` remains byte-for-byte unchanged.
|
|
67
|
+
|
|
68
|
+
## Success & Guardrail Metrics
|
|
69
|
+
|
|
70
|
+
| Metric | Type | Baseline | Target / bound | How measured |
|
|
71
|
+
|---|---|---:|---:|---|
|
|
72
|
+
| Residual validator warnings | success | 10 | 0 matching residuals | deterministic scan plus later independent validator |
|
|
73
|
+
| COMPLETE module specs | success | 3/9 | 9/9 | coverage review |
|
|
74
|
+
| Mandatory field coverage | success | 125/135 | 135/135 | coverage review |
|
|
75
|
+
| Runtime/test changes | guardrail | 0 | 0 | scoped git status/diff |
|
|
76
|
+
| Manifest promotions | guardrail | 0 | 0 | manifest hash/diff |
|
|
77
|
+
|
|
78
|
+
## Prior-Work Register
|
|
79
|
+
|
|
80
|
+
| Existing artifact | Relationship | Disposition |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| Independent revalidation report | Defines the exact ten-warning scope | reuse as reviewed input |
|
|
83
|
+
| Coverage report | Defines the exact ten applicability gaps | supersede its measurement with a new pass; retain audit history |
|
|
84
|
+
| Validator drift-fix delta | Cleared the nine Blocking findings | extend through this separate approved residual delta |
|
|
85
|
+
| Current source and tests | Behavioral referee | read-only evidence |
|
|
86
|
+
|
|
87
|
+
## Contracts Delta
|
|
88
|
+
|
|
89
|
+
**Provides:** MODIFIED documentation only. No runtime contract is added, removed, renamed, or reclassified.
|
|
90
|
+
|
|
91
|
+
**Requires:** MODIFIED documentation only. Security/auth inheritance, rollout ownership, observability ownership, timeout ownership, and existing collaborator details are made explicit.
|
|
92
|
+
|
|
93
|
+
## Impacted Modules / Repos
|
|
94
|
+
|
|
95
|
+
| Module | Documentation impact | Runtime impact |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| Metrics | taxonomy/count consistency plus auth applicability | none |
|
|
98
|
+
| Services | timeout/RTD consistency plus auth and rollout applicability | none |
|
|
99
|
+
| Agent | qualify the Core utility path | none |
|
|
100
|
+
| Config | complete secondary AI-feature material and team wording | none |
|
|
101
|
+
| Core | real AqmReqs example, path casing, rollout applicability | none |
|
|
102
|
+
| Task | explicit event count and auth boundary | none |
|
|
103
|
+
| Task state machine | security, rollout/config, and observability boundaries | none |
|
|
104
|
+
| Utils | security/data and rollout boundaries | none |
|
|
105
|
+
|
|
106
|
+
## MODIFIED Requirements
|
|
107
|
+
|
|
108
|
+
### MOD-001 — Services consistency and applicability
|
|
109
|
+
|
|
110
|
+
- Correct the `WEBSOCKET_EVENT_TIMEOUT` description and show both primary and RTD WebSocket managers in the early composition diagram.
|
|
111
|
+
- State that authenticated requests inherit host SDK identity through Core/WebexRequest; Services stores no credentials.
|
|
112
|
+
- State that Services owns no rollout flag and is constructed unconditionally at READY; downstream capabilities consume their own configuration.
|
|
113
|
+
|
|
114
|
+
### MOD-002 — Config secondary-section consistency
|
|
115
|
+
|
|
116
|
+
- Add AI feature flags to the ASCII aggregation diagram, `parseAgentConfigs` example, output profile, and failure list.
|
|
117
|
+
- Remove the claim that teams contain channel configurations.
|
|
118
|
+
|
|
119
|
+
### MOD-003 — Core example, path, and rollout applicability
|
|
120
|
+
|
|
121
|
+
- Make the AqmReqs state-change example match the real outer/nested binds, payload wrapper, and PUT method.
|
|
122
|
+
- Correct the traceability label to `connection-service.ts`.
|
|
123
|
+
- State that timeout/reconnect constants are behavior controls, not rollout flags, and Core owns no feature gate.
|
|
124
|
+
|
|
125
|
+
### MOD-004 — Metrics taxonomy/count and auth applicability
|
|
126
|
+
|
|
127
|
+
- Reconcile every early taxonomy statement to 80 total names, 71 mapped, and 9 unmapped.
|
|
128
|
+
- State that MetricsManager uses the host metrics client and owns no credentials or authorization policy.
|
|
129
|
+
|
|
130
|
+
### MOD-005 — Task count and auth applicability
|
|
131
|
+
|
|
132
|
+
- State that the complete public event inventory contains 49 `TASK_EVENTS`.
|
|
133
|
+
- State that Task owns no credentials and delegates authenticated operations through routing/AqmReqs/WebexRequest.
|
|
134
|
+
|
|
135
|
+
### MOD-006 — Agent path qualification
|
|
136
|
+
|
|
137
|
+
- Qualify `getStationLoginErrorData` to `src/services/core/Utils.ts`.
|
|
138
|
+
|
|
139
|
+
### MOD-007 — Task state-machine applicability
|
|
140
|
+
|
|
141
|
+
- State that the pure XState layer owns no credentials/authentication.
|
|
142
|
+
- State that UIControlConfig values are Task-supplied capability configuration, not state-machine-owned rollout evaluation.
|
|
143
|
+
- State that logging and metrics are owned by Task/TaskManager; the state-machine source has no LoggerProxy or MetricsManager dependency.
|
|
144
|
+
|
|
145
|
+
### MOD-008 — Utils applicability
|
|
146
|
+
|
|
147
|
+
- State that PageCache receives already-fetched values, owns no credentials/authentication, and keeps organization-separated in-memory cache keys.
|
|
148
|
+
- State that PageCache has no rollout flag; consuming services decide whether to call it and query parameters determine cache eligibility.
|
|
149
|
+
|
|
150
|
+
## Feasibility & Risks
|
|
151
|
+
|
|
152
|
+
- **Feasibility:** High; every change is documentation-only and directly evidenced by current source.
|
|
153
|
+
- **Spikes needed:** None.
|
|
154
|
+
|
|
155
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
156
|
+
|---|---|---|---|
|
|
157
|
+
| An N/A statement overclaims absence | low | high | search imports/constructors and cite the owning source file |
|
|
158
|
+
| Legacy source-fidelity proof is displaced | medium | medium | rerun all 12 inventories and reconcile only failed units |
|
|
159
|
+
| Coverage is mistaken for promotion authority | medium | high | retain all manifest statuses and produce draft-only promotion analysis |
|
|
160
|
+
|
|
161
|
+
## Interaction / Scenario Matrix
|
|
162
|
+
|
|
163
|
+
| Scenario | Expected documentation result | Covered by |
|
|
164
|
+
|---|---|---|
|
|
165
|
+
| Host-authenticated service request | Services/Task inherit identity through Core; no duplicate credential ownership | MOD-001, MOD-005 |
|
|
166
|
+
| Config profile aggregation | All ten dependent results, including AI feature flags, appear in primary and secondary material | MOD-002 |
|
|
167
|
+
| State change through AqmReqs | Example uses outer event, nested success/failure event, PUT, and `{data}` payload | MOD-003 |
|
|
168
|
+
| Metrics taxonomy review | Every section agrees on 80 total, 71 mapped, 9 unmapped | MOD-004 |
|
|
169
|
+
| Pure state transition | State machine applies Task-supplied config/actions while Task owns telemetry/auth integration | MOD-007 |
|
|
170
|
+
| Page cache use | Consuming service owns remote/auth decision; cache only owns eligibility/key/TTL/data | MOD-008 |
|
|
171
|
+
|
|
172
|
+
## Documentation Obligations
|
|
173
|
+
|
|
174
|
+
- Apply MOD-001 through MOD-008 only to the named protected module specs.
|
|
175
|
+
- Update source-fidelity dispositions only where exact migrated excerpts move.
|
|
176
|
+
- Write a new conformance report and a new coverage report/trend entry.
|
|
177
|
+
- Update every measured module's coverage metadata and current validation status without citing local report paths.
|
|
178
|
+
- Do not edit or promote `.sdd/manifest.json`.
|
|
179
|
+
|
|
180
|
+
## Spec State
|
|
181
|
+
|
|
182
|
+
| Section | State |
|
|
183
|
+
|---|---|
|
|
184
|
+
| Problem, scope, requirements, acceptance | complete and approved |
|
|
185
|
+
| Protected-target reconciliation | append as approved MODIFIED delta |
|
|
186
|
+
| Canonical application | complete |
|
|
187
|
+
| Source fidelity / conformance / coverage | complete / PASS / 100% |
|
|
188
|
+
| Independent clean revalidation | complete — PASS with 0 Blocking and 0 warnings |
|
|
189
|
+
|
|
190
|
+
## Change Log
|
|
191
|
+
|
|
192
|
+
| Date | Change | By | Why |
|
|
193
|
+
|---|---|---|---|
|
|
194
|
+
| 2026-07-07 | Created pre-approved residual-warning and coverage-completion delta | Codex + developer | Continue rigorous onboarding after PASS WITH WARNINGS without promoting the manifest |
|
|
195
|
+
| 2026-07-07 | Applied MOD-001 through MOD-008; source fidelity and conformance PASS; coverage reached 9/9 and 135/135 | Codex | Clear residual contradictions and complete the approved coverage loop without manifest promotion |
|
|
196
|
+
| 2026-07-07 | Recorded clean independent revalidation PASS and closed validation metadata | Codex + Claude validator | Confirm the approved delta at 0 Blocking and 0 warnings while leaving the manifest unpromoted |
|
|
197
|
+
|
|
198
|
+
## References
|
|
199
|
+
|
|
200
|
+
- Package architecture: [`ARCHITECTURE.md`](../../../ARCHITECTURE.md)
|
|
201
|
+
- Module router: [`SPEC_INDEX.md`](../../../SPEC_INDEX.md)
|
|
202
|
+
- Runtime evidence: `src/` and `test/`
|
|
203
|
+
- Independent revalidation input: local validator audit report retained outside the committed canonical evidence surface
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
# Feature Spec — Validator Code-Fidelity Drift Fix
|
|
2
|
+
|
|
3
|
+
> Start here → package root [`AGENTS.md`](../../../../AGENTS.md) · router [`SPEC_INDEX.md`](../../../SPEC_INDEX.md) · system [`ARCHITECTURE.md`](../../../ARCHITECTURE.md). This is a documentation-only protected-spec delta; it does not authorize runtime code changes.
|
|
4
|
+
|
|
5
|
+
## Metadata
|
|
6
|
+
|
|
7
|
+
| Field | Value |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Feature / ticket key | `CC-SDD-VALIDATOR-DRIFT-20260707` |
|
|
10
|
+
| Title | Validator code-fidelity drift fix |
|
|
11
|
+
| Status | implemented — deterministic verification PASS; independent revalidation pending |
|
|
12
|
+
| Change class | contract-affecting documentation correction |
|
|
13
|
+
| created_by / approved_by / date | Codex generator / developer approved MOD-001 through MOD-011 application / 2026-07-07 |
|
|
14
|
+
| Generated from | `feature-spec` @ SDLC template library `0.2.1` |
|
|
15
|
+
|
|
16
|
+
## Problem & Goal (WHAT + WHY)
|
|
17
|
+
|
|
18
|
+
**What:** Correct the protected Contact Center SDD baseline so its public APIs, internal signatures, orchestration ownership, contract catalog, event/type inventories, and examples match current code.
|
|
19
|
+
|
|
20
|
+
**Why:** Independent validation found nine Blocking and twenty Important code-fidelity findings. Leaving them in place would cause agents and maintainers to call non-existent APIs, assign behavior to the wrong owner, omit real exports and dependencies, or trust incomplete orchestration flows.
|
|
21
|
+
|
|
22
|
+
## Stakeholders & Open Questions
|
|
23
|
+
|
|
24
|
+
| Stakeholder / role | Interest in this change | Sign-off needed? |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| Contact Center package maintainers | Canonical documentation must describe current implementation accurately | yes |
|
|
27
|
+
| SDK consumers | Public exports, events, types, and semver guidance must be trustworthy | yes |
|
|
28
|
+
| Independent validator runtime | Must re-check Axis A and Axis B after remediation | yes |
|
|
29
|
+
|
|
30
|
+
**Open questions:**
|
|
31
|
+
|
|
32
|
+
- **Q-1 May this reviewed delta be applied to the protected canonical targets?** — owner: developer — status: answered yes on 2026-07-07.
|
|
33
|
+
|
|
34
|
+
## Scope
|
|
35
|
+
|
|
36
|
+
**In scope:**
|
|
37
|
+
|
|
38
|
+
- Correct all nine Blocking findings from the independent validation pass.
|
|
39
|
+
- Correct all twenty Important API, type, event, transport, evidence, taxonomy, and completeness findings.
|
|
40
|
+
- Update only the protected canonical docs named in this delta after explicit approval.
|
|
41
|
+
- Re-run source fidelity, generated-document conformance, coverage review, and independent validation.
|
|
42
|
+
|
|
43
|
+
**Out of scope:**
|
|
44
|
+
|
|
45
|
+
- Runtime source or test changes.
|
|
46
|
+
- New APIs, events, fields, endpoints, flags, or behavior.
|
|
47
|
+
- Manifest runtime changes or automatic promotion to `Specced`.
|
|
48
|
+
- The fifteen Medium and three Minor findings unless a correction is mechanically necessary for an approved Blocking/Important fix.
|
|
49
|
+
- Pattern-library evidence annotations; those remain a separate onboarding follow-up.
|
|
50
|
+
|
|
51
|
+
**Open decisions:** None; independent revalidation remains a gate, not a product decision.
|
|
52
|
+
|
|
53
|
+
## Requirements
|
|
54
|
+
|
|
55
|
+
| Req ID | Requirement (WHAT) | Rationale (WHY) | Acceptance (how proven) | State |
|
|
56
|
+
|---|---|---|---|---|
|
|
57
|
+
| DRIFT-R-001 | Replace generic Contact Center orchestration diagrams with code-grounded register, deregister, event-routing, and reconnect/relogin flows. | `src/cc.ts` is the primary orchestration implementation; generic diagrams hide ordering and ownership. | All four flows name real collaborators and are independently validated against `src/cc.ts`. | Implemented; independent validation pending |
|
|
58
|
+
| DRIFT-R-002 | Make every documented export, signature, type, event, and endpoint match current source exactly. | Hallucinated names and incomplete signatures cause invalid implementation work. | Validator reports zero Blocking B1/B3 findings and zero hallucinated APIs. | Implemented; independent validation pending |
|
|
59
|
+
| DRIFT-R-003 | Correct constructor/register timing and responsibility boundaries. | Lifecycle errors can cause duplicate listeners, missed initialization, or incorrect cleanup. | Services/ContactCenter/Core ownership statements match the current constructors and methods. | Implemented; independent validation pending |
|
|
60
|
+
| DRIFT-R-004 | Complete the contract index and module Provides/Requires summaries. | Agents load `CONTRACTS.md` and module surfaces before implementation. | Every affected public export and material collaborator is indexed once with a real source path. | Implemented; independent validation pending |
|
|
61
|
+
| DRIFT-R-005 | Correct state-machine action/control documentation without changing the state machine. | False absence and wrong symbol names invert current behavior. | Actions, control-computation functions, exports, and Task-layer overrides match current files. | Implemented; independent validation pending |
|
|
62
|
+
| DRIFT-R-006 | Correct metrics, task-event, config-field, and taxonomy inventories. | Incomplete inventories hide real observable behavior and configuration. | Inventories reconcile one-for-one with their owning constants/types and explicitly identify defined-but-unmapped metrics. | Implemented; independent validation pending |
|
|
63
|
+
| DRIFT-R-007 | Remove unstable evidence suffixes and generic acceptance wording. | Stable evidence and testable requirements are required for deterministic review. | Evidence uses file paths only; each modified statement has concrete code/test acceptance. | Implemented; independent validation pending |
|
|
64
|
+
| DRIFT-R-008 | Preserve runtime behavior and public semver. | This is a documentation correction, not a product change. | Git diff contains no runtime source/test modifications and documents no new runtime contract. | Implemented; independent validation pending |
|
|
65
|
+
|
|
66
|
+
## Acceptance Criteria
|
|
67
|
+
|
|
68
|
+
- The nine Blocking findings BLK-1 through BLK-9 are absent in the second independent validation pass (DRIFT-R-001 through DRIFT-R-005).
|
|
69
|
+
- The twenty Important findings IMP-1 through IMP-20 are corrected or explicitly dispositioned with code evidence and validator acceptance (DRIFT-R-002 through DRIFT-R-007).
|
|
70
|
+
- `routingAgent` is indexed from `src/index.ts`; no contract catalog entry invents a non-exported surface (DRIFT-R-002, DRIFT-R-004).
|
|
71
|
+
- `initWebSocket` documents both `body` and `resource`; AQM examples use a `WebSocketManager` constructor dependency and config-factory binds (DRIFT-R-002).
|
|
72
|
+
- Contact Center lifecycle diagrams distinguish READY-time construction, `register()`, `deregister()`, message routing, and `handleConnectionLost()` → `silentRelogin()` (DRIFT-R-001, DRIFT-R-003).
|
|
73
|
+
- Config aggregation includes `getAIFeatureFlags`, `Profile.aiFeature`, the `ai-feature` endpoint, and the real response/field names (DRIFT-R-002, DRIFT-R-006).
|
|
74
|
+
- The task-state-machine spec names the four real actions and the real UI-control computation functions, and explains the Task-provided `syncTaskDataFromEvent` implementation (DRIFT-R-005).
|
|
75
|
+
- All changed canonical docs pass template conformance, stable-evidence checks, local-link checks, and source-fidelity checks before revalidation (DRIFT-R-007).
|
|
76
|
+
- No non-documentation runtime file under `src/` and no file under `test/` changes as part of applying this delta (DRIFT-R-008).
|
|
77
|
+
|
|
78
|
+
## Success & Guardrail Metrics
|
|
79
|
+
|
|
80
|
+
| Metric | Type | Baseline | Target / bound | How measured |
|
|
81
|
+
|---|---|---:|---:|---|
|
|
82
|
+
| Blocking validator findings | success | 9 | 0 | Independent `spec-validator` report |
|
|
83
|
+
| Hallucinated/non-existent API names | success | 8 plus one inverted absence | 0 | Independent B1/B2 review |
|
|
84
|
+
| Contract-index mismatches | success | 6 | 0 | Independent B3 review |
|
|
85
|
+
| Important findings | success | 20 | 0 unresolved | Independent validation matrix |
|
|
86
|
+
| Runtime behavior changes | guardrail | 0 intended | 0 | Git diff for non-Markdown files under `src/` and all files under `test/` |
|
|
87
|
+
| No-override violations | guardrail | 0 | 0 | Reconcile/conformance checks |
|
|
88
|
+
|
|
89
|
+
## Prior-Work Register
|
|
90
|
+
|
|
91
|
+
| Existing artifact | How it relates | Reuse / extend / supersede |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| `.sdd/manifest.json` | Defines protected targets, source policy, module routing, and validator runtimes | reuse |
|
|
94
|
+
| Canonical module specs listed below | Contain the drift identified by independent review | modify only through this reviewed delta |
|
|
95
|
+
| `ai-docs/CONTRACTS.md` | Root public-surface index missing or overstating affected contracts | modify only through this reviewed delta |
|
|
96
|
+
| Current `src/` and `test/` trees | Behavioral source of truth for every correction | reuse; never modify in this drift fix |
|
|
97
|
+
|
|
98
|
+
## Contracts Delta
|
|
99
|
+
|
|
100
|
+
**Provides:** MODIFIED documentation only — align `routingAgent`, Contact Center methods, Task/state-control exports, agent/config response types, events, and internal module surfaces with current exports and implementations.
|
|
101
|
+
|
|
102
|
+
**Requires:** MODIFIED documentation only — align WebSocket initialization, AQM configuration, READY-time collaborators, `ApiAIAssistant`, both WebSocket managers, WebexRequest ownership, Task overrides, and metrics/config dependencies with current code.
|
|
103
|
+
|
|
104
|
+
No runtime contract is added, removed, renamed, or changed by this delta.
|
|
105
|
+
|
|
106
|
+
## Impacted Modules / Repos
|
|
107
|
+
|
|
108
|
+
| Module / repo | Impact | Manifest coverage state |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| Contact Center (`src`) | Replace generic orchestration and correct ownership/evidence | Partial |
|
|
111
|
+
| Metrics (`src/metrics`) | Complete metric catalog/taxonomy and disabled timing behavior | Partial |
|
|
112
|
+
| Services (`src/services`) | Correct READY-time composition and collaborator graph | Partial |
|
|
113
|
+
| Agent (`src/services/agent`) | Remove non-owned operations and correct event/type ownership | Partial |
|
|
114
|
+
| Config (`src/services/config`) | Complete AI-feature aggregation and correct types/fields/URL | Partial |
|
|
115
|
+
| Core (`src/services/core`) | Correct WebSocket/AQM signatures, timeouts, ownership, and evidence | Partial |
|
|
116
|
+
| Task (`src/services/task`) | Correct signatures, event inventory, factory/dialer ownership | Partial |
|
|
117
|
+
| Task state machine (`src/services/task/state-machine`) | Correct actions, control functions, exports, and overrides | Partial |
|
|
118
|
+
| Utils (`src/utils`) | Correct source/type ownership and public re-export claims | Partial |
|
|
119
|
+
| Root contracts | Index real exports and remove overstatements | Partial baseline |
|
|
120
|
+
|
|
121
|
+
## MODIFIED Requirements
|
|
122
|
+
|
|
123
|
+
### MOD-001 — Contact Center canonical orchestration
|
|
124
|
+
|
|
125
|
+
- **Canonical target:** `ai-docs/contact-center-spec.md`
|
|
126
|
+
- **WHAT:** Replace the generic Data Flow, Sequence Diagram(s), Class / Component Relationships, and State Machine material with code-grounded views for:
|
|
127
|
+
- Webex READY callback construction of WebexRequest, Services, WebCallingService, ApiAIAssistant, MetricsManager, TaskManager, EntryPoint, AddressBook, and Queue;
|
|
128
|
+
- `register()` listener setup, WebSocket connection, profile return, metrics, error log upload, and rejection;
|
|
129
|
+
- `deregister()` listener removal, Mercury/device teardown when applicable, WebSocket/RTD shutdown, agent-config clearing, and success/failure metrics;
|
|
130
|
+
- WebSocket message/event routing and connection-loss handling where ContactCenter receives `connectionLost` and conditionally invokes its private `silentRelogin()`.
|
|
131
|
+
- **WHY:** These flows define the package's actual orchestration boundary and cannot be represented by generic caller/collaborator templates.
|
|
132
|
+
- **Evidence:** `src/cc.ts`, `src/services/index.ts`, `src/services/task/TaskManager.ts`.
|
|
133
|
+
- **Acceptance:** DRIFT-R-001 through DRIFT-R-003 cite `src/cc.ts`; stale README residue is removed; the validator reports no A13 blocker.
|
|
134
|
+
|
|
135
|
+
### MOD-002 — Root contract catalog
|
|
136
|
+
|
|
137
|
+
- **Canonical target:** `ai-docs/CONTRACTS.md`
|
|
138
|
+
- **WHAT:** Add `routingAgent` as a real public export from `src/index.ts`, document its `routingAgent(routing: AqmReqs)` factory shape, and reconcile all other touched catalog rows with actual root exports. Clarify that `getDefaultUIControls` is exported by package root directly from `uiControlsComputer.ts`, not through `state-machine/index.ts`.
|
|
139
|
+
- **WHY:** The root contract index must enumerate real package consumption surfaces without inventing intermediate re-exports.
|
|
140
|
+
- **Evidence:** `src/index.ts`, `src/services/agent/index.ts`, `src/services/task/state-machine/uiControlsComputer.ts`, `src/services/task/state-machine/index.ts`.
|
|
141
|
+
- **Acceptance:** Independent B3 review reports zero missing/overstated rows for the corrected surfaces.
|
|
142
|
+
|
|
143
|
+
### MOD-003 — Core WebSocket, AQM, ownership, and transport
|
|
144
|
+
|
|
145
|
+
- **Canonical target:** `src/services/core/ai-docs/core-spec.md`
|
|
146
|
+
- **WHAT:**
|
|
147
|
+
- Document `WebSocketManager.initWebSocket({body, resource})` with both required properties.
|
|
148
|
+
- Attribute `silentRelogin()` to `ContactCenter`; describe ConnectionService as emitting `connectionLost` and handling reconnect initiation only.
|
|
149
|
+
- Replace the invalid no-argument `AqmReqs` example with construction using `WebSocketManager` and `req(configFactory)`/`reqEmpty(configFactory)` whose returned request config contains `notifSuccess.bind` and optional `notifFail.bind`.
|
|
150
|
+
- State that the HTTP acknowledgement does not resolve an AQM operation; a matched WebSocket notification does.
|
|
151
|
+
- Use `CLOSE_SOCKET_TIMEOUT = 16000` consistently; identify `TIMEOUT_REQ = 20000` as the default AQM timeout; do not describe `WEBSOCKET_EVENT_TIMEOUT` as the active AQM timeout.
|
|
152
|
+
- Distinguish the authenticated WebexRequest wrapper used by AQM from direct host `webex.request()` calls used by WebSocket subscription code.
|
|
153
|
+
- Remove line-number/range suffixes and correct path casing/listener-name prose where touched.
|
|
154
|
+
- **WHY:** Incorrect signatures, timeout values, and ownership would produce broken connection and correlation changes.
|
|
155
|
+
- **Evidence:** `src/services/core/websocket/WebSocketManager.ts`, `src/services/core/websocket/connection-service.ts`, `src/services/core/aqm-reqs.ts`, `src/services/core/constants.ts`, `src/services/core/WebexRequest.ts`, `src/cc.ts`.
|
|
156
|
+
- **Acceptance:** B1/B2/B6/B8 pass for Core and no unstable evidence suffix remains.
|
|
157
|
+
|
|
158
|
+
### MOD-004 — Services and READY-time composition
|
|
159
|
+
|
|
160
|
+
- **Canonical target:** `src/services/ai-docs/services-spec.md`
|
|
161
|
+
- **WHAT:**
|
|
162
|
+
- Distinguish Services construction from ContactCenter READY-time collaborator construction and from `register()`.
|
|
163
|
+
- Services owns agent/config/contact/dialer, the primary WebSocket manager, RTD WebSocket manager, and ConnectionService.
|
|
164
|
+
- ContactCenter's READY callback owns WebCallingService, ApiAIAssistant, MetricsManager, TaskManager, EntryPoint, AddressBook, and Queue construction.
|
|
165
|
+
- Show TaskManager receiving ApiAIAssistant, contact routing, WebCallingService, primary WebSocket manager, and RTD WebSocket manager.
|
|
166
|
+
- Add ApiAIAssistant and the RTD WebSocket manager to the complete capability/dependency graph without falsely claiming ApiAIAssistant is a Services field.
|
|
167
|
+
- **WHY:** Constructor/register confusion changes lifecycle ordering and hides two real realtime/AI collaborators.
|
|
168
|
+
- **Evidence:** `src/cc.ts`, `src/services/index.ts`, `src/services/ApiAiAssistant.ts`, `src/services/task/TaskManager.ts`.
|
|
169
|
+
- **Acceptance:** B2/B3 pass for composition, timing, and Requires.
|
|
170
|
+
|
|
171
|
+
### MOD-005 — Agent ownership, event names, and response types
|
|
172
|
+
|
|
173
|
+
- **Canonical target:** `src/services/agent/ai-docs/agent-spec.md`
|
|
174
|
+
- **WHAT:**
|
|
175
|
+
- Remove `deviceUpdate` and `silentRelogin` from the routingAgent factory surface and operation list.
|
|
176
|
+
- Route device/profile updates to `ContactCenter.updateAgentProfile()` and relogin recovery to ContactCenter's private `silentRelogin()`.
|
|
177
|
+
- Use real `CC_EVENTS.AGENT_*` WebSocket event constants, including `CC_EVENTS.AGENT_STATION_LOGIN_SUCCESS`, instead of invented nested labels.
|
|
178
|
+
- Attribute public StationLogin/Logout/Buddy/SetState/UpdateDevice response aliases to `src/types.ts`; retain routing payload/event types in `src/services/agent/types.ts`.
|
|
179
|
+
- **WHY:** The agent spec currently assigns ContactCenter operations and public type ownership to the wrong module.
|
|
180
|
+
- **Evidence:** `src/services/agent/index.ts`, `src/services/agent/types.ts`, `src/types.ts`, `src/cc.ts`, `src/index.ts`.
|
|
181
|
+
- **Acceptance:** Agent B1/B3/B4/B5 findings are zero.
|
|
182
|
+
|
|
183
|
+
### MOD-006 — Config aggregation and real field names
|
|
184
|
+
|
|
185
|
+
- **Canonical target:** `src/services/config/ai-docs/config-spec.md`
|
|
186
|
+
- **WHAT:**
|
|
187
|
+
- Add `getAIFeatureFlags(orgId)`, endpoint `organization/{orgId}/v2/ai-feature?page=0&pageSize=100`, aggregation input `aiFeatureFlags`, and output `Profile.aiFeature` to all relevant flow, sequence, Provides, and profile tables.
|
|
188
|
+
- Reconcile the Promise aggregation counts after adding the AI-feature request.
|
|
189
|
+
- Replace `MultimediaProfile` with `MultimediaProfileResponse`.
|
|
190
|
+
- Replace `sensitiveDataMaskingEnabled` with `maskSensitiveData`.
|
|
191
|
+
- Remove the non-existent `TeamList.channelMap` claim.
|
|
192
|
+
- Document `desktopProfileFilter=true` in the list-aux-codes URL.
|
|
193
|
+
- **WHY:** These are current configuration contracts; omissions and wrong names make profile handling unsafe.
|
|
194
|
+
- **Evidence:** `src/services/config/index.ts`, `src/services/config/Util.ts`, `src/services/config/constants.ts`, `src/services/config/types.ts`.
|
|
195
|
+
- **Acceptance:** Config B2/B3/B4 findings are zero and diagrams/tables agree on request counts.
|
|
196
|
+
|
|
197
|
+
### MOD-007 — Task state machine actions, controls, and exports
|
|
198
|
+
|
|
199
|
+
- **Canonical target:** `src/services/task/state-machine/ai-docs/task-state-machine-spec.md`
|
|
200
|
+
- **WHAT:**
|
|
201
|
+
- Delete the false assertion that `forceConsultInitiator`, `handleConferenceFailed`, `handleSwitchToMainCall`, and `handleSwitchToConsult` are absent.
|
|
202
|
+
- Document all four from `actions.ts`; mark `forceConsultInitiator` as defined but not wired in the current graph, and document the other actions where the graph invokes them.
|
|
203
|
+
- Replace `computeVoiceUIControls`/`computeDigitalUIControls` with the private real functions `computeVoiceInteractionUIControls` and `computeDigitalInteractionUIControls`.
|
|
204
|
+
- Clarify that `getDefaultUIControls` is exported from `uiControlsComputer.ts` and re-exported from package root, but not from `state-machine/index.ts`.
|
|
205
|
+
- Document `syncTaskDataFromEvent` as an implementation supplied through Task's machine options rather than a default action in `actions.ts`.
|
|
206
|
+
- Mark `didInitiateConsult` as defined but currently unwired unless source wiring changes before application.
|
|
207
|
+
- **WHY:** The current spec inverts real action availability and invents control function names.
|
|
208
|
+
- **Evidence:** `src/services/task/state-machine/actions.ts`, `src/services/task/state-machine/TaskStateMachine.ts`, `src/services/task/state-machine/guards.ts`, `src/services/task/state-machine/uiControlsComputer.ts`, `src/services/task/state-machine/index.ts`, `src/services/task/Task.ts`, `src/index.ts`.
|
|
209
|
+
- **Acceptance:** BLK-9 and IMP-9 through IMP-11 pass without a source-code change.
|
|
210
|
+
|
|
211
|
+
### MOD-008 — Task signatures, event inventory, and factory ownership
|
|
212
|
+
|
|
213
|
+
- **Canonical target:** `src/services/task/ai-docs/task-spec.md`
|
|
214
|
+
- **WHAT:**
|
|
215
|
+
- Document concrete Task/Voice `hold()` and `resume()` implementations as parameterless while preserving the broader optional `mediaResourceId` shape only where `ITask` declares it.
|
|
216
|
+
- Move the `contact` constructor dependency from dialer prose to Task/TaskFactory ownership; do not claim `dialer.ts` has that constructor.
|
|
217
|
+
- Complete the `TASK_EVENTS` inventory from `src/services/task/types.ts`, including campaign, hydration, recording, conference, switching, cleanup, and failure events.
|
|
218
|
+
- State that TaskFactory creates only supported implemented media classes and throws `Unknown media type` for unsupported values such as SMS/Facebook/WhatsApp.
|
|
219
|
+
- Clarify base-versus-Voice optionality for `endConsult` where documented.
|
|
220
|
+
- **WHY:** Method and factory drift can cause invalid calls and incorrect media assumptions.
|
|
221
|
+
- **Evidence:** `src/services/task/Task.ts`, `src/services/task/voice/Voice.ts`, `src/services/task/types.ts`, `src/services/task/TaskFactory.ts`, `src/services/task/dialer.ts`.
|
|
222
|
+
- **Acceptance:** IMP-12 through IMP-14 and touched Medium signature/factory findings pass.
|
|
223
|
+
|
|
224
|
+
### MOD-009 — Metrics catalog, taxonomy, and disabled behavior
|
|
225
|
+
|
|
226
|
+
- **Canonical target:** `src/metrics/ai-docs/metrics-spec.md`
|
|
227
|
+
- **WHAT:**
|
|
228
|
+
- Reconcile the complete `METRIC_EVENT_NAMES` constant, including all AI Assistant transcript/suggestion events and other missing names.
|
|
229
|
+
- Explicitly distinguish defined metric names from names present in `eventTaxonomyMap`; record the six AI Assistant names as currently defined but lacking behavioral taxonomy entries.
|
|
230
|
+
- Document that `timeEvent()` returns immediately when metrics are disabled, matching all tracking methods.
|
|
231
|
+
- **WHY:** Operators and implementers need to know which telemetry names exist, which have taxonomy, and how the disable switch behaves.
|
|
232
|
+
- **Evidence:** `src/metrics/constants.ts`, `src/metrics/behavioral-events.ts`, `src/metrics/MetricsManager.ts`.
|
|
233
|
+
- **Acceptance:** IMP-15 through IMP-17 pass and catalog/taxonomy counts match code.
|
|
234
|
+
|
|
235
|
+
### MOD-010 — Utils ownership and re-export boundaries
|
|
236
|
+
|
|
237
|
+
- **Canonical target:** `src/utils/ai-docs/utils-spec.md`
|
|
238
|
+
- **WHAT:**
|
|
239
|
+
- Treat `src/utils/PageCache.ts` as the authoritative Utils implementation and pagination/cache contract source.
|
|
240
|
+
- Treat `src/types.ts` as a package-wide public type owner consumed by Utils and services, not a Utils implementation file.
|
|
241
|
+
- Treat AddressBook, EntryPoint, and Queue as Services-layer consumers of PageCache, not authoritative Utils implementations.
|
|
242
|
+
- Enumerate only actual PageCache exports and only package-root re-exports that exist in `src/index.ts`.
|
|
243
|
+
- Use `orgId` consistently in cache-key examples.
|
|
244
|
+
- **WHY:** Overstated ownership and re-exports cause changes in the wrong module and unsupported imports.
|
|
245
|
+
- **Evidence:** `src/utils/PageCache.ts`, `src/types.ts`, `src/index.ts`, `src/services/AddressBook.ts`, `src/services/EntryPoint.ts`, `src/services/Queue.ts`.
|
|
246
|
+
- **Acceptance:** IMP-18 and touched Medium ownership/example findings pass.
|
|
247
|
+
|
|
248
|
+
### MOD-011 — Cross-cutting requirement quality and evidence
|
|
249
|
+
|
|
250
|
+
- **Canonical targets:** all nine module specs touched above.
|
|
251
|
+
- **WHAT:** Replace boilerplate “preserve behavior because consumers depend on it” entries with module-specific WHAT, WHY, acceptance, and test/source evidence. Use stable file paths only. Remove redundant generic diagrams when a code-grounded diagram covers the same operation group.
|
|
252
|
+
- **WHY:** Requirements and evidence must guide implementation and validation rather than merely asserting preservation.
|
|
253
|
+
- **Evidence:** Owning source and test paths listed by MOD-001 through MOD-010.
|
|
254
|
+
- **Acceptance:** A1/A7/A12/A13/A14 pass on revalidation, with no generic-only primary flow and no line/range evidence suffix.
|
|
255
|
+
|
|
256
|
+
## Feasibility & Risks
|
|
257
|
+
|
|
258
|
+
- **Feasibility:** High. Every correction is documentation-only and has current local source evidence.
|
|
259
|
+
- **Spikes needed:** None.
|
|
260
|
+
|
|
261
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
262
|
+
|---|---|---|---|
|
|
263
|
+
| Correcting one claim introduces a new overstatement | medium | high | Reconcile each changed statement directly against current source and use independent revalidation |
|
|
264
|
+
| Protected-spec edits bypass review | low | high | Do not change canonical targets until this delta is explicitly approved |
|
|
265
|
+
| Source-fidelity inventory no longer matches generated canonical text | medium | high | Update correction dispositions/excerpts and rerun all inventories after application |
|
|
266
|
+
| Large event/metric tables remain incomplete | medium | medium | Generate inventories mechanically from owning enum/const objects, then review names against source |
|
|
267
|
+
| Documentation-only work accidentally changes runtime code | low | high | Enforce zero `src/` and `test/` diff guardrail |
|
|
268
|
+
|
|
269
|
+
## Interaction / Scenario Matrix
|
|
270
|
+
|
|
271
|
+
| Scenario / condition combination | Expected behavior | Covered by |
|
|
272
|
+
|---|---|---|
|
|
273
|
+
| READY callback before `register()` | Collaborators are documented as constructed at READY time; register only connects/subscribes | DRIFT-R-001 / MOD-001 / MOD-004 |
|
|
274
|
+
| ConnectionService emits `connectionLost` | ContactCenter owns policy and conditionally performs silent relogin | DRIFT-R-003 / MOD-001 / MOD-003 |
|
|
275
|
+
| AQM HTTP acknowledgement before WebSocket notification | Operation remains pending until matching notification or timeout/failure | DRIFT-R-002 / MOD-003 |
|
|
276
|
+
| Metrics disabled | Timing and tracking calls return without recording/submitting | DRIFT-R-006 / MOD-009 |
|
|
277
|
+
| State-machine action supplied by Task options | Spec distinguishes injected implementation from default action map | DRIFT-R-005 / MOD-007 |
|
|
278
|
+
| Unsupported task media type | Factory behavior is documented as throwing rather than claiming support | DRIFT-R-002 / MOD-008 |
|
|
279
|
+
|
|
280
|
+
## Documentation Obligations
|
|
281
|
+
|
|
282
|
+
- Apply the approved MOD-001 through MOD-011 corrections to the protected canonical targets.
|
|
283
|
+
- Update source-fidelity correction dispositions where migrated source text changes.
|
|
284
|
+
- Refresh generated-document conformance and coverage metadata.
|
|
285
|
+
- Request a second independent Claude `spec-validator` pass; do not self-validate on Codex.
|
|
286
|
+
|
|
287
|
+
## Spec State
|
|
288
|
+
|
|
289
|
+
| Section | State |
|
|
290
|
+
|---|---|
|
|
291
|
+
| Problem & Goal | complete |
|
|
292
|
+
| Stakeholders & Open Questions | complete |
|
|
293
|
+
| Scope | complete |
|
|
294
|
+
| Requirements | complete |
|
|
295
|
+
| Acceptance Criteria | complete |
|
|
296
|
+
| Success & Guardrail Metrics | complete |
|
|
297
|
+
| Prior-Work Register | complete |
|
|
298
|
+
| Contracts Delta | complete |
|
|
299
|
+
| Impacted Modules | complete |
|
|
300
|
+
| Conditional sections | complete for documentation-only drift correction |
|
|
301
|
+
|
|
302
|
+
## Change Log
|
|
303
|
+
|
|
304
|
+
| Date | Change | By | Why |
|
|
305
|
+
|---|---|---|---|
|
|
306
|
+
| 2026-07-07 | Initial protected-spec MODIFIED drift-fix delta drafted from independent validation and current source | Codex | Route validator findings through no-override review before canonical edits |
|
|
307
|
+
| 2026-07-07 | Developer approved and Codex applied MOD-001 through MOD-011 to canonical documentation | user + Codex | Resolve validator code-fidelity findings without runtime changes |
|
|
308
|
+
|
|
309
|
+
## References
|
|
310
|
+
|
|
311
|
+
- Package architecture: [`ARCHITECTURE.md`](../../../ARCHITECTURE.md)
|
|
312
|
+
- Module router: [`SPEC_INDEX.md`](../../../SPEC_INDEX.md)
|
|
313
|
+
- Contract catalog: [`CONTRACTS.md`](../../../CONTRACTS.md)
|
|
314
|
+
- Protected-target policy: `.sdd/manifest.json`
|
|
315
|
+
- Runtime evidence: `src/` and `test/`
|