@lssm-tech/integration.lssm-os-cache-redis
Optional Redis and Valkey acceleration for LSSM OS T2 topologies. The package implements the provider-neutral Runtime Node distributed-cache, coordination, and event-stream ports through a small injected command client. It does not load SDK modules, read credentials, or own connection lifecycle.
SQL remains authoritative. A cache miss, eviction, adapter timeout, or disabled deployment must fall back to the T1 database path. Cache entries are bound to the full tenant/workspace/environment/product/application scope, topology generation, and qualified capability digest. Values are bounded, digest verified, UTF-8 only, and rejected when they contain credential material.
Invalidation uses one Redis/Valkey Lua transition to delete the entry and append the exact signed invalidation to a monotonic per-namespace reconciliation log. Coordination uses compare-and-set Lua transitions, bounded TTLs, and monotonic fences. These coordination fences are deliberately distinct from Runtime Node work-order fences and never authorize an external effect.
Redis Streams is available as an optional wake-up accelerator over a qualified SQL DurableQueuePortV2. Admission, claim, queue fences, reconciliation, and acknowledgement remain SQL-authoritative. Stream entries contain only immutable envelope/outbox identifiers and digests; they never contain payloads, secrets, claims, effect fences, or provider results. Redis failure or loss therefore degrades to bounded SQL polling without changing execution correctness. The adapter validates an independent redis_streams capability/version binding and distinct component profile, and will not substitute that transport binding for the SQL authority binding.
Compose an official redis client with fromRedisClientV1, or ioredis with
fromIoRedisClientV1. The same command surface works with Valkey-compatible clients. Production readiness requires an exact, digest-valid
CacheCapabilityProfileV1 whose engine is redis or valkey, plus deployment qualification for the configured server/client/topology versions. The package contains deterministic conformance tests but does not claim a live managed Redis or Valkey service qualification.
Wake consumers recover idle pending entries with XAUTOCLAIM before reading new entries. minimumPendingIdleMilliseconds defaults to 30 seconds and is bounded between one second and one day. Approximate stream trimming is also reconciled with the deduplication map: a mapping is reused only while its exact stream entry still exists, so a trimmed hint can be republished from the SQL outbox instead of becoming permanently unreachable.
Run bun run qualify:local after pulling redis:8.2.1-alpine to execute the real standalone Redis qualification. The command refuses to pull implicitly, binds both the local image ID and repository digest, disables container networking and TCP, uses a private Unix socket, stores AOF state in a uniquely created host temp directory, and removes the container and directory on every exit path. It verifies cache put/get, atomic invalidation ordering, stale-write rejection, poisoned-value containment, 100-way coordination contention, fencing, AOF restart persistence, Streams deduplication, pending recovery, acknowledgement, trim-map repair, and SQL-authoritative behavior while Redis is stopped.
Run bun run qualify:valkey-local after pulling
valkey/valkey:9.1.1-alpine for the same matrix against a distinct Valkey engine profile, official image and repository digest, valkey-server,
valkey-cli, and private Valkey socket. Redis success is never reused as Valkey evidence.
These commands provide local-live standalone Redis and Valkey evidence only. They do not qualify Sentinel, Cluster, managed primary/replica failover, resharding, TLS, ACLs, regional placement, sustained scale, or production operations; those rows remain release blockers.