refactor(redis): centralize miss and timestamp validation - #153
Open
lan17 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Small, behavior-preserving cleanup of the miss-classification implementation, following the review on #146 (review).
CacheMissReasonusing an exhaustive private map and own-key lookup.CacheMissReasontype fromdialcache/redis-protocolfor adapter authors.Scope and compatibility
Validation remains at its existing call sites and in its existing order. The miss taxonomy, read-result shapes, timestamp domain, error precedence, refill fencing, metrics, and Redis commands are unchanged. The validation helpers are package-private; the only public addition is the type-only re-export.
This deliberately excludes miss-union redesign, automatic timestamp defaulting, new skip telemetry, legacy decoder removal, and unrelated micro-optimizations. Untrusted adapter results are still normalized at the core boundary.
Dependency
Stacked on #146, which remains unchanged. The base branch is
codex/issue-145-miss-reasons, so this PR shows only the cleanup (9 files, 47 insertions and 14 deletions).After the prerequisite merges, rebase this cleanup onto
mainand retarget it before merging. No merge or release is performed by this change.Validation
Node.js 22.22.0:
corepack pnpm install --frozen-lockfilecorepack pnpm check: typecheck, 655 unit tests with coverage, ESM/CJS build, declarations, and packed-package checks passed.corepack pnpm test:integration: 143 passed; 2 local GLIDE Cluster tests skipped because announced container IPs are not host-routable.git diff --checkpassed.