# Contributor handoff — redis/redis

> Canonical page: https://codevetter.com/unpack/redis/agent-handoff

# Contributor handoff — redis/redis

Scanned commit c3215f019a4c11c35d438f241114e94730fe39e5 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Read `src/server.h` (the 4,976-line master header that every `.c` file includes) and `src/server.c` before touching anything — nearly all global state hangs off the `server` struct declared there. Never hand-edit `src/commands.def`; edit the JSON spec and regenerate. Prefer adding config via the `static_configs[]` table and features via the module API over touching the dispatch path. Build with `make REDIS_CFLAGS='-Werror'` to match CI, and validate with `./runtest --tags -slow` plus `./runtest-moduleapi` if you touched `src/module.c`. Be aware this tree's root `Makefile` is not upstream's: plain `make` runs `scripts/build.sh`, which builds `src/` and then every cloned external module.
- Read first, in order: `src/server.h` (all struct/constant/prototype definitions), `src/server.c` (`main`, `initServer`, `processCommand`, `call`, `beforeSleep`, `serverCron`), `src/networking.c` (client lifecycle and RESP parsing), and `src/config.c` (`static_configs[]`). — [src/server.h](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/server.h) [src/server.c](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/server.c) [src/networking.c](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/networking.c) [src/config.c](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/config.c)
- Never edit `src/commands.def` by hand. Edit `src/commands/<cmd>.json`, run `make commands.def` (which invokes `utils/generate-command-code.py`), and commit both — CI's `validate commands.def up to date` step diffs the regenerated output and fails on drift. — [src/Makefile#L503-504](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/Makefile#L503-L504) [.github/workflows/ci.yml#L22-28](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/ci.yml#L22-L28)
- Match CI's build flags locally: `make REDIS_CFLAGS='-Werror' BUILD_TLS=yes`. Use `REDIS_CFLAGS`/`REDIS_LDFLAGS` rather than `CFLAGS`/`LDFLAGS` — the src/Makefile header notes that plain CFLAGS propagate into the `deps/` builds (jemalloc, Lua, hiredis) too. — [src/Makefile#L9-17](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/Makefile#L9-L17) [.github/workflows/ci.yml#L15-17](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/ci.yml#L15-L17)
- Test commands to run: `make -C src test` (= `./runtest`) for the default suite, `./runtest --tags -slow --dump-logs` to match CI exactly, `./runtest --single unit/type/hash` to scope, `make -C src test-modules`, `test-cluster`, `test-sentinel` for the other three harnesses. — [src/Makefile#L529-541](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/Makefile#L529-L541) [runtest](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/runtest) [.github/workflows/ci.yml#L18-21](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/ci.yml#L18-L21)
- Trap — building Redis alone is `make -C src all`, not `make`. The root `Makefile`'s default goal is `build`, which runs `scripts/build.sh` and will additionally try to build every module cloned under `modules/*/src`. Use `make build redis` or `make build core` to skip modules. — [Makefile#L13-15](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/Makefile#L13-L15) [Makefile#L105-108](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/Makefile#L105-L108) [scripts/build.sh#L4-12](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/scripts/build.sh#L4-L12)
- Trap — on macOS you must use `gmake` (GNU Make ≥ 4.x), not Apple's `/usr/bin/make` 3.81. The root Makefile explicitly `export MAKE`s so recipe shells inherit the right binary, precisely because non-interactive recipe shells otherwise PATH-resolve to make 3.81. — [Makefile#L3-11](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/Makefile#L3-L11) [modules/MODULES.md#L9-13](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/modules/MODULES.md#L9-L13)
- Trap — adding a new object type requires coordinated edits to `rdb.c`, `aof.c`, `db.c` (`obj_type_name`, `copyCommand`), `debug.c` (`xorObjectDigest`, `serverLogObjectDebugInfo`) and `defrag.c` (`defragKey`), per the checklist comment in server.h. Nothing enforces this at compile time. — [src/server.h#L928-940](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/server.h#L928-L940)
- Trap — `redis.conf` is the tracked, hand-edited core config with no markers; `redis-full.conf` is untracked and regenerated by `scripts/sync-redis-conf.sh` on every `make modules-update`. Never hand-add `loadmodule` lines to `redis.conf`. — [modules/MODULES.md#L32-38](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/modules/MODULES.md#L32-L38) [scripts/sync-redis-conf.sh](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/scripts/sync-redis-conf.sh) [redis.conf](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/redis.conf)
- Safe edit boundary — prefer adding behaviour through the module API (`RM_CreateCommand`, module data types, command filters, server-event hooks) or a new `static_configs[]` entry over modifying `processCommand()`/`call()`, which carry assertions and propagation invariants. — [src/module.c#L1348](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/module.c#L1348) [src/config.c#L3445](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/config.c#L3445) [src/server.c#L4151-4230](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/server.c#L4151-L4230)
- Do not touch `deps/` — it is vendored third-party source (jemalloc, lua, hiredis, linenoise, hdr_histogram, fpconv, xxhash, tre) built by separate targets listed in `DEPENDENCY_TARGETS`. Changes there are lost on dependency refresh. — [deps/](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/deps/) [src/Makefile#L39](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/Makefile#L39) [deps/README.md](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/deps/README.md)
- Style convention — the codebase is C99/gnu11 compiled with `-pedantic -Wall -W -Wstrict-prototypes -Werror=deprecated-declarations`, and falls back to `-std=c99` (also setting `SKIP_VEC_SETS=yes`) when the compiler lacks C11 `_Atomic`. New code must build under both. — [src/Makefile#L44-70](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/Makefile#L44-L70)
- Licensing convention — every new source file carries the Redis tri-license header (RSALv2 / SSPLv1 / AGPLv3); contributions are governed by the Software Grant and CLA reproduced in full in CONTRIBUTING.md. — [CONTRIBUTING.md#L1-10](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/CONTRIBUTING.md#L1-L10) [src/t_array.c#L1-8](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/t_array.c#L1-L8) [LICENSE.txt](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/LICENSE.txt)
- Security convention — do not report vulnerabilities through normal issues; SECURITY.md directs reports to the Redis Vulnerability Disclosure Program or GitHub's 'Report a Vulnerability', and notes that 32-bit, non-Linux and outdated-toolchain findings may be ruled out of scope. — [SECURITY.md](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/SECURITY.md)
- When adding or changing a command's reply, update the reply schema in its `src/commands/*.json` — `.github/workflows/reply-schemas-linter.yml` triggers on changes to those files and validates them with ajv via `utils/reply_schema_linter.js`. — [.github/workflows/reply-schemas-linter.yml#L1-25](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/reply-schemas-linter.yml#L1-L25) [utils/reply_schema_linter.js](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/utils/reply_schema_linter.js)
- For debugging a failing Tcl test, `./runtest --dump-logs` plus `tests/support/util.tcl`'s helpers and the `s <field>` / `S <index> <field>` INFO accessors in test_helper.tcl are the standard tools; servers spawn on ports starting at `::baseport 21111`. — [tests/test_helper.tcl#L239-260](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/test_helper.tcl#L239-L260) [tests/test_helper.tcl#L45-50](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/test_helper.tcl#L45-L50) [tests/support/util.tcl](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/support/util.tcl)
- Bumping a bundled module is a one-line change: edit `ref:` in `modules/modules.yaml` then run `make modules-update <name>`. Ref kind is resolved dynamically against the remote in the order tag → branch → commit, and an unmatched ref errors out with 'unknown ref kind'. — [modules/modules.yaml#L15-35](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/modules/modules.yaml#L15-L35) [scripts/modules-update.sh](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/scripts/modules-update.sh)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
