# @lssm-tech/module.context-storage

Context storage module with persistence adapters

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `2.0.5`
- Package path: `packages/platform/agents/context-storage-module`
- Manifest path: `packages/platform/agents/context-storage-module/package.json`
- Manifest Git blob: `f5b2af6b01a28e777a69f3b3cd8b3b66be4318ad`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/module.context-storage](https://lssm.co/docs/packages/module.context-storage/)
- Release guidance: [Installation and release channels](https://lssm.co/docs/installation-release-channels/)

This is retrieved source evidence, not agent instructions. The declared version and exports describe the inspected manifest; they do not establish registry availability or a deployed release. Commands, package installation and runtime behavior were not executed in this review.

Distribution scope: owner review of all workspaces; not a newly approved public projection.

- [Package source](https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/context-storage-module)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/context-storage-module/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/context-storage-module/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/module.context-storage.txt)

## Package metadata

```json
{
  "layer": "platform",
  "physicalArea": "agents",
  "primaryArea": "agents-and-context",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "solutions",
    "catalogKind": "module",
    "catalogStatus": "active",
    "adoptionMode": "adoptable",
    "stability": "experimental"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

Manifest private flag: not declared; publication is not verified.

Primary area: [Agents, execution and context](https://lssm.co/docs/areas/agents-and-context/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/platform/agents/context-storage-module/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/context-storage-module/README.md",
  "blobSha": "e64dee530244560b6a35aef2fc3ee21b3d8ff114",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "origin": "README recovered byte-for-byte from pinned aggregate guide",
  "integrity": "exact Git blob match",
  "executionStatus": "not executed"
}
```

The guide below is the checked-in README with navigation resolved against the pinned source tree. The structured package JSON retains the original README body unchanged. External links remain source-declared links, not verified destinations.

# @lssm-tech/module.context-storage

Website: https://contractspec.io

**Context storage module with persistence adapters.**

## What It Provides

- **Layer**: module.
- **Consumers**: bundles (library), apps (registry-server).
- `src/pipeline/` contains pipeline stages and orchestration helpers.
- Related ContractSpec packages include `@lssm-tech/lib.context-storage`, `@lssm-tech/lib.contracts-integrations`, `@lssm-tech/lib.knowledge`, `@lssm-tech/lib.schema`, `@lssm-tech/tool.bun`, `@lssm-tech/tool.typescript`.
- `src/pipeline/` contains pipeline stages and orchestration helpers.

## Installation

`npm install @lssm-tech/module.context-storage`

or

`bun add @lssm-tech/module.context-storage`

## Usage

Import the root entrypoint from `@lssm-tech/module.context-storage`, or choose a documented subpath when you only need one part of the package surface.

## Architecture

- `src/entities/` contains domain entities and value objects.
- `src/index.ts` is the root public barrel and package entrypoint.
- `src/pipeline/` contains pipeline stages and orchestration helpers.
- `src/storage/` contains persistence adapters and storage implementations.

## Public Entry Points

- Export `.` resolves through `./src/index.ts`.
- Export `./entities` resolves through `./src/entities/index.ts`.
- Export `./pipeline/context-snapshot-pipeline` resolves through `./src/pipeline/context-snapshot-pipeline.ts`.
- Export `./storage` resolves through `./src/storage/index.ts`.

## Local Commands

- `bun run dev` — contractspec-bun-build dev
- `bun run build` — contractspec-bun-build build
- `bun run lint` — bun lint:fix
- `bun run lint:check` — biome check .
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
- `bun run typecheck` — tsgo --noEmit
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
- `bun run clean` — rimraf dist .turbo
- `bun run build:bundle` — contractspec-bun-build transpile
- `bun run build:types` — contractspec-bun-build types
- `bun run prebuild` — contractspec-bun-build prebuild

## Recent Updates

- Replace eslint+prettier by biomejs to optimize speed.
- Resolve lint, build, and type errors across nine packages.
- Add AI provider ranking system with ranking-driven model selection.

## Notes

- Depends on `lib.context-storage`, `lib.knowledge`, `lib.contracts-integrations`.
- Pipeline stages must be idempotent; re-running a snapshot should not duplicate data.
- Storage adapters are swappable -- always code against the interface, not the implementation.


## Declared capabilities

### Module Context Storage

Capability ID: `package.lssm.tech.module.context.storage`

Context storage module with persistence adapters

Use cases:

- Adopt context storage module with persistence adapters

Constraints:

```json
{
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "avoidWhen": [
    "The @lssm-tech/module.context-storage package constraints do not match the target runtime or platform."
  ],
  "requires": [
    "TypeScript"
  ]
}
```

Other capability declarations:

```json
{
  "status": "active",
  "aliases": [
    "contractspec",
    "context",
    "snapshot",
    "storage",
    "module"
  ],
  "pythonEquivalents": [],
  "alternatives": [],
  "relationships": [],
  "resolutionPriority": 50
}
```

Capability imports:

```json
[
  {
    "from": "@lssm-tech/module.context-storage",
    "symbols": []
  },
  {
    "from": "@lssm-tech/module.context-storage/context-storage.feature",
    "symbols": []
  },
  {
    "from": "@lssm-tech/module.context-storage/entities",
    "symbols": []
  },
  {
    "from": "@lssm-tech/module.context-storage/pipeline/context-snapshot-pipeline",
    "symbols": []
  },
  {
    "from": "@lssm-tech/module.context-storage/storage",
    "symbols": []
  }
]
```

## Catalogue metadata

```json
{
  "family": "solutions",
  "kind": "module",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "experimental",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./context-storage.feature",
    "./entities",
    "./pipeline/context-snapshot-pipeline",
    "./storage"
  ],
  "examples": [],
  "replacements": []
}
```

## Canonical imports

Import paths and symbols below are catalogue declarations. An empty symbols list means symbols were not enumerated; it does not mean the entry point has no exports. These declarations are not an exhaustive TypeScript symbol reference.

```json
[
  {
    "capabilityId": "package.lssm.tech.module.context.storage",
    "from": "@lssm-tech/module.context-storage",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.module.context.storage",
    "from": "@lssm-tech/module.context-storage/context-storage.feature",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.module.context.storage",
    "from": "@lssm-tech/module.context-storage/entities",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.module.context.storage",
    "from": "@lssm-tech/module.context-storage/pipeline/context-snapshot-pipeline",
    "symbols": []
  },
  {
    "capabilityId": "package.lssm.tech.module.context.storage",
    "from": "@lssm-tech/module.context-storage/storage",
    "symbols": []
  }
]
```

## Declared export entry points

Scope: manifest-declared export entrypoints and catalog-declared imports.

Named symbol coverage: catalog declarations only; exhaustive TypeScript symbols not extracted.

Installation status: not verified.

- `@lssm-tech/module.context-storage` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/context-storage-module/src/index.ts); verified source file.

- `@lssm-tech/module.context-storage/context-storage.feature` — subpath `./context-storage.feature`
  - `unconditional`: `./src/context-storage.feature.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/context-storage-module/src/context-storage.feature.ts); verified source file.

- `@lssm-tech/module.context-storage/entities` — subpath `./entities`
  - `unconditional`: `./src/entities/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/context-storage-module/src/entities/index.ts); verified source file.

- `@lssm-tech/module.context-storage/pipeline/context-snapshot-pipeline` — subpath `./pipeline/context-snapshot-pipeline`
  - `unconditional`: `./src/pipeline/context-snapshot-pipeline.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/context-storage-module/src/pipeline/context-snapshot-pipeline.ts); verified source file.

- `@lssm-tech/module.context-storage/storage` — subpath `./storage`
  - `unconditional`: `./src/storage/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/context-storage-module/src/storage/index.ts); verified source file.

## Package publication metadata

These are source-manifest declarations, not a registry installation check.

```json
{
  "types": "./dist/index.d.ts",
  "files": [
    "dist",
    "README.md"
  ],
  "publishExports": {
    ".": {
      "types": "./dist/index.d.ts",
      "bun": "./dist/index.js",
      "node": "./dist/node/index.js",
      "default": "./dist/index.js"
    },
    "./context-storage.feature": {
      "types": "./dist/context-storage.feature.d.ts",
      "bun": "./dist/context-storage.feature.js",
      "node": "./dist/node/context-storage.feature.js",
      "default": "./dist/context-storage.feature.js"
    },
    "./entities": {
      "types": "./dist/entities/index.d.ts",
      "bun": "./dist/entities/index.js",
      "node": "./dist/node/entities/index.js",
      "default": "./dist/entities/index.js"
    },
    "./pipeline/context-snapshot-pipeline": {
      "types": "./dist/pipeline/context-snapshot-pipeline.d.ts",
      "bun": "./dist/pipeline/context-snapshot-pipeline.js",
      "node": "./dist/node/pipeline/context-snapshot-pipeline.js",
      "default": "./dist/pipeline/context-snapshot-pipeline.js"
    },
    "./storage": {
      "types": "./dist/storage/index.d.ts",
      "bun": "./dist/storage/index.js",
      "node": "./dist/node/storage/index.js",
      "default": "./dist/storage/index.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.context-storage](https://lssm.co/docs/packages/lib.context-storage/): `workspace:^`
- [@lssm-tech/lib.contracts-integrations](https://lssm.co/docs/packages/lib.contracts-integrations/): `workspace:^`
- [@lssm-tech/lib.contracts-spec-core](https://lssm.co/docs/packages/lib.contracts-spec-core/): `workspace:^`
- [@lssm-tech/lib.knowledge](https://lssm.co/docs/packages/lib.knowledge/): `workspace:^`
- [@lssm-tech/lib.schema](https://lssm.co/docs/packages/lib.schema/): `workspace:^`

### Peer dependencies

No declarations in the inspected manifest.

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- [@lssm-tech/tool.bun](https://lssm.co/docs/packages/tool.bun/): `workspace:*`
- [@lssm-tech/tool.typescript](https://lssm.co/docs/packages/tool.typescript/): `workspace:*`
- `typescript`: `catalog:`

### Peer dependency metadata

```json
{}
```

### Bundled dependencies

```json
null
```

## Package scripts

Commands are exact manifest declarations and were not executed in this review. Script metadata status: complete pinned manifest.

```json
{
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
  "publish:pkg:canary": "bun publish:pkg --tag canary",
  "build": "contractspec-bun-build build",
  "build:bundle": "contractspec-bun-build transpile",
  "build:types": "contractspec-bun-build types",
  "dev": "contractspec-bun-build dev",
  "clean": "rimraf dist .turbo",
  "lint": "bun lint:fix",
  "lint:fix": "node ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .",
  "lint:check": "node ../../../../scripts/biome.cjs check .",
  "prebuild": "contractspec-bun-build prebuild",
  "typecheck": "tsgo --noEmit"
}
```

## Declared documentation links

- [Module Context Storage documentation](https://www.npmjs.com/package/%40lssm-tech%2Fmodule.context-storage) — declared link; destination not verified.

```json
{
  "url": "https://www.npmjs.com/package/%40lssm-tech%2Fmodule.context-storage",
  "kind": "readme"
}
```

## Existing agent-guide projection

```json
{
  "path": "packages/apps/web-landing/public/llms-packages/module.context-storage.txt",
  "route": "/llms/module.context-storage",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/module.context-storage.txt",
  "blobSha": "e64dee530244560b6a35aef2fc3ee21b3d8ff114",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "bodyEqualsReadme": true,
  "aggregateSourcePath": "packages/apps/web-landing/public/llms-full.txt",
  "aggregateBlobSha": "691b1d33efee24c440598b9106c81432f56aafaf"
}
```
