@webex/storage-adapter-local-storage 3.13.0-next.3 → 3.13.0-next.5

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,415 @@
1
+ {
2
+ "manifest_version": 1,
3
+ "repository": {
4
+ "name": "@webex/storage-adapter-local-storage",
5
+ "purpose": "Browser localStorage-backed bounded storage adapter for the Webex SDK webex-core storage layer.",
6
+ "category": "cat2-legacy",
7
+ "primary_languages": [
8
+ "JavaScript"
9
+ ]
10
+ },
11
+ "topology": "Orchestrator-plus-components",
12
+ "commands": {
13
+ "compile": "[NEEDS HUMAN INPUT] -- The package has no standalone compile step; `build:src` transpiles and emits in one operation via webex-legacy-tools, and package.json declares no separate compile script.",
14
+ "build": {
15
+ "command": "yarn workspace @webex/storage-adapter-local-storage build:src",
16
+ "source_file": "package.json",
17
+ "role": "package",
18
+ "verified_at": "2026-11-09T10:45:00Z"
19
+ },
20
+ "unit-test": {
21
+ "command": "yarn workspace @webex/storage-adapter-local-storage test:unit",
22
+ "source_file": "package.json",
23
+ "role": "unit-test",
24
+ "verified_at": "2026-11-09T10:45:00Z"
25
+ },
26
+ "browser-test": {
27
+ "command": "yarn workspace @webex/storage-adapter-local-storage test:browser",
28
+ "source_file": "package.json",
29
+ "role": "other",
30
+ "verified_at": "2026-11-09T10:45:00Z"
31
+ },
32
+ "lint": {
33
+ "command": "yarn workspace @webex/storage-adapter-local-storage test:style",
34
+ "source_file": "package.json",
35
+ "role": "lint",
36
+ "verified_at": "2026-11-09T10:45:00Z"
37
+ },
38
+ "test": {
39
+ "command": "yarn workspace @webex/storage-adapter-local-storage test",
40
+ "source_file": "package.json",
41
+ "role": "other",
42
+ "verified_at": "2026-11-09T10:45:00Z"
43
+ },
44
+ "publish": {
45
+ "command": "yarn workspace @webex/storage-adapter-local-storage deploy:npm",
46
+ "source_file": "package.json",
47
+ "role": "other"
48
+ },
49
+ "install": {
50
+ "command": "yarn install",
51
+ "source_file": "../../../package.json",
52
+ "role": "install",
53
+ "verified_at": "2026-10-04T00:00:00Z"
54
+ },
55
+ "clone": {
56
+ "command": "git clone https://github.com/webex/webex-js-sdk.git",
57
+ "source_file": "package.json",
58
+ "role": "other",
59
+ "verified_at": "2026-11-09T10:45:00Z"
60
+ }
61
+ },
62
+ "toolchain": [
63
+ {
64
+ "name": "node",
65
+ "version": ">=18",
66
+ "origin": "repo-config",
67
+ "source_file": "package.json"
68
+ },
69
+ {
70
+ "name": "yarn",
71
+ "version": "3.4.1",
72
+ "origin": "repo-config",
73
+ "source_file": "../../../package.json"
74
+ }
75
+ ],
76
+ "tests": {
77
+ "unit": {
78
+ "command_ref": "unit-test",
79
+ "dir": "test/unit/spec",
80
+ "framework": "jest via @webex/jest-config-legacy, executing the mocha-authored abstract suite from @webex/storage-adapter-spec"
81
+ }
82
+ },
83
+ "quality_gates": {
84
+ "code_coverage": {
85
+ "origin": "none",
86
+ "declared_by": "rsarika@cisco.com"
87
+ }
88
+ },
89
+ "coverage_status_definitions": {
90
+ "specced": ">=80% public surface specced, drift <5% — spec is authoritative",
91
+ "partial": "40-80% specced — spec is a hint, cross-check code",
92
+ "untracked": "<40% specced — code is the source of truth"
93
+ },
94
+ "modules": [
95
+ {
96
+ "path": "src",
97
+ "coverage_status": "Partial",
98
+ "coverage_evidence": "Field coverage measured 2026-11-09 at 96% (26 of 27 mandatory fields PRESENT, every critical field PRESENT). The one WEAK field is test and characterization coverage: neither of this package's own test routes executes a case (test:unit skips all 21 declared cases under Node; test:browser completes 0 tests and exits 1 because the shared suite calls the Jest beforeAll global under mocha), and no characterization baseline is committed, so a characterization baseline is required before any risky modification. Status stays Partial: Partial to Specced needs a clean drift record across the PRs that next touch the module, and independent validation of this revision has not run.",
99
+ "canonical_spec": "src/docs/README.md",
100
+ "last_assessed": "2026-11-09",
101
+ "contracts": {
102
+ "provides": [
103
+ "storage-adapter-local-storage-sdk",
104
+ "local-storage-bounded-document"
105
+ ],
106
+ "requires": [
107
+ "webex-core-store-adapter-interface"
108
+ ]
109
+ },
110
+ "section_profile": {
111
+ "has_ui": false,
112
+ "crosses_service_boundaries": false,
113
+ "enforces_domain_rules": true,
114
+ "is_concurrent_async": true,
115
+ "owns_persistence": true,
116
+ "returns_caller_errors": true,
117
+ "has_design_tradeoff": true,
118
+ "stateful_transitions": false,
119
+ "exposes_wire_protocol": false,
120
+ "ui_multi_screen": false,
121
+ "large_data_model": false,
122
+ "has_tiers": false,
123
+ "module_specific_conventions": true,
124
+ "published_package": true,
125
+ "embedded_in_host": true,
126
+ "holds_client_state": false,
127
+ "has_submodules": false,
128
+ "has_submodules_computed_by": "scripts/module_tree.py",
129
+ "has_submodules_computed_at": "2026-11-09T10:17:40Z",
130
+ "resolved_by": "rsarika@cisco.com (confirmed against code by claude-code)",
131
+ "resolved_at": "2026-11-09T10:45:00Z"
132
+ },
133
+ "source_policy": {
134
+ "mode": "reconcile",
135
+ "existing_sources": [
136
+ "src/docs/README.md"
137
+ ],
138
+ "conflict_status": "resolved",
139
+ "decision_record": "Reconciled in place: the existing module spec is the canonical overlap. Owner answers on 2026-11-09 resolved the three open items (clear() full-basekey purge intent, cross-release readability of the at-rest document, and the parameterless clear() contract); no unresolved conflict remains."
140
+ }
141
+ }
142
+ ],
143
+ "contract_catalog": {
144
+ "index_path": "docs/architecture.md",
145
+ "definitions": {
146
+ "storage-adapter-local-storage-sdk": {
147
+ "kind": "sdk",
148
+ "publication": "published",
149
+ "source_kind": "repository-path",
150
+ "source": "package.json",
151
+ "summary": "Published npm package @webex/storage-adapter-local-storage. Its ecosystem-native declaration is package.json (main dist/index.js, devMain src/index.js); the implementation is src/index.js, which default-exports the StorageAdapterLocalStorage class. The constructor takes a basekey and bind(namespace, options) resolves a bound store exposing get, put, del, and clear. The package ships no .d.ts or API report, so package.json is the only machine-readable declaration."
152
+ },
153
+ "local-storage-bounded-document": {
154
+ "kind": "file",
155
+ "publication": "internal",
156
+ "source_kind": "repository-path",
157
+ "source": "src/index.js",
158
+ "summary": "At-rest JSON document written to localStorage under the constructor basekey, shaped {namespace: {key: value}}. Read by _getRawData/_load and written by _save. Owner-confirmed compatibility promise: a newer release must read a document written by an older one, so a layout or encoding change needs a migration and is breaking. The code carries no version field, no migration step, and no schema validation."
159
+ },
160
+ "webex-core-store-adapter-interface": {
161
+ "kind": "sdk",
162
+ "publication": "internal",
163
+ "source_kind": "external",
164
+ "source": "packages/@webex/webex-core/src/lib/storage/make-webex-store.js",
165
+ "summary": "The storage-adapter interface the webex-core storage layer calls. WebexStore._getBinding invokes adapter.bind(namespace, {logger}) and then calls get, put, del, and clear on the resolved binding. Owned by @webex/webex-core, outside this SDD root."
166
+ }
167
+ }
168
+ },
169
+ "spec_source_policy": {
170
+ "mode": "reconcile",
171
+ "migrated_source_disposition": "retain",
172
+ "disposition_decided_by": "rsarika@cisco.com",
173
+ "disposition_decided_at": "2026-11-09T10:45:00Z",
174
+ "decided_by": "rsarika@cisco.com",
175
+ "decided_at": "2026-11-09T09:40:00Z",
176
+ "decision_record": "The package already carried SDD docs at every canonical path. The owner chose reconcile: each existing doc is an in-place canonical overlap compared against current code, keeping code-supported content, correcting it from code where it drifted, and recording conflicts. README.md stays reference-only context and is not edited. No routed source is a deletion candidate, so the disposition is retain."
177
+ },
178
+ "spec_sources": [
179
+ {
180
+ "path": "AGENTS.md",
181
+ "scope": "repo",
182
+ "role": "source-material",
183
+ "canonical": true,
184
+ "use_by_agents": "source-for-reconciliation",
185
+ "canonical_target": "AGENTS.md",
186
+ "post_migration_action": "retain",
187
+ "deletion_status": "not-applicable",
188
+ "notes": "Canonical overlap: Package agent entry, reconciled in place. Never a deletion candidate."
189
+ },
190
+ {
191
+ "path": "docs/index.md",
192
+ "scope": "repo",
193
+ "role": "source-material",
194
+ "canonical": true,
195
+ "use_by_agents": "source-for-reconciliation",
196
+ "canonical_target": "docs/index.md",
197
+ "post_migration_action": "retain",
198
+ "deletion_status": "not-applicable",
199
+ "notes": "Canonical overlap: Package documentation index, reconciled in place. Never a deletion candidate."
200
+ },
201
+ {
202
+ "path": "docs/architecture.md",
203
+ "scope": "repo",
204
+ "role": "source-material",
205
+ "canonical": true,
206
+ "use_by_agents": "source-for-reconciliation",
207
+ "canonical_target": "docs/architecture.md",
208
+ "post_migration_action": "retain",
209
+ "deletion_status": "not-applicable",
210
+ "notes": "Canonical overlap: Package architecture and contract index, reconciled in place. Never a deletion candidate."
211
+ },
212
+ {
213
+ "path": "docs/getting-started.md",
214
+ "scope": "repo",
215
+ "role": "source-material",
216
+ "canonical": true,
217
+ "use_by_agents": "source-for-reconciliation",
218
+ "canonical_target": "docs/getting-started.md",
219
+ "post_migration_action": "retain",
220
+ "deletion_status": "not-applicable",
221
+ "notes": "Canonical overlap: Package getting-started guide, reconciled in place. Never a deletion candidate."
222
+ },
223
+ {
224
+ "path": "docs/specs/README.md",
225
+ "scope": "repo",
226
+ "role": "source-material",
227
+ "canonical": true,
228
+ "use_by_agents": "source-for-reconciliation",
229
+ "canonical_target": "docs/specs/README.md",
230
+ "post_migration_action": "retain",
231
+ "deletion_status": "not-applicable",
232
+ "notes": "Canonical overlap: Package spec registry, reconciled in place. Never a deletion candidate."
233
+ },
234
+ {
235
+ "path": "src/docs/README.md",
236
+ "scope": "module",
237
+ "module": "src",
238
+ "role": "source-material",
239
+ "canonical": true,
240
+ "use_by_agents": "source-for-reconciliation",
241
+ "canonical_target": "src/docs/README.md",
242
+ "post_migration_action": "retain",
243
+ "deletion_status": "not-applicable",
244
+ "notes": "Canonical overlap: Canonical module spec, reconciled in place. Never a deletion candidate."
245
+ },
246
+ {
247
+ "path": "README.md",
248
+ "scope": "reference",
249
+ "role": "reference-only",
250
+ "canonical": false,
251
+ "use_by_agents": "context-only",
252
+ "post_migration_action": "retain",
253
+ "deletion_status": "not-applicable",
254
+ "notes": "Package install/usage reference, left byte-for-byte unchanged. Known conflict with code: it describes clear() as clearing data for the bound namespace, but src/index.js removes the whole basekey across every namespace. Treat src/docs/README.md as authoritative for behavior."
255
+ }
256
+ ],
257
+ "spec_policy": {
258
+ "require_what_and_why": true,
259
+ "require_provenance": true,
260
+ "protected_specs": [
261
+ "src/docs/README.md"
262
+ ]
263
+ },
264
+ "validation": {
265
+ "generator_runtime": "claude-code",
266
+ "generator_model": "claude-opus-5-5",
267
+ "generator_run_id": "f52420c1-2f02-41be-a487-d717836bbfdb",
268
+ "generator_runtime_source": "host-metadata",
269
+ "validator_runtime": "01a1bf1a-7e46-7451-9bed-7ebfbdc56def",
270
+ "validator_model": "gpt-6-luna",
271
+ "validator_run_id": "01a1bfde-6ecc-76f0-9402-8e05fd678b6e",
272
+ "validator_runtime_source": "host-metadata",
273
+ "runtime_fallback_tier": "different-runtime",
274
+ "minimum_independence": "different-runtime",
275
+ "blocking_severities": [
276
+ "Blocking"
277
+ ],
278
+ "source_commit": "94f94f516b0e63f6bdff9337b40b5981a699bef1",
279
+ "base_ref": "next"
280
+ },
281
+ "layout": {
282
+ "sdd_root": ".sdd",
283
+ "docs_root": "docs",
284
+ "agent_entry_path": "AGENTS.md",
285
+ "standing_docs_root": "docs",
286
+ "spec_index_path": "docs/specs/README.md",
287
+ "module_docs_strategy": "source-local",
288
+ "module_docs_relative_path": "docs/README.md",
289
+ "contract_index_path": "docs/architecture.md",
290
+ "repo_skills_root": "../../../.agents/skills",
291
+ "template_roots": {
292
+ "canonical": ".sdd/templates/repo-standards"
293
+ },
294
+ "module_docs_decision": {
295
+ "basis": "repo-standards-default",
296
+ "reason": "The package contained no docs directory, documentation tooling, or protected file before this run, so the repo-standards source-local default <module-path>/docs/README.md applies without conflict.",
297
+ "decided_by": "rsarika@cisco.com",
298
+ "decided_at": "2026-10-01T06:20:02Z"
299
+ },
300
+ "repo_context_decision": {
301
+ "path": ".repo-context.json",
302
+ "schema_path": "schemas/repo-context.schema.json",
303
+ "action": "create",
304
+ "schema_action": "reuse",
305
+ "reason": "The owner approved replacing the existing package context as a repository change, because it described a keep-separate policy and a package-local template map that no longer apply; it is regenerated from current code and this manifest. The schema already exists, is byte-identical to the root snapshot schema, and is reused unchanged.",
306
+ "decided_by": "rsarika@cisco.com",
307
+ "decided_at": "2026-11-09T10:45:00Z"
308
+ },
309
+ "artifact_decisions": [
310
+ {
311
+ "path": "docs/service.md",
312
+ "action": "omit",
313
+ "reason": "Not a deployable service. The package is a published npm library consumed in-process; it has no runtime, endpoint, or operating posture of its own.",
314
+ "decided_by": "rsarika@cisco.com",
315
+ "decided_at": "2026-10-01T06:20:02Z"
316
+ },
317
+ {
318
+ "path": "mkdocs.yml",
319
+ "action": "omit",
320
+ "reason": "The package has no documentation-site tooling and the repository publishes no mkdocs site.",
321
+ "decided_by": "rsarika@cisco.com",
322
+ "decided_at": "2026-10-01T06:20:02Z"
323
+ },
324
+ {
325
+ "path": "api-specs/openapi.yaml",
326
+ "action": "omit",
327
+ "reason": "No HTTP surface exists. The published contract is the package's ecosystem-native ES module export (src/index.js, registered as storage-adapter-local-storage-sdk), which Repo Standards treats as the authoritative source for a published SDK.",
328
+ "decided_by": "rsarika@cisco.com",
329
+ "decided_at": "2026-10-01T06:20:02Z"
330
+ },
331
+ {
332
+ "path": "SECURITY.md",
333
+ "action": "omit",
334
+ "reason": "Security disclosure is governed at the repository root, not per workspace package. No package-local file existed and creating one would fork repository governance.",
335
+ "decided_by": "rsarika@cisco.com",
336
+ "decided_at": "2026-10-01T06:20:02Z"
337
+ },
338
+ {
339
+ "path": "CONTRIBUTING.md",
340
+ "action": "omit",
341
+ "reason": "The repository root owns CONTRIBUTING.md, which this package's README.md already links. A package-local copy would duplicate repository governance.",
342
+ "decided_by": "rsarika@cisco.com",
343
+ "decided_at": "2026-10-01T06:20:02Z"
344
+ },
345
+ {
346
+ "path": "CHANGELOG.md",
347
+ "action": "omit",
348
+ "reason": "Releases are produced by the repository-level automated release pipeline; the package carries no hand-maintained changelog.",
349
+ "decided_by": "rsarika@cisco.com",
350
+ "decided_at": "2026-10-01T06:20:02Z"
351
+ },
352
+ {
353
+ "path": "CTO_CHECKLIST.yml",
354
+ "action": "omit",
355
+ "reason": "Selected only for a deployable service; this package is an in-process library. Omitted together with its schema, as the template map requires the pair to be selected together.",
356
+ "decided_by": "rsarika@cisco.com",
357
+ "decided_at": "2026-10-01T06:20:02Z"
358
+ },
359
+ {
360
+ "path": "schemas/cto-checklist.schema.json",
361
+ "action": "omit",
362
+ "reason": "Paired with CTO_CHECKLIST.yml, which is omitted.",
363
+ "decided_by": "rsarika@cisco.com",
364
+ "decided_at": "2026-10-01T06:20:02Z"
365
+ }
366
+ ],
367
+ "monorepo_package": {
368
+ "package_path": "packages/@webex/storage-adapter-local-storage",
369
+ "root_manifest_path": "../../../.sdd/manifest.json",
370
+ "templates_root_path": "../../../.sdd/templates/repo-standards"
371
+ }
372
+ },
373
+ "substrate": {
374
+ "source": "WebexTools/repo-standards",
375
+ "consumed": [
376
+ "lint config (.eslintrc.js extending @webex/eslint-config-legacy)",
377
+ "babel config (babel.config.js extending @webex/babel-config-legacy)",
378
+ "jest config (jest.config.js extending @webex/jest-config-legacy)",
379
+ "package manifest and scripts (package.json)",
380
+ "repository ownership (.github/CODEOWNERS)",
381
+ "repository CI workflows (.github/workflows/pull-request.yml)",
382
+ "existing package reference documentation (README.md, reference-only)"
383
+ ]
384
+ },
385
+ "tooling": {
386
+ "sdlc_skills": {
387
+ "source_ref": "repo-annotation@2.3.1"
388
+ }
389
+ },
390
+ "coverage_ratchet": {
391
+ "enabled": true,
392
+ "waivers": []
393
+ },
394
+ "section_profiles": {
395
+ "repo": {
396
+ "owns_datastore": true,
397
+ "holds_client_state": false,
398
+ "components_interact": false,
399
+ "domain_data_across_components": false,
400
+ "caches_data": false,
401
+ "observability_convention": true,
402
+ "deploys_to_infra": false,
403
+ "shared_base_libs": true,
404
+ "is_monorepo": true,
405
+ "multi_platform": false,
406
+ "published_package": true,
407
+ "embedded_in_host": true,
408
+ "exposes_commands_or_artifacts": true,
409
+ "cross_repo_deps_material": false,
410
+ "security_arch_warranted": true
411
+ },
412
+ "resolved_by": "rsarika@cisco.com (confirmed against code by claude-code)",
413
+ "resolved_at": "2026-11-09T10:45:00Z"
414
+ }
415
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,257 @@
1
+ <!-- sdd-generated-metadata
2
+ doc_kind: agent-entry
3
+ generated_from: agents@0.3.0
4
+ generated_by: claude-code
5
+ approved_by: rsarika@cisco.com
6
+ updated_at: 2026-11-09T10:36:32Z
7
+ validation_status: pass-with-warnings
8
+ -->
9
+
10
+ # AI Agent Instructions
11
+
12
+ Instructions for AI coding assistants working in
13
+ `packages/@webex/storage-adapter-local-storage`. The repository root carries its own
14
+ [`AGENTS.md`](../../../AGENTS.md) with monorepo-wide rules, and the root
15
+ [package routing table](../../../docs/index.md#sdd-package-routing) lists every onboarded package;
16
+ this file governs only this package and does not replace either.
17
+
18
+ ## Working Method
19
+
20
+ - Read the relevant repository files before editing. Do not edit blind.
21
+ - Understand the task and affected surfaces before writing code.
22
+ - Prefer focused edits over rewriting whole files.
23
+ - Do not invent commands, paths, exports, or behavior. Verify them from repository-local source.
24
+ - Test or validate before declaring done. In this package that is harder than it looks — read
25
+ section 4 before trusting a green run.
26
+ - Keep output concise. If something is uncertain, say so instead of guessing.
27
+
28
+ ## Canonical Repository Documentation
29
+
30
+ Before changing code or documentation, start with:
31
+
32
+ - [`docs/index.md`](docs/index.md) for documentation navigation;
33
+ - [`docs/architecture.md`](docs/architecture.md) for package boundaries, interactions, and the
34
+ contract index;
35
+ - [`docs/specs/README.md`](docs/specs/README.md) for the manifest-backed module registry;
36
+ - the affected module's manifest-routed spec — here, [`src/docs/README.md`](src/docs/README.md).
37
+
38
+ No ADRs exist for this package yet.
39
+
40
+ Follow `.sdd/manifest.json` for each contract's publication state and canonical source. This package
41
+ publishes an SDK surface whose ecosystem-native declaration is `package.json`; it exposes no HTTP
42
+ API, so there is no OpenAPI document. The manifest remains authoritative for canonical paths and
43
+ artifact decisions.
44
+
45
+ `README.md` at the package root is **reference-only and not authoritative**. It is registered in the
46
+ manifest as reference-only context, and it contains at least one statement the code contradicts (it
47
+ describes `clear()` as namespace-scoped; it is not). Use `src/docs/README.md` for behavior.
48
+
49
+ ## 1. Commands (Run First)
50
+
51
+ Use only documented commands. Do not invent alternatives when a command is missing. Run them from
52
+ the repository root with Node 22.14 (`nvm use 22.14`).
53
+
54
+ | Task | Command |
55
+ | ---------------------- | ------------------- |
56
+ | Install dependencies | `yarn install` (repository root) |
57
+ | Start dev environment | Not applicable — this is a library with no runnable entry point |
58
+ | Run tests | `yarn workspace @webex/storage-adapter-local-storage test:unit` — but see section 4; it executes no case |
59
+ | Run linters | `yarn workspace @webex/storage-adapter-local-storage test:style` |
60
+ | Build/release artifact | `yarn workspace @webex/storage-adapter-local-storage build:src` |
61
+ | Format code | No package-local format script; Prettier is a devDependency and formatting is enforced through lint |
62
+
63
+ Do not run `yarn workspace @webex/storage-adapter-local-storage test`. It chains `test:integration`,
64
+ which this package does not define, so it exits 1 before reaching the browser suite.
65
+
66
+ If a required command is unknown, stop and ask for the exact command.
67
+
68
+ ## 2. Agent Persona and Scope
69
+
70
+ You are the `@webex/web-client` engineering assistant for
71
+ `@webex/storage-adapter-local-storage`, assigned in `.github/CODEOWNERS`.
72
+
73
+ Primary outcomes:
74
+
75
+ - Deliver production-safe changes with passing tests.
76
+ - Preserve existing behavior unless a change request explicitly requires a behavior change.
77
+ - Keep docs and configuration aligned with code changes.
78
+
79
+ Definition of done:
80
+
81
+ 1. Requested change is implemented.
82
+ 2. Relevant tests/lint/build checks pass locally — and you have confirmed that the tests you are
83
+ relying on actually executed.
84
+ 3. Updated docs/config cover new behavior, including `src/docs/README.md` when behavior changes.
85
+ 4. PR summary includes risks and rollback notes.
86
+
87
+ ## 3. Repository Knowledge
88
+
89
+ ### Tech Stack
90
+
91
+ | Area | Tooling | Version |
92
+ | ---------------- | ----------- | ----------- |
93
+ | Language runtime | Node (build and test tooling only; the module itself targets browsers) | `engines.node >= 18` in `package.json`; repository `.nvmrc` pins `lts/jod`; verified working on `v22.14.0` |
94
+ | Package manager | Yarn (workspaces) | `3.4.1` |
95
+ | Build tool | `webex-legacy-tools` via `@webex/legacy-tools`, Babel through `@webex/babel-config-legacy` | `workspace:*` |
96
+ | Test framework | Jest via `@webex/jest-config-legacy` (Node route); Karma + Mocha via `webex-legacy-tools` (browser route) | `workspace:*` |
97
+ | Lint/format | ESLint `^8.24.0` with `@webex/eslint-config-legacy`; Prettier `^2.7.1` | as declared in `package.json` |
98
+
99
+ ### Project Map
100
+
101
+ - `src/index.js`: the entire implementation — `StorageAdapterLocalStorage` and its inner `Bound` class.
102
+ - `src/docs/README.md`: the canonical module specification. Authoritative for behavior.
103
+ - `test/unit/spec/storage-adapter-local-storage.js`: the only test file; delegates to the shared
104
+ abstract suite and skips it under Node.
105
+ - `docs/`: package-level standing documentation (index, architecture, getting started, spec registry).
106
+ - `.sdd/manifest.json`: SDD manifest — modules, contracts, layout, coverage state.
107
+ - Templates: this package holds none. It refers to the monorepo root snapshot at
108
+ `../../../.sdd/templates/repo-standards` through `layout.monorepo_package.templates_root_path` in
109
+ `.sdd/manifest.json`. Do not create package-level templates, and do not hand-edit the root snapshot.
110
+ - `process`: a one-line CommonJS file exporting `{browser: true}` for the browserify/envify transform.
111
+ - `README.md`: npm-facing reference. Reference-only, not authoritative.
112
+
113
+ ### Critical Constraints
114
+
115
+ - **Browser-only.** The module uses the `localStorage` global with no feature detection
116
+ (`src/index.js`). It is unreachable in Node builds by design: `@webex/webex` selects it only
117
+ through the `browser` field substitution of `config-storage.shim.js`.
118
+ - **`clear()` is basekey-scoped, not namespace-scoped.** It removes the whole `localStorage` entry
119
+ and therefore every namespace (`src/index.js`). This differs from `MemoryStoreAdapter` and is
120
+ the single most consequential behavior in the package. It is owner-confirmed intent: logout must
121
+ remove all persisted SDK state under the basekey, including namespaces not bound in the current
122
+ session. Do not "fix" it to be namespace-scoped, and do not give `clear()` a parameter — its
123
+ contract takes none, and its `@param key` JSDoc is stale.
124
+ - **The at-rest document is a compatibility surface.** `localStorage[basekey]` holds
125
+ `{ "<namespace>": { "<key>": <value> } }` with no version field and no migration step
126
+ (`src/index.js`). Owner-confirmed: a newer release must still read a document written by an older
127
+ one. Any change to the layout or its JSON encoding needs a migration that reads the previous
128
+ layout, and is a breaking change.
129
+ - **Presence is `typeof value !== 'undefined'`, never truthiness** (`src/index.js`). Changing
130
+ this corrupts legitimately stored `0`, `false`, `null`, and `''`.
131
+ - **Security:** in a browser bundle this adapter persists OAuth access and refresh tokens as
132
+ plaintext JSON (webex-core `src/lib/storage/decorators.js`). Never add logging of stored
133
+ values, and never widen what is persisted without a security review.
134
+ - **Backward compatibility:** the published constructor signature and the `bind`/`get`/`put`/`del`/
135
+ `clear` shape are breaking-change boundaries for `@webex/webex`,
136
+ `@webex/recipe-private-web-client`, and the authorization-browser fixtures.
137
+
138
+ ## 4. Testing Workflow
139
+
140
+ Run checks in this order:
141
+
142
+ 1. `yarn workspace @webex/storage-adapter-local-storage test:unit`
143
+ 2. `yarn workspace @webex/storage-adapter-local-storage test:style`
144
+ 3. `yarn workspace @webex/storage-adapter-local-storage test:browser`
145
+
146
+ **Read this before trusting any of those results.** Measured 2026-11-09 on Node v22.14.0, no
147
+ automated test executes this package in either route:
148
+
149
+ - `test:unit` exits 0 having **skipped all 21 cases**. `testEnvironment` is `node` (the shared
150
+ config in workspace package `packages/legacy/jest`, reached through `jest.config.js`),
151
+ `localStorage` does not exist there, and `test/unit/spec/storage-adapter-local-storage.js` wraps the
152
+ suite in `skipInNode`.
153
+ - `test:browser` **completes 0 tests and exits 1**. Both Firefox and Chrome Headless report
154
+ `ReferenceError: beforeAll is not defined`, because the `@webex/storage-adapter-spec` suite calls a
155
+ Jest global under Karma's Mocha runner, so the suite throws while being defined.
156
+
157
+ The unit route reports success while verifying nothing, and the browser route fails before any case
158
+ runs. Check the reported test *count*, not only the exit code. If you change behavior in `src/index.js`, no existing check will catch a regression — verify
159
+ manually in a browser and say so explicitly in the PR.
160
+
161
+ Testing rules:
162
+
163
+ - Add or update tests for every behavior change.
164
+ - Cover failure paths and edge cases, not only happy paths.
165
+ - Do not remove tests to make CI pass.
166
+ - Do not add a `test:unit` case that assumes `localStorage`; the Node environment cannot run it.
167
+ - Repairing the browser route means changing `@webex/storage-adapter-spec`, which is a different
168
+ package with four consumers. Treat it as a cross-package change, not a local fix.
169
+
170
+ There is no coverage gate for this package: `collectCoverage` is `false`, no threshold is
171
+ configured, and the repository's `Test - Coverage` CI job runs `test:coverage`, which this package
172
+ does not define.
173
+
174
+ ## 5. Code Style and Patterns
175
+
176
+ Coding expectations:
177
+
178
+ - Follow repository style rules and static analysis output.
179
+ - Prefer small, composable functions over large procedural blocks.
180
+ - Make error handling explicit at system boundaries.
181
+ - Keep public interfaces stable unless a breaking change is requested.
182
+ - Before adding a literal path, filename, command, workflow identifier, status, or other policy
183
+ value, search the repository for exact and semantically equivalent uses. When repeated production
184
+ values represent one shared contract, move them to the narrowest owning shared module or catalog
185
+ as one canonical named constant, enum, or type and update consumers. Keep incidental similarities,
186
+ one-off implementation details, and independent test fixtures local.
187
+ - Do not import a default, named, object, or namespace binding and immediately re-export it.
188
+ Consumers should import from the owning module; package barrels should use direct named re-exports.
189
+ - Do not write inline runtime `typeof` checks outside descriptively named guard implementations.
190
+ Import and reuse the owning guard instead; TypeScript type-position `typeof` queries remain
191
+ allowed. **Exception, grandfathered:** `get` in `src/index.js` uses a bare `typeof value !== 'undefined'`
192
+ to implement the presence rule. It is the rule itself, not an ad-hoc check; preserve it as written.
193
+
194
+ Package-local conventions, with evidence:
195
+
196
+ - Keep `basekey` captured in the constructor closure (`src/index.js`). Do not promote it to an
197
+ instance property.
198
+ - Keep per-binding state in the module-level `WeakMap`s (`src/index.js`), not on the instance.
199
+ - Keep `/* eslint-env browser */` at the top of browser-only sources (`src/index.js`).
200
+
201
+ Pattern example:
202
+
203
+ ```text
204
+ Preferred:
205
+ - Validate external input close to the boundary (bind() rejects a falsy namespace or missing logger).
206
+ - Return typed/structured results (reject NotFoundError, not a bare Error, for an absent key).
207
+ - Include actionable error messages.
208
+
209
+ Avoid:
210
+ - Passing unvalidated payloads deep into the system.
211
+ - Swallowing exceptions or returning ambiguous null values.
212
+ - Truthiness tests for presence, which silently discard 0, false, null, and ''.
213
+ ```
214
+
215
+ ## 6. Git Workflow
216
+
217
+ - Branch naming: `[feature|fix|chore]/[short-description]`
218
+ - Commit format: conventional commits (`feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`)
219
+ - Keep commits focused and reversible.
220
+ - Rebase on the target branch before opening PR. The default branch for PRs is `next`.
221
+
222
+ PR checklist:
223
+
224
+ - What changed and why.
225
+ - Tests run and results — state explicitly whether any test actually executed.
226
+ - Risk/impact areas, naming the consumers affected by a surface change.
227
+ - Rollback approach.
228
+
229
+ ## 7. Boundaries and Escalation
230
+
231
+ ### Always
232
+
233
+ - Prefer existing patterns over introducing new architecture.
234
+ - Keep changes minimal for the requested scope.
235
+ - Call out assumptions and unknowns explicitly.
236
+ - Update `src/docs/README.md` in the same change as any behavior change, and
237
+ `docs/architecture.md` when a boundary or contract moves.
238
+
239
+ ### Ask First
240
+
241
+ - Adding new dependencies or external services.
242
+ - Large refactors or schema migrations — including any change to the at-rest document layout.
243
+ - Changing `clear()` scope or parameters, the presence rule, or the published constructor signature.
244
+ - Security-sensitive changes (auth, encryption, secrets handling). Note that this package already
245
+ persists OAuth tokens in plaintext.
246
+ - Any destructive data or infrastructure operation.
247
+ - Modifying `@webex/storage-adapter-spec` to repair the browser test route; it has four consumers.
248
+
249
+ ### Never
250
+
251
+ - Commit secrets, keys, or credentials.
252
+ - Bypass required checks by disabling tests or linters.
253
+ - Rewrite history on shared branches.
254
+ - Change unrelated files "while here" without clear need.
255
+ - Edit `README.md` to match the code without an explicit source-policy decision; it is registered as
256
+ reference-only material.
257
+ - Hand-edit files under `.sdd/templates/repo-standards/`.