镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

DOC-7267 Make node_redis entries callable and typed, and add ctx to go-redis HOTKEYS - #4486

Merged
andy-stark-redis merged 1 commit into
mainfrom
DOC-7267-node-redis
Nov 6, 2026
Merged

andy-stark-redis merged 1 commit into
mainfrom
DOC-7267-node-redis

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

DOC-7267 items 4 and 6. Everything is checked against node-redis 6.3.1.

node_redis: 344 of 474 entries change.

  • 325 signatures. 312 used the uppercase command as the method (APPEND, and for modules the dotted BF.ADD, JSON.SET, TS.ADD, which can't be called as written). 13 were the internal parseCommand(parser, ...) form. They are now the camelCase method from the package's own index.ts (append, aclCat), and module commands are client.<namespace>.<method> (client.bf.add, client.json.set, client.ft.search, client.ts.add), matching the one entry that already used client.ft.hybrid. The parser parameter is dropped from the 13, in the signature and in params.
  • 226 return types. 182 of the 226 Any returns now carry the transformReply type from the source (the RESP2 form where a command declares both). 44 Promise<...> types lose the wrapper and keep their inner type.
  • Parameter text and descriptions are untouched, including the 84 uppercase entries that had hand-written descriptions.

go-redis: 4 entries. The HOTKEYS entries now list ctx in params, like the other 548. (The ticket overstated this; only these four were inconsistent.)

The merged data/command-api-mapping.json is regenerated and equals the per-command data. Its only semantic changes are those node_redis and go-redis entries; no other client changed.

How to review

  • All 458 resolved entries name a member in the 6.3.1 declarations, and a tsc --strict compile of typeof client.<name> succeeds for all 448 distinct names. This closes the DOC-7263 gap that tsc wasn't available. The remaining names are client-level methods (quit, select, ...) that aren't in the command map.
  • Return types come from the TypeScript source, not the .d.ts, which expands aliases into unreadable types (ArrayReply<BlobStringReply<string>>, a 400-character AclUser).
  • A full old-to-new report for all 344 entries is in the commit's data diff; every changed line is a signature or returns.type, except the 13 removed parser params.

Left for the rest of DOC-7267

  • 44 Any returns whose source has no readable reply type (arrow functions with an inferred return): BZMPOP, BZPOPMAX, BZPOPMIN, GEODIST, GEOPOS, HSCAN, SCAN, SSCAN, ZSCAN, JSON.GET, JSON.MGET, JSON.ARRPOP, TS.GET, TS.INFO, TS.MGET, TS.MRANGE, TS.MREVRANGE, TS.RANGE, TS.REVRANGE, TS.DECRBY, the V* vector set commands, the X* stream commands, ZADD, ZINCRBY, ZMPOP, ZPOPMAX, ZPOPMIN, ZRANGE, ZRANGEBYSCORE, ZSCORE, SORT_RO, GEORADIUS_RO and GEORADIUSBYMEMBER_RO.
  • 43 entries whose parameters disagree with the source. Some are real drift (CF.LOADCHUNK calls a parameter data where the source says chunk; CMS.INITBYDIM and CMS.INITBYPROB omit options; TDIGEST.* rank commands), some are my reader's limits on rest or overloaded parameters (ARGREP, EVAL*, ZRANGE). Listed: ARGREP, CF.INSERT, CF.INSERTNX, CF.LOADCHUNK, CMS.INITBYDIM, CMS.INITBYPROB, CONFIG SET, EVAL, EVAL_RO, EVALSHA, EVALSHA_RO, FCALL, FCALL_RO, FT.ALTER, FT.CURSOR READ, FT.DICTADD, FT.DICTDEL, FT.SYNUPDATE, GEORADIUS, GEORADIUS_RO, GEORADIUSBYMEMBER_RO, HSET, JSON.MGET, MIGRATE, PEXPIRE, PEXPIREAT, SORT_RO, TDIGEST.BYRANK, TDIGEST.BYREVRANK, TDIGEST.MERGE, TDIGEST.RANK, TDIGEST.REVRANK, TDIGEST.TRIMMED_MEAN, TOUCH, TS.DECRBY, TS.INCRBY, TS.RANGE, TS.REVRANGE, XADD, ZRANGE, ZRANGEBYSCORE.
  • 16 entries that don't map to a command-map member and were not touched: FAILOVER, MONITOR, QUIT, RESET, SELECT, SAVE, SHUTDOWN, READWRITE, FT.PROFILE, and the pub/sub commands (SUBSCRIBE, PSUBSCRIBE, SSUBSCRIBE, UNSUBSCRIBE, PUNSUBSCRIBE, SUNSUBSCRIBE) plus CLIENT TRACKING, whose names are generic type fragments (false>, boolean>).
  • Two swapped pairs: DECR.json holds the DECRBY entry and DECRBY.json holds DECR, and the same for INCR and INCRBY. They now read decrBy/decr/incrBy/incr but still sit in each other's files. Swapping them is a data move, so I left it for a decision.

🤖 Generated with Claude Code


Note

Low Risk
Documentation and JSON mapping metadata only; no runtime code or security-sensitive paths.

Overview
Updates the command API mapping metadata so node_redis entries reflect how callers actually invoke node-redis 6.3.1, not internal parser shapes or uppercase command literals.

Signatures move to camelCase client methods (e.g. append, clusterAddSlots) and module commands use client.<module>.<method> (e.g. client.bf.add, client.ft.search). Entries that previously documented parseCommand(parser, …) now show the public API and drop the parser parameter. Return types replace broad Any and Promise<…> wrappers with reply types taken from the client source (NumberReply, BlobStringReply, ReplyUnion, etc.).

Separately, go-redis HOTKEYS mappings add the missing ctx context.Context parameter so they match the rest of that client’s entries.

These are documentation/data-only changes to data/command-api-mapping/; no Redis client libraries or server behavior change.

Reviewed by Cursor Bugbot for commit 95e83a0. Bugbot is set up for automated code reviews on this repo. Configure here.

…o-redis HOTKEYS

node_redis: 344 of 474 entries change, all checked against node-redis 6.3.1.

325 signatures were not the call a reader would make. 312 used the uppercase command as the
method (APPEND, and the dotted BF.ADD, JSON.SET and TS.ADD, which cannot be called as
written), and 13 were the internal parseCommand(parser, ...) form. They are now the camelCase
method from the package's own index.ts, and module commands are client.<namespace>.<method>
(client.bf.add, client.json.set, client.ft.search, client.ts.add), matching the one entry that
already used client.ft.hybrid. The parser parameter is dropped from the 13.

226 return types changed: 182 of the 226 Any returns now carry the transformReply type read
from the source (RESP2 form where a command declares both), and 44 Promise-wrapped types lose
the wrapper and keep their inner type. Parameter text and descriptions are untouched.

Checked two ways: all 458 resolved entries name a member in the 6.3.1 declarations, and a
tsc --strict compile of typeof client.<name> succeeds for all 448 distinct names (the remaining
ones are client-level methods such as quit and select that are not in the command map).
This closes the DOC-7263 gap that tsc was not available.

go-redis: the four HOTKEYS entries now list ctx in params like the other 548.

Left alone and flagged: 44 Any returns whose source has no readable reply type, 16 entries
that do not map to a command-map member, 43 entries whose parameters disagree with the source
(some real, such as CF.LOADCHUNK data versus chunk, some generator limits), and two swapped
pairs, DECR with DECRBY and INCR with INCRBY, where each file holds the other's entry.

Learned: node-redis lists every command under an uppercase and a camelCase key, so the uppercase entries were valid API but unreadable and, for modules, not callable as written
Constraint: a module command is client.<namespace>.<method>, namespaces are bf cf cms tDigest topK json ft ts
Directive: take the reply type from transformReply in source, not the d.ts, which expands aliases into unreadable types
Gaps: 43 parameter disagreements and 44 Any returns are not fixed
Recheck: when node-redis ships a release after 6.3.1, rerun the declaration check
Ticket: DOC-7267
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history (5 new this commit):

Memory updated at 95e83a0

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7267

@andy-stark-redis
andy-stark-redis merged commit a23ed3b into main Nov 6, 2026
109 checks passed
@andy-stark-redis
andy-stark-redis deleted the DOC-7267-node-redis branch November 6, 2026 10:44
andy-stark-redis added a commit that referenced this pull request Nov 6, 2026
…lient-quirks

The DOC-7267 cleanup PRs (#4482, #4484, #4486) left their durable findings only in commit
bodies, where a future sweep would not see them before authoring. They now sit in the
per-client sections of the command-api-mapping skill's quirks reference: node-redis lists every
command under an uppercase and a camelCase key and modules are client.<namespace>.<method>;
reply types come from source, not the .d.ts; ten redis-py methods raise NotImplementedError;
an NRedisStack async entry is never a copy of the sync one, and the scan overloads return
IAsyncEnumerable.

Directive: when a sweep finds a client convention that is not in client-quirks.md, add it there in the same PR
Ticket: DOC-7267
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants