@webex/internal-plugin-ediscovery 3.13.0-next.7 → 3.13.0-next.9

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.
@@ -0,0 +1,407 @@
1
+ {
2
+ "manifest_version": 1,
3
+ "repository": {
4
+ "name": "@webex/internal-plugin-ediscovery",
5
+ "purpose": "Internal Webex JS SDK plugin registered as webex.internal.ediscovery for first-party compliance clients. It creates, lists, reads, restarts, and deletes compliance reports on the eDiscovery service, reads the client config, posts the summary-download audit event, and pages report content and content containers by report UUID or remote report URL with an in-memory container cache. Payload transforms registered with webex-core encrypt report requests under a new KMS key before they are sent and decrypt report requests, activities, and containers on the way in, on behalf of each container's onBehalfOfUser, recording failures as error or warning properties instead of rejecting.",
6
+ "category": "cat2-legacy",
7
+ "primary_languages": [
8
+ "javascript"
9
+ ]
10
+ },
11
+ "topology": "Orchestrator-plus-components",
12
+ "commands": {
13
+ "install": {
14
+ "command": "yarn",
15
+ "source_file": "../../../.github/workflows/deploy.yml",
16
+ "role": "install"
17
+ },
18
+ "prebuild": {
19
+ "command": "yarn prebuild:modules",
20
+ "source_file": "../../../package.json",
21
+ "role": "other"
22
+ },
23
+ "compile": {
24
+ "command": "yarn workspace @webex/internal-plugin-ediscovery build:src",
25
+ "source_file": "package.json",
26
+ "role": "compile"
27
+ },
28
+ "build": {
29
+ "command": "yarn workspace @webex/internal-plugin-ediscovery build",
30
+ "source_file": "package.json",
31
+ "role": "package"
32
+ },
33
+ "unit-test": {
34
+ "command": "yarn workspace @webex/internal-plugin-ediscovery test:unit",
35
+ "source_file": "package.json",
36
+ "role": "unit-test"
37
+ },
38
+ "browser-test-broken": {
39
+ "command": "yarn workspace @webex/internal-plugin-ediscovery test:browser:broken",
40
+ "source_file": "package.json",
41
+ "role": "other"
42
+ },
43
+ "lint": {
44
+ "command": "yarn workspace @webex/internal-plugin-ediscovery test:style",
45
+ "source_file": "package.json",
46
+ "role": "lint"
47
+ },
48
+ "deploy": {
49
+ "command": "yarn workspace @webex/internal-plugin-ediscovery deploy:npm",
50
+ "source_file": "package.json",
51
+ "role": "deploy"
52
+ }
53
+ },
54
+ "toolchain": [
55
+ {
56
+ "name": "node",
57
+ "version": ">=18",
58
+ "origin": "repo-config",
59
+ "source_file": "package.json"
60
+ },
61
+ {
62
+ "name": "node",
63
+ "version": "22.14",
64
+ "origin": "repo-config",
65
+ "source_file": "../../../AGENTS.md"
66
+ },
67
+ {
68
+ "name": "node",
69
+ "version": "lts/jod",
70
+ "origin": "repo-config",
71
+ "source_file": "../../../.nvmrc"
72
+ },
73
+ {
74
+ "name": "node",
75
+ "version": "18.x",
76
+ "origin": "repo-config",
77
+ "source_file": "../../../package.json"
78
+ },
79
+ {
80
+ "name": "yarn",
81
+ "version": "3.4.1",
82
+ "origin": "repo-config",
83
+ "source_file": "../../../package.json"
84
+ },
85
+ {
86
+ "name": "babel",
87
+ "version": "^7.17.10",
88
+ "origin": "repo-config",
89
+ "source_file": "package.json"
90
+ },
91
+ {
92
+ "name": "eslint",
93
+ "version": "^8.24.0",
94
+ "origin": "repo-config",
95
+ "source_file": "package.json"
96
+ },
97
+ {
98
+ "name": "prettier",
99
+ "version": "^2.7.1",
100
+ "origin": "repo-config",
101
+ "source_file": "package.json"
102
+ },
103
+ {
104
+ "name": "sinon",
105
+ "version": "^9.2.4",
106
+ "origin": "repo-config",
107
+ "source_file": "package.json"
108
+ }
109
+ ],
110
+ "tests": {
111
+ "unit": {
112
+ "command_ref": "unit-test",
113
+ "dir": "test/unit/spec",
114
+ "framework": "jest"
115
+ }
116
+ },
117
+ "quality_gates": {
118
+ "code_coverage": {
119
+ "origin": "none",
120
+ "declared_by": "rarajes2@cisco.com via bootstrap questionnaire (generator check: test:unit runs webex-legacy-tools with --runner jest; jest.config.js re-exports @webex/jest-config-legacy, which sets collectCoverage false and no coverageThreshold; package.json defines no coverage script)"
121
+ }
122
+ },
123
+ "coverage_status_definitions": {
124
+ "specced": ">=80% public surface specced, drift <5% - spec is authoritative",
125
+ "partial": "40-80% specced - spec is a hint, cross-check code",
126
+ "untracked": "<40% specced - code is the source of truth"
127
+ },
128
+ "spec_source_policy": {
129
+ "mode": "keep-separate",
130
+ "migrated_source_disposition": "retain",
131
+ "disposition_decided_by": "rarajes2@cisco.com",
132
+ "disposition_decided_at": "2026-11-12T05:59:56Z",
133
+ "decided_by": "rarajes2@cisco.com",
134
+ "decided_at": "2026-11-12T05:59:56Z",
135
+ "decision_record": "docs/adr/0001-retain-product-readme.md"
136
+ },
137
+ "spec_sources": [],
138
+ "modules": [
139
+ {
140
+ "path": "src",
141
+ "canonical_spec": "src/docs/README.md",
142
+ "coverage_status": "Partial",
143
+ "coverage_evidence": "Field coverage 93.3% (14/15) assessed 2026-11-12 by the generator; critical field coverage 8/8. The one WEAK field is test strategy: 122 unit cases in test/unit/spec/report.js, content.js, and transforms.js pass under Node 22.14 after build:src, but registration and the seven payload predicates, the array transforms, decryptReportContentContainer, requestWithRetries, and the missing-container and lookup-failure branches of decryptReportContent have no case; the postAuditLog cases do not await their assertions; and test/integration/spec/ediscovery.js has no package script. Promoted Untracked to Partial on approval by rarajes2@cisco.com. Independent validation passed on 2026-11-12 with 0 Blocking findings and 0 warnings (validator runtime 01a1ce6b-d345-7220-b6b0-c125b776f5cc) after one Blocking contract-index finding in docs/architecture.md was corrected. Held at Partial because the test-strategy gap remains and no drift record or characterization baseline exists.",
144
+ "last_assessed": "2026-11-12",
145
+ "contracts": {
146
+ "provides": [
147
+ "ediscovery-sdk"
148
+ ],
149
+ "requires": [
150
+ "ediscovery-service-api",
151
+ "kms-keys",
152
+ "webex-core-plugin-host",
153
+ "webex-core-storage",
154
+ "webex-common-utilities",
155
+ "internal-plugin-encryption",
156
+ "internal-plugin-conversation-registration",
157
+ "lodash"
158
+ ]
159
+ },
160
+ "section_profile": {
161
+ "has_tiers": false,
162
+ "has_ui": false,
163
+ "crosses_service_boundaries": true,
164
+ "holds_client_state": true,
165
+ "enforces_domain_rules": true,
166
+ "is_concurrent_async": true,
167
+ "owns_persistence": false,
168
+ "stateful_transitions": false,
169
+ "exposes_wire_protocol": true,
170
+ "ui_multi_screen": false,
171
+ "large_data_model": false,
172
+ "returns_caller_errors": true,
173
+ "module_specific_conventions": true,
174
+ "published_package": true,
175
+ "embedded_in_host": false,
176
+ "has_design_tradeoff": true,
177
+ "resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
178
+ "resolved_at": "2026-11-12T05:59:56Z",
179
+ "has_submodules": false,
180
+ "has_submodules_computed_by": "scripts/module_tree.py",
181
+ "has_submodules_computed_at": "2026-11-12T05:59:56Z"
182
+ }
183
+ }
184
+ ],
185
+ "contract_catalog": {
186
+ "index_path": "docs/architecture.md",
187
+ "definitions": {
188
+ "ediscovery-sdk": {
189
+ "kind": "sdk",
190
+ "publication": "published",
191
+ "source_kind": "repository-path",
192
+ "source": "package.json",
193
+ "summary": "Published npm package (internal plugin). main is dist/index.js and devMain is src/index.js. Importing it imports @webex/internal-plugin-encryption and @webex/internal-plugin-conversation and registers EDiscovery as internal plugin 'ediscovery' with src/config.js and seven payload predicates and transforms that join the module-level webex config. Exports are the default EDiscovery class and the named ReportRequest, EdiscoveryError, InvalidEmailAddressError, and config (which resolves to undefined). The plugin API on webex.internal.ediscovery is createReport, getReport, getReports, deleteReport, restartReport, getContent, getContentContainer, getContentContainerByContainerId, getClientConfig, postAuditLog, clearCache, and the contentContainerCache session property. Per-method behavior is in src/docs/README.md."
194
+ },
195
+ "ediscovery-service-api": {
196
+ "kind": "http",
197
+ "publication": "internal",
198
+ "source_kind": "external",
199
+ "source": "eDiscovery service (reached as service name 'ediscovery' through the services catalog, or by a caller-supplied report URL; route definitions are not in this repository)",
200
+ "summary": "POST reports with the encrypted report request; GET reports (qs offset, size); GET, PUT, DELETE reports/<id>; GET reports/clientconfig; POST reports/<id>/audit/summary-download; GET <report>/contents and <report>/contents/container (qs offset, size); GET <report>/contents/container/<id>. Error code 14400001 carries a JSON array of unknown emails in body.message."
201
+ },
202
+ "kms-keys": {
203
+ "kind": "sdk",
204
+ "publication": "internal",
205
+ "source_kind": "external",
206
+ "source": "KMS reached through @webex/internal-plugin-encryption (no module spec; code consulted: packages/@webex/internal-plugin-encryption/src/encryption.js and src/kms.js)",
207
+ "summary": "kms.createUnboundKeys({count: 1}) and kms.createResource({userIds, keys}) for report requests; encryptText(key, text); decryptText(keyUri, ciphertext, {onBehalfOf}) and decryptScr(keyUri, scr, {onBehalfOf}) for reports, activities, and containers. Failures with statusCode 429, 502, 503, or 504 are retried by src/retry.js."
208
+ },
209
+ "webex-core-plugin-host": {
210
+ "kind": "sdk",
211
+ "publication": "published",
212
+ "source_kind": "external",
213
+ "source": "@webex/webex-core (workspace package; module specs consulted: packages/@webex/webex-core/src/docs/README.md and src/interceptors/docs/README.md)",
214
+ "summary": "EDiscovery extends WebexPlugin in namespace EDiscovery, so this.config is webex.config.ediscovery; registerInternalPlugin merges the config and concatenates the payloadTransformer predicates and transforms into the module-level default config; webex.transform runs every matched predicate's transform with only the extracted object, and the payload-transformer interceptor applies outbound transforms to request options and inbound transforms to responses and error reasons."
215
+ },
216
+ "webex-core-storage": {
217
+ "kind": "sdk",
218
+ "publication": "published",
219
+ "source_kind": "external",
220
+ "source": "@webex/webex-core storage (module spec consulted: packages/@webex/webex-core/src/lib/storage/docs/README.md)",
221
+ "summary": "@waitForValue('@') makes each decorated request method return a promise that runs after the plugin store loads."
222
+ },
223
+ "webex-common-utilities": {
224
+ "kind": "sdk",
225
+ "publication": "published",
226
+ "source_kind": "external",
227
+ "source": "@webex/common (workspace package; module spec consulted: packages/@webex/common/src/docs/README.md)",
228
+ "summary": "oneFlight with keyFactory on getContent, getContentContainer, and getContentContainerByContainerId; Exception as the base of EdiscoveryError, whose message comes from the first constructor argument."
229
+ },
230
+ "internal-plugin-encryption": {
231
+ "kind": "sdk",
232
+ "publication": "published",
233
+ "source_kind": "external",
234
+ "source": "@webex/internal-plugin-encryption (workspace package; no module spec; code consulted: packages/@webex/internal-plugin-encryption/src/index.js)",
235
+ "summary": "Imported by src/index.js to register internal plugin 'encryption', which every transform reaches as ctx.webex.internal.encryption."
236
+ },
237
+ "internal-plugin-conversation-registration": {
238
+ "kind": "sdk",
239
+ "publication": "published",
240
+ "source_kind": "external",
241
+ "source": "@webex/internal-plugin-conversation (workspace package; no module spec; code consulted: packages/@webex/internal-plugin-conversation/src/index.js)",
242
+ "summary": "Imported by src/index.js only for its side effect of registering internal plugin 'conversation'; nothing in src calls it."
243
+ },
244
+ "lodash": {
245
+ "kind": "sdk",
246
+ "publication": "published",
247
+ "source_kind": "external",
248
+ "source": "lodash@^4.17.21 (npm)",
249
+ "summary": "has(object, path) tests the payload predicates."
250
+ }
251
+ }
252
+ },
253
+ "spec_policy": {
254
+ "require_what_and_why": true,
255
+ "require_provenance": true,
256
+ "protected_specs": [
257
+ "src/docs/README.md"
258
+ ]
259
+ },
260
+ "validation": {
261
+ "generator_runtime": "claude-code",
262
+ "generator_model": "claude-opus-5-5",
263
+ "generator_runtime_source": "host-metadata",
264
+ "validator_runtime": "01a1ce6b-d345-7220-b6b0-c125b776f5cc",
265
+ "validator_runtime_source": "invocation-input",
266
+ "runtime_fallback_tier": "different-runtime",
267
+ "source_commit": "ecd5af12a1abf47fc6ed7dd72cb308b259d45fb8",
268
+ "minimum_independence": "different-runtime",
269
+ "blocking_severities": [
270
+ "Blocking"
271
+ ]
272
+ },
273
+ "layout": {
274
+ "sdd_root": ".sdd",
275
+ "docs_root": "docs",
276
+ "agent_entry_path": "AGENTS.md",
277
+ "standing_docs_root": "docs",
278
+ "spec_index_path": "docs/specs/README.md",
279
+ "module_docs_strategy": "source-local",
280
+ "module_docs_relative_path": "docs/README.md",
281
+ "module_docs_decision": {
282
+ "basis": "repo-standards-default",
283
+ "reason": "No module-local documentation existed. The source-local default gives src/docs/README.md. test:style runs eslint ./src/**/*.*, and the shared @webex/eslint-config-legacy ignore patterns exclude docs/** and *.md; build:src processes -js -ts only, so Markdown under src/ does not enter the build output.",
284
+ "decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
285
+ "decided_at": "2026-11-12T05:59:56Z"
286
+ },
287
+ "repo_context_decision": {
288
+ "path": ".repo-context.json",
289
+ "schema_path": "schemas/repo-context.schema.json",
290
+ "action": "create",
291
+ "schema_action": "create",
292
+ "reason": "Neither the operational context nor its schema existed in this package. The context is created from package evidence and the schema is copied from the repository-root .sdd/templates/repo-standards/schemas/repo-context.schema.json.",
293
+ "decided_by": "rarajes2@cisco.com (bootstrap questionnaire)",
294
+ "decided_at": "2026-11-12T05:59:56Z"
295
+ },
296
+ "artifact_decisions": [
297
+ {
298
+ "path": "docs/service.md",
299
+ "action": "omit",
300
+ "reason": "Library package, not a deployable service. package.json has no start script, container, or deployment descriptor.",
301
+ "decided_by": "claude-code (code evidence)",
302
+ "decided_at": "2026-11-12T05:59:56Z"
303
+ },
304
+ {
305
+ "path": "mkdocs.yml",
306
+ "action": "omit",
307
+ "reason": "No package-level documentation site exists. Documentation publishing stays with the workspace.",
308
+ "decided_by": "claude-code (code evidence)",
309
+ "decided_at": "2026-11-12T05:59:56Z"
310
+ },
311
+ {
312
+ "path": "api-specs/openapi.yaml",
313
+ "action": "omit",
314
+ "reason": "The package serves no HTTP routes. It is an HTTP client library; its published surface is the npm export described by ediscovery-sdk.",
315
+ "decided_by": "claude-code (code evidence)",
316
+ "decided_at": "2026-11-12T05:59:56Z"
317
+ },
318
+ {
319
+ "path": "SECURITY.md",
320
+ "action": "omit",
321
+ "reason": "No package-level security policy exists. The workspace owns security policy, and a per-package copy would duplicate it; security architecture is described in docs/architecture.md.",
322
+ "decided_by": "claude-code (code evidence)",
323
+ "decided_at": "2026-11-12T05:59:56Z"
324
+ },
325
+ {
326
+ "path": "CONTRIBUTING.md",
327
+ "action": "omit",
328
+ "reason": "Contribution instructions are owned at the workspace root CONTRIBUTING.md.",
329
+ "decided_by": "claude-code (code evidence)",
330
+ "decided_at": "2026-11-12T05:59:56Z"
331
+ },
332
+ {
333
+ "path": "CHANGELOG.md",
334
+ "action": "omit",
335
+ "reason": "Changelog generation is owned at the workspace root. This package has no changelog file.",
336
+ "decided_by": "claude-code (code evidence)",
337
+ "decided_at": "2026-11-12T05:59:56Z"
338
+ },
339
+ {
340
+ "path": "CTO_CHECKLIST.yml",
341
+ "action": "omit",
342
+ "reason": "The CTO readiness checklist applies to deployable services. This package is a library.",
343
+ "decided_by": "claude-code (code evidence)",
344
+ "decided_at": "2026-11-12T05:59:56Z"
345
+ },
346
+ {
347
+ "path": "schemas/cto-checklist.schema.json",
348
+ "action": "omit",
349
+ "reason": "Omitted together with CTO_CHECKLIST.yml.",
350
+ "decided_by": "claude-code (code evidence)",
351
+ "decided_at": "2026-11-12T05:59:56Z"
352
+ }
353
+ ],
354
+ "template_roots": {
355
+ "canonical": ".sdd/templates/repo-standards"
356
+ },
357
+ "contract_index_path": "docs/architecture.md",
358
+ "repo_skills_root": ".sdd/skills",
359
+ "monorepo_package": {
360
+ "package_path": "packages/@webex/internal-plugin-ediscovery",
361
+ "root_manifest_path": "../../../.sdd/manifest.json",
362
+ "templates_root_path": "../../../.sdd/templates/repo-standards"
363
+ }
364
+ },
365
+ "tooling": {
366
+ "sdlc_skills": {
367
+ "source_ref": "repo-annotation@2.3.1"
368
+ }
369
+ },
370
+ "coverage_ratchet": {
371
+ "enabled": true,
372
+ "waivers": []
373
+ },
374
+ "substrate": {
375
+ "source": "WebexTools/repo-standards@d89a7fe59126ae3ad9bac9ca352aa7f12b4c85dc",
376
+ "consumed": [
377
+ "@webex/eslint-config-legacy via .eslintrc.js",
378
+ "@webex/babel-config-legacy via babel.config.js",
379
+ "@webex/jest-config-legacy via jest.config.js",
380
+ "@webex/legacy-tools build and test runner via package.json",
381
+ "package README.md (context only)",
382
+ "Repo Standards templates at the monorepo root .sdd/templates/repo-standards, referred to through layout.monorepo_package.templates_root_path (this package holds no templates)"
383
+ ],
384
+ "compliance_tier": "baseline"
385
+ },
386
+ "section_profiles": {
387
+ "repo": {
388
+ "owns_datastore": false,
389
+ "holds_client_state": true,
390
+ "components_interact": true,
391
+ "domain_data_across_components": true,
392
+ "caches_data": true,
393
+ "observability_convention": true,
394
+ "deploys_to_infra": false,
395
+ "shared_base_libs": true,
396
+ "is_monorepo": false,
397
+ "multi_platform": false,
398
+ "published_package": true,
399
+ "embedded_in_host": false,
400
+ "cross_repo_deps_material": true,
401
+ "security_arch_warranted": true,
402
+ "exposes_commands_or_artifacts": true
403
+ },
404
+ "resolved_by": "claude-code (code evidence; bootstrap questionnaire)",
405
+ "resolved_at": "2026-11-12T05:59:56Z"
406
+ }
407
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,211 @@
1
+ <!-- sdd-generated-metadata
2
+ doc_kind: agent-entry
3
+ generated_from: agents@0.3.0
4
+ generated_by: claude-code
5
+ approved_by: rarajes2@cisco.com
6
+ updated_at: 2026-11-12T06:44:53Z
7
+ validation_status: pass
8
+ -->
9
+
10
+ # AI Agent Instructions
11
+
12
+ Package-scoped SDD entry for `@webex/internal-plugin-ediscovery`, the internal `ediscovery` plugin of
13
+ the SDK (compliance report calls, report content and container reads, and the payload transforms that
14
+ encrypt report requests and decrypt reports, activities, and containers). This file orients agents. The
15
+ monorepo root `AGENTS.md` governs workspace-wide setup.
16
+
17
+ ## Working Method
18
+
19
+ - Read the relevant package files before editing. Do not edit blind.
20
+ - Understand the task and affected surfaces before writing code.
21
+ - Prefer focused edits over rewriting whole files.
22
+ - Do not invent commands, paths, exports, or config keys. Verify them from this package's source and
23
+ tests.
24
+ - Test or validate before declaring done.
25
+ - Keep output concise. If something is uncertain, say so instead of guessing.
26
+
27
+ ## Canonical Repository Documentation
28
+
29
+ Before changing code or documentation, start with:
30
+
31
+ - [`docs/index.md`](docs/index.md) for package documentation navigation;
32
+ - [`docs/architecture.md`](docs/architecture.md) for package boundaries and interactions;
33
+ - [`docs/specs/README.md`](docs/specs/README.md) for the manifest-backed module and contract registry;
34
+ - the module specification at [`src/docs/README.md`](src/docs/README.md) (eDiscovery plugin); and
35
+ - [`docs/adr/index.md`](docs/adr/index.md) plus applicable concrete ADRs.
36
+
37
+ Follow `.sdd/manifest.json` for each contract's publication state and canonical source. This package
38
+ publishes an SDK surface, so its contract artifact is `package.json` plus the `src/index.js` entry. It
39
+ serves no HTTP, so no OpenAPI applies.
40
+
41
+ ## 1. Commands (Run First)
42
+
43
+ Use only documented commands. Do not invent alternatives when a command is missing. Run workspace
44
+ commands from the monorepo root.
45
+
46
+ | Task | Command |
47
+ | ---------------------- | ------- |
48
+ | Install dependencies | `yarn` (workspace root; the deploy workflow runs the same command); on a fresh checkout run `yarn prebuild:modules` once, because `yarn` does not build `@webex/legacy-tools` or sibling `dist/` |
49
+ | Start dev environment | N/A — library package with no start script in `package.json` |
50
+ | Run tests | `yarn workspace @webex/internal-plugin-ediscovery test:unit` (jest) after `build:src` |
51
+ | Run linters | `yarn workspace @webex/internal-plugin-ediscovery test:style` |
52
+ | Build/release artifact | `yarn workspace @webex/internal-plugin-ediscovery build` (runs `build:src`) |
53
+ | Format code | N/A — no format script; `prettier` is a devDependency used through eslint |
54
+
55
+ No package script runs `test/integration/spec/ediscovery.js`; it needs a compliance test user and the
56
+ live eDiscovery service. `test:browser:broken` runs karma over the same live-service spec and is named
57
+ broken; it is not a routine verification command. The aggregate `test` chains `test:integration` and
58
+ `test:browser`, which this package does not define, so it fails after the unit run.
59
+
60
+ If a required command is unknown, stop and ask for the exact command.
61
+
62
+ ## 2. Agent Persona and Scope
63
+
64
+ You are the Webex JS SDK engineering assistant for `@webex/internal-plugin-ediscovery`.
65
+
66
+ Primary outcomes:
67
+
68
+ - Deliver production-safe changes with unit tests and lint passing.
69
+ - Preserve existing behavior unless a change request explicitly requires a behavior change.
70
+ - Keep docs and configuration aligned with code changes.
71
+
72
+ Definition of done:
73
+
74
+ 1. Requested change is implemented.
75
+ 2. Relevant tests, lint, and build checks pass locally.
76
+ 3. Updated docs cover new behavior, including the owning module spec.
77
+ 4. PR summary includes risks and rollback notes.
78
+
79
+ ## 3. Repository Knowledge
80
+
81
+ ### Tech Stack
82
+
83
+ | Area | Tooling | Version |
84
+ | ---------------- | ------- | ------- |
85
+ | Language runtime | node; JavaScript sources | 22.14 (workspace root `AGENTS.md`; `.nvmrc` `lts/jod`); package `engines` accepts `>=18`; the workspace root `package.json` `engines.node` reads `18.x` |
86
+ | Build tool | yarn workspaces and `@webex/legacy-tools` over babel | yarn `3.4.1` (root `packageManager`), `@babel/core` `^7.17.10` |
87
+ | Test framework | jest via `webex-legacy-tools` (`test:unit`); chai, sinon, and `@webex/test-helper-mock-webex` | sinon `^9.2.4` |
88
+ | Lint/format | eslint via `@webex/eslint-config-legacy`, prettier | eslint `^8.24.0`, prettier `^2.7.1` |
89
+
90
+ ### Project Map
91
+
92
+ - `src/index.js`: imports the encryption and conversation plugins, registers internal plugin
93
+ `ediscovery` with its config and seven payload predicates and transforms, and re-exports the public
94
+ bindings.
95
+ - `src/ediscovery.js`: the `EDiscovery` plugin and its container cache. Spec: `src/docs/README.md`.
96
+ - `src/transforms.js`: report-request encryption and report, activity, and container decryption.
97
+ - `src/retry.js`: the retry helper used by every decryption call.
98
+ - `src/report-request.js`, `src/ediscovery-error.js`, `src/config.js`: `ReportRequest`, the error
99
+ classes, and the default options.
100
+ - `test/unit/spec/report.js`, `test/unit/spec/content.js`, `test/unit/spec/transforms.js`: unit specs
101
+ run by `test:unit` (122 cases); they import the package by name, which loads `dist/`.
102
+ - `test/integration/spec/ediscovery.js`: live-service cases with no package script.
103
+ - `process`: package-root module exporting `{browser: true}`; not imported by `src/`.
104
+ - `dist/`: generated build output. Never edit by hand.
105
+ - `README.md`: retained npm page, context only. It is not the behavioral authority; see
106
+ [ADR-0001](docs/adr/0001-retain-product-readme.md).
107
+
108
+ ### Critical Constraints
109
+
110
+ - The payload predicates in `src/index.js` match by field name on every request and response of the
111
+ webex instance. A new predicate on a generic field transforms other plugins' payloads too.
112
+ - Decryption failures must stay on the payload as `error` or `warning`; the consuming downloader relies
113
+ on them, and the response must still resolve.
114
+ - Activity decryption looks containers up through `getContentContainerByContainerId`, which reads the
115
+ container cache first; keep that path.
116
+ - Content is decrypted on behalf of the container's `onBehalfOfUser`; `encryptedTextKeyValues` is not.
117
+ - `createReport` must keep mapping service error code 14400001 to `InvalidEmailAddressError`.
118
+ - Every paging option must stay in the `oneFlight` keys of the content methods.
119
+ - `reportId` may be a UUID or a report URL on the three content methods; keep both forms.
120
+
121
+ ## 4. Testing Workflow
122
+
123
+ Run checks in this order:
124
+
125
+ 1. `yarn workspace @webex/internal-plugin-ediscovery build:src`
126
+ 2. `yarn workspace @webex/internal-plugin-ediscovery test:unit`
127
+ 3. `yarn workspace @webex/internal-plugin-ediscovery test:style`
128
+
129
+ Step 1 matters: the unit specs import `@webex/internal-plugin-ediscovery` by name, which resolves `main`
130
+ (`dist/index.js`), so a stale `dist/` makes results meaningless.
131
+
132
+ Step 3 does not lint `src/ediscovery.js`: the shared `@webex/eslint-config-legacy` ignore list names
133
+ every `ediscovery.js` (its "Files with decorator" entries), and `src/index.js` disables every rule at its
134
+ top. Review both files by hand.
135
+
136
+ Testing rules:
137
+
138
+ - Add or update unit cases for every behavior change. Registration, the array transforms, container
139
+ decryption, and `requestWithRetries` have no unit case today.
140
+ - Return or await every promise in a case; the `postAuditLog` cases do not, so their assertions never
141
+ run.
142
+ - Cover failure paths and edge cases, not only happy paths.
143
+ - Do not remove tests to make CI pass.
144
+ - Use `sinon.useFakeTimers()` when a case depends on time, such as retry delays.
145
+
146
+ No coverage gate applies to this package; do not infer one.
147
+
148
+ ## 5. Code Style and Patterns
149
+
150
+ Coding expectations:
151
+
152
+ - Follow repository style rules and static analysis output. The local `.eslintrc.js` sets `root: true`.
153
+ - Prefer small functions over large procedural blocks.
154
+ - Make error handling explicit: request methods reject; transforms annotate the payload and resolve.
155
+ - Keep public interfaces stable unless a breaking change is requested.
156
+
157
+ Pattern example:
158
+
159
+ ```text
160
+ Preferred:
161
+ - Wrap a new decryption in requestWithRetries with {onBehalfOf: container.onBehalfOfUser}.
162
+ - On a decryption failure, log with ctx.webex.logger and set activity.error (or warning for data loss).
163
+ - Add a case next to the matching describe block in test/unit/spec/transforms.js or content.js.
164
+
165
+ Avoid:
166
+ - Rejecting an inbound transform because one field failed.
167
+ - Adding a predicate on a field name other plugins also use.
168
+ - Treating README.md as the method list or as the way to run tests.
169
+ ```
170
+
171
+ ## 6. Git Workflow
172
+
173
+ - Branch naming: no package convention is defined; follow the workspace `CONTRIBUTING.md`.
174
+ - Commit format: conventional commits (`feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`), which
175
+ the workspace `CONTRIBUTING.md` requires for pull requests.
176
+ - Keep commits focused and reversible.
177
+ - Rebase on the target branch before opening a pull request.
178
+
179
+ PR checklist:
180
+
181
+ - What changed and why.
182
+ - Tests run and results.
183
+ - Risk and impact on report creation, content download, decryption annotations, and the container cache.
184
+ - Rollback approach.
185
+
186
+ ## 7. Boundaries and Escalation
187
+
188
+ ### Always
189
+
190
+ - Prefer existing patterns over introducing new architecture.
191
+ - Keep changes minimal for the requested scope.
192
+ - Call out assumptions and unknowns explicitly.
193
+ - Update the owning module spec in the same change that alters observable behavior.
194
+
195
+ ### Ask First
196
+
197
+ - Adding dependencies.
198
+ - Adding, removing, or renaming a payload predicate or transform.
199
+ - Changing which report-request fields are encrypted, or sending another field in plaintext.
200
+ - Changing the retry statuses, counts, or delays.
201
+ - Bounding or changing the lifetime of the container cache.
202
+ - Changing the registered plugin name or the decorator order.
203
+
204
+ ### Never
205
+
206
+ - Edit `dist/` by hand.
207
+ - Commit secrets, tokens, KMS keys, or decrypted compliance content, including in test fixtures.
208
+ - Log decrypted content, report search terms, or tokens.
209
+ - Add a `.sdd/templates` directory, a copy of the templates, or a link to them in this package. The
210
+ templates live once at the monorepo root, `../../../.sdd/templates/repo-standards`, and
211
+ `.sdd/manifest.json` refers to them through `layout.monorepo_package`.
@@ -593,7 +593,7 @@ var EDiscovery = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForVal
593
593
  }, _callee0);
594
594
  }))();
595
595
  },
596
- version: "3.13.0-next.7"
596
+ version: "3.13.0-next.9"
597
597
  }, (0, _applyDecoratedDescriptor2.default)(_obj, "createReport", [_dec], (0, _getOwnPropertyDescriptor.default)(_obj, "createReport"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "getReport", [_dec2], (0, _getOwnPropertyDescriptor.default)(_obj, "getReport"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "getReports", [_dec3], (0, _getOwnPropertyDescriptor.default)(_obj, "getReports"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "deleteReport", [_dec4], (0, _getOwnPropertyDescriptor.default)(_obj, "deleteReport"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "restartReport", [_dec5], (0, _getOwnPropertyDescriptor.default)(_obj, "restartReport"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "getContent", [_dec6, _dec7], (0, _getOwnPropertyDescriptor.default)(_obj, "getContent"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "getContentContainer", [_dec8, _dec9], (0, _getOwnPropertyDescriptor.default)(_obj, "getContentContainer"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "getContentContainerByContainerId", [_dec0, _dec1], (0, _getOwnPropertyDescriptor.default)(_obj, "getContentContainerByContainerId"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "getClientConfig", [_dec10], (0, _getOwnPropertyDescriptor.default)(_obj, "getClientConfig"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "postAuditLog", [_dec11], (0, _getOwnPropertyDescriptor.default)(_obj, "postAuditLog"), _obj), _obj));
598
598
  var _default2 = exports.default = EDiscovery;
599
599
  //# sourceMappingURL=ediscovery.js.map