Skip to content

v0.1.3 Production Readiness — Phases 87-91#64

Merged
pilotspacex-byte merged 20 commits into
mainfrom
v0.1.3-production-readiness
Apr 9, 2026
Merged

v0.1.3 Production Readiness — Phases 87-91#64
pilotspacex-byte merged 20 commits into
mainfrom
v0.1.3-production-readiness

Conversation

@TinDang97
Copy link
Copy Markdown
Collaborator

@TinDang97 TinDang97 commented Apr 9, 2026

Summary

First batch of the v0.1.3 Production Readiness milestone (Phases 87-91). Focuses on correctness hardening, toolchain modernization, and code hygiene — no new user-facing features except the Production Contract document.

Merge order: This PR is rebased on top of feat/multi-part-aof (PR #63). Merge PR #63 first, then this PR will apply cleanly.

Phase 87: Production Contract

  • Published docs/PRODUCTION-CONTRACT.md — Moon's v1.0 promises: per-command-class SLOs (provisional), supported platform matrix (Linux aarch64 primary, x86_64 secondary), durability mode semantics, and a 49-item GA Exit Criteria checklist that Phases 88-100 tick off.
  • Added docs/runbooks/ stub directory for Phase 99.

Phase 88: Rust 1.85 → 1.94.0

  • MSRV bumped in Cargo.toml, rust-toolchain.toml committed for reproducible builds.
  • All CI workflows pinned to dtolnay/rust-toolchain@1.94.0.
  • CLAUDE.md OrbStack provisioning updated.
  • 16 clippy::manual_is_multiple_of lint fixes across 10 files.

Phase 89: Correctness Hardening — Fuzz & Loom

  • 7 cargo-fuzz targets: resp_parse, resp_parse_differential, inline_parse, wal_v3_record, rdb_load, gossip_deser, acl_rule.
  • Loom model tests for ResponseSlot fill/poll/reset state machine under all thread interleavings.
  • Fuzz CI workflow (.github/workflows/fuzz.yml): 15 min/target on PR, 6h nightly.
  • Bug fix (found by fuzzer in 10 seconds): RESP3 Set (~), Push (>), Map (%) handlers in parse_frame_zerocopy did atoi().unwrap() as usize without checking for -1 (null) or negative counts → capacity overflow crash. Fixed with null check + negative guard + capacity clamp. Regression tests added.
  • Bug fix chore(deps): bump actions/download-artifact from 4 to 8 #2: eliminated all remaining unwrap() from parse_frame_zerocopy — replaced with safe .unwrap_or / saturating patterns. Second fuzz crash (bare LF without CR causing position divergence) resolved.

Phase 90: Unsafe Audit & Panic Eradication

  • 156/156 unsafe blocks now have // SAFETY: comments explaining invariants. CI-enforced by scripts/audit-unsafe.sh.
  • Published docs/security/unsafe-audit.md — 7 categories of unsafe usage with risks and mitigations.
  • All hot-path unwrap()/expect() calls annotated with #[allow(clippy::unwrap_used)] + justification. Ratchet script (scripts/audit-unwrap.sh) prevents new unannotated unwraps.
  • Safety audit CI job added to ci.yml.

Phase 91: Code Hygiene — File Splits

  • 8 oversize files split into read/write submodules (all ≤ 1500 lines per file):
    • sorted_set.rs (3092 → mod 1347 + read 1270 + write 518)
    • stream.rs (2028 → mod 694 + read 533 + write 827)
    • string.rs (1867 → mod 871 + read 376 + write 643)
    • set.rs (1618 → mod 529 + read 742 + write 404)
    • list.rs (1521 → mod 486 + read 609 + write 527)
    • hash.rs (1353 → mod 475 + read 549 + write 345)
    • db.rs (1655 → 1469 + db_read 243) — multi-part-aof's clear()/insert_for_load()/recalculate_memory()/reserve() correctly placed in main db.rs (write ops), db_read.rs holds read-only Ref enums
    • bptree.rs (1667 → 1399 + bptree_iter 343)
    • hnsw/graph.rs (1555 → 1220 + graph_serde 381)
  • Zero public API changes — all re-exports maintain same import paths.

Additional fixes

  • CONTRIBUTING.md and API-CONTRACT.md added
  • All dependencies updated to latest compatible versions
  • Rust toolchain bumped from 1.94.0 to 1.94.1

Verification

  • cargo clippy -- -D warnings: clean (both default and tokio features)
  • cargo clippy --no-default-features --features runtime-tokio,jemalloc -- -D warnings: clean
  • 1881+ unit tests pass (includes 4 new parser regression tests)
  • scripts/audit-unsafe.sh: 156/156 SAFETY comments, 0 violations
  • Rebased cleanly onto feat/multi-part-aof HEAD with 0 conflicts

Test plan

  • Merge PR feat: multi-part AOF persistence + fast RDB loader #63 (multi-part-aof) first
  • CI passes (fmt, clippy both features, test, MSRV, safety audit)
  • Fuzz CI workflow triggers on PR and doesn't crash in 15 min
  • No public API breakage (all existing command paths resolve)
  • db.rs bulk-load methods (clear, insert_for_load, reserve, recalculate_memory) are in correct file with doc comments + debug_assert

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 9, 2026

Important

Review skipped

Too many files!

This PR contains 298 files, which is 148 over the limit of 150.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 75c85147-1563-4b15-8fe1-a9431d4a23fc

📥 Commits

Reviewing files that changed from the base of the PR and between 36f255a and 2d820a6.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • fuzz/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (298)
  • .github/workflows/ci.yml
  • .github/workflows/claude-code-review.yml
  • .github/workflows/codeql.yml
  • .github/workflows/fuzz.yml
  • .github/workflows/release.yml
  • .planning
  • CHANGELOG.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • Cargo.toml
  • README.md
  • docs/API-CONTRACT.md
  • docs/PRODUCTION-CONTRACT.md
  • docs/runbooks/README.md
  • docs/security/unsafe-audit.md
  • fuzz/Cargo.toml
  • fuzz/artifacts/resp_parse/crash-bc6d3eb6b9193b3f9f7844b01d2356dff5b38ee5
  • fuzz/artifacts/resp_parse/crash-d910d9fd212b15baaaea4eefbe68be05fb2dc3d9
  • fuzz/artifacts/resp_parse/crash-ef57cf8827ceb235423cc48cfa3845d2c94cf9cc
  • fuzz/artifacts/resp_parse/minimized-from-bc6d3eb6b9193b3f9f7844b01d2356dff5b38ee5
  • fuzz/corpus/inline_parse/inline_get
  • fuzz/corpus/inline_parse/inline_set
  • fuzz/corpus/resp_parse/00009eed8c60425ea353d0b9b21695b01ab41756
  • fuzz/corpus/resp_parse/001d928397e149bb48dc7fc52408fd380793f3e1
  • fuzz/corpus/resp_parse/0097a76c1cf17ddd23fbdbeba3000b4aad78cbad
  • fuzz/corpus/resp_parse/00a8fae0e6095f32c56acf650987a6103e42ac20
  • fuzz/corpus/resp_parse/00b014e0c9eee725d772a8ac4a0abd027845a5f1
  • fuzz/corpus/resp_parse/00be7e542930dfd98b9eafe4e8f5accbe5991be5
  • fuzz/corpus/resp_parse/00cbac2939b3facca80c7a837e4829bee5543c2e
  • fuzz/corpus/resp_parse/00da749f2b75f2398db07fbfc0a5c8c52c7b9fca
  • fuzz/corpus/resp_parse/00eeed4dc621ecc360b44282844348f34edce581
  • fuzz/corpus/resp_parse/01028624b6c7cf7735b77dbaefcd5770bc5c17a3
  • fuzz/corpus/resp_parse/012b56830ba0c8bd49f4e9fcb5b9e24aee5974a6
  • fuzz/corpus/resp_parse/0132843a1d52f236ef6e6abc9dd82017f851e8dd
  • fuzz/corpus/resp_parse/018d4ec23a64c9f8675b7682d419cb3e9594196a
  • fuzz/corpus/resp_parse/019e56ad868a4e8e51f78be287cbfba77c82a1f5
  • fuzz/corpus/resp_parse/01c0aff47a926d86ae3ea295a0a5a0fcb24ef028
  • fuzz/corpus/resp_parse/01c0f1e0edda691b6eacd31f965527b4dfff6fb0
  • fuzz/corpus/resp_parse/01fc0304ce08a143076d38086e906872a3af7779
  • fuzz/corpus/resp_parse/01fe4739d8ed5fd51bd8d9c13f79a619d88811cf
  • fuzz/corpus/resp_parse/0219f2bafa59ee04e4a0966152a30e4a1f3e263f
  • fuzz/corpus/resp_parse/023361e985cff852fccca7a128dec76f66843e13
  • fuzz/corpus/resp_parse/0258e643a13dec59079564ab725320be416699f1
  • fuzz/corpus/resp_parse/025aeca62c64fc59f74eae92c534d48c72a9c48e
  • fuzz/corpus/resp_parse/025d36c61a11a06a64e5a0ec89dbcb10041bc1e7
  • fuzz/corpus/resp_parse/02841370f9e57a20b3e9db0aa8b4ae515e8e8bff
  • fuzz/corpus/resp_parse/0289ecdfcc1411134006fab0bb1eed750141a9af
  • fuzz/corpus/resp_parse/02bcb72028268bac54598a89c080163c46caf1b3
  • fuzz/corpus/resp_parse/03032ba734a4961bd3ae162a11b55d9903166873
  • fuzz/corpus/resp_parse/031291feb7aab9283dcda4bd1069c9c9655c2d7a
  • fuzz/corpus/resp_parse/03130d2c85b9ea732a5386f9d62fb098e28a5638
  • fuzz/corpus/resp_parse/03237f8bfd23eec10649901abac034ef86256c13
  • fuzz/corpus/resp_parse/03390ea2fcd50a0ab342e244cbbb930a20dffe68
  • fuzz/corpus/resp_parse/036b9e6b43b3e5216f2c94932506e64d8b170391
  • fuzz/corpus/resp_parse/037bed4a0312f8a901ab0cc1bdfdb3bb2e638f27
  • fuzz/corpus/resp_parse/0381dbd10dd5645aaa215139dc9d768e7fc3bb38
  • fuzz/corpus/resp_parse/03c37c09596f69c5b630e098899c8aa50f564300
  • fuzz/corpus/resp_parse/03f0938b66d2948fcce05d086035370309355b48
  • fuzz/corpus/resp_parse/04219232335aefc1c12294bb6ce58fe200648d1e
  • fuzz/corpus/resp_parse/04308e59381601ccb217ce1cb8c20ce16ab5e6ac
  • fuzz/corpus/resp_parse/044c800812874e3a1628da52dec5f3df8a2be3c4
  • fuzz/corpus/resp_parse/045289a368f9946d565c82442263e68b13eeab09
  • fuzz/corpus/resp_parse/0460b23f87b2e43ad61dc5a34bbce26ae9d62088
  • fuzz/corpus/resp_parse/04aaae1307ea21c4ba9793098882eba456798e8f
  • fuzz/corpus/resp_parse/04b89665204f3f0b4bce80c3eff656a3735e90b5
  • fuzz/corpus/resp_parse/04f7403907ecafb1482778ca6d83fc7a6d19b923
  • fuzz/corpus/resp_parse/05348021e534e0b96de9475992d016c44ff9bbed
  • fuzz/corpus/resp_parse/0538d86a1f1437bdf3e4d4de08ed923d5ffea73f
  • fuzz/corpus/resp_parse/053bba4a12260ee35a5d7ceaec64e22da09d0fda
  • fuzz/corpus/resp_parse/05a63bd48be2bf6cd3d146cc6915e279bc91f4ce
  • fuzz/corpus/resp_parse/05b8f616c5cd54a3d39e4d65706be74c7b0e0b21
  • fuzz/corpus/resp_parse/05bdb9d55723282d0cc55d098e26bbca8993355f
  • fuzz/corpus/resp_parse/05d7549ab43b889179dc863d271e858976f0c4c2
  • fuzz/corpus/resp_parse/05ef523c56f1da5aa90bc4e7daec6158293b0aa2
  • fuzz/corpus/resp_parse/061bb3501cb7f2a1f835a4103edddf05e31ca5ef
  • fuzz/corpus/resp_parse/062dfe959f081ab42ba7c5be1184075c7ecb60ee
  • fuzz/corpus/resp_parse/0635c06f2178f069ed7e95876af4f8963f39af2a
  • fuzz/corpus/resp_parse/0652bb8d799bdb9cab518bc797a4178e56f9fc72
  • fuzz/corpus/resp_parse/066234e194a1dfb5c44fabd2ae703d4a7a925c1c
  • fuzz/corpus/resp_parse/066ba65ccc554250e9a39900d39c4c7fcda91c17
  • fuzz/corpus/resp_parse/0670859201b6ed8f3f231bd8f2a2bb875bd4f403
  • fuzz/corpus/resp_parse/0683a0bf6d927c545f05ec9afb0a2ffa53bcf137
  • fuzz/corpus/resp_parse/068bbf8fb12c6f8e6e02092f7104757e0b3091b1
  • fuzz/corpus/resp_parse/069fa90c643e25bef9ccbd03d7166b63c3edce34
  • fuzz/corpus/resp_parse/06ff8eab61f294a9eebe6874aa217f1d94b91bde
  • fuzz/corpus/resp_parse/07301171d5161a3989c11db882eca33b952b69fc
  • fuzz/corpus/resp_parse/073f83e0c521d3121dfb08ff9026858a0a7b2a22
  • fuzz/corpus/resp_parse/07490fafebd9325e09f1a02d1188176982b3d029
  • fuzz/corpus/resp_parse/076486a1e49d53ae4af3fb022734ab16b2eaaf0b
  • fuzz/corpus/resp_parse/0794da8ef33f263b9cb94f9eff1a39cbb799074c
  • fuzz/corpus/resp_parse/07a2c073bebad5d7f4e4e53b8b792b87e0eeda1b
  • fuzz/corpus/resp_parse/07cd6a364dd4270e6545f0aea8bc598e307fda22
  • fuzz/corpus/resp_parse/07e44e928d50c5b5376b1d1ddfa514e2fcea9b10
  • fuzz/corpus/resp_parse/07e70321fa640c6ed867045220a13e392b9b3f78
  • fuzz/corpus/resp_parse/07ee6e9a53c0e8bdeb1c6bf43528a0a4e5d31f1d
  • fuzz/corpus/resp_parse/082eb9dce9837670fae90a072997b6198e3672be
  • fuzz/corpus/resp_parse/083fb7fed611d6a2fc5f72615ed327e17b91976c
  • fuzz/corpus/resp_parse/0850cb88cdc6aa4c3641839670ed01a9821334c3
  • fuzz/corpus/resp_parse/08549beb281d910b0dd1442da74511dcbd764151
  • fuzz/corpus/resp_parse/0895dfc93c8204a47accce88981fd173ce28073c
  • fuzz/corpus/resp_parse/089e2c1e2bd9b75e77e87b966714a37a1ead62df
  • fuzz/corpus/resp_parse/08c7f191e9312fda31d97fd043ec6dd7176ac8ce
  • fuzz/corpus/resp_parse/08cc8b3d852a7bd97b6eaaae10653a0d1d125356
  • fuzz/corpus/resp_parse/091385be99b45f459a231582d583ec9f3fa3d194
  • fuzz/corpus/resp_parse/094c6fba8ce0e774fca6f9ee4bd324c86d77a9bb
  • fuzz/corpus/resp_parse/09921f484ca96816c223ec7654775f780fe46cef
  • fuzz/corpus/resp_parse/0999b50c6830dcd12d0501a7c53d461b3b68638f
  • fuzz/corpus/resp_parse/09f0d4598a703d78bc1f03f4284f949097e1198b
  • fuzz/corpus/resp_parse/0a1b4fcc659331efedbe4f9de5514c5afbd62db3
  • fuzz/corpus/resp_parse/0a1c1818c1bad127d5d7f88a0dcc67edd2725ad2
  • fuzz/corpus/resp_parse/0a2322e8e0e91dfc4cfa53036257a8d44a602eeb
  • fuzz/corpus/resp_parse/0a2cd5670d0149b5b8cf49f7187a80e2d57fa230
  • fuzz/corpus/resp_parse/0a2f3af2813cce9c601d46bd5325679cc878554c
  • fuzz/corpus/resp_parse/0a65f65bc0c9d7b3021553df4b4401a30326b6cd
  • fuzz/corpus/resp_parse/0a6a12d0934e111e808ce6a77f9f990d4e72b376
  • fuzz/corpus/resp_parse/0a6b2b3a3970bc6b4fb90002494c81862106c3d2
  • fuzz/corpus/resp_parse/0a6da9c84bda0c17c404b5d6c72b36637b921a01
  • fuzz/corpus/resp_parse/0a87f2fe19140d8cfbb0d7c8cc479443040aaaa2
  • fuzz/corpus/resp_parse/0a8abe35e752da026dd0148c7efb794f59628c35
  • fuzz/corpus/resp_parse/0ab2e614b4a257e9f31642724f654f7c731ab824
  • fuzz/corpus/resp_parse/0ac3164b465f71182469f719e049718dcdb074de
  • fuzz/corpus/resp_parse/0aceb5b046817ea64eba474569e57edc9d86c8fd
  • fuzz/corpus/resp_parse/0add1f2da76c128a39cda1f16dd4815aa5bc69af
  • fuzz/corpus/resp_parse/0ae53be1e07ea0605ff5e18cea35d480bdb47b9f
  • fuzz/corpus/resp_parse/0af110b8969e8def907d402c26ca8f991c5154b0
  • fuzz/corpus/resp_parse/0b0dc01c5be179f2bc23566233ca9b25199abf8a
  • fuzz/corpus/resp_parse/0b1527dc8d7ee6409254df0acaec4a18848579ab
  • fuzz/corpus/resp_parse/0b3de75c0fa5f2d36a8858c884c9b7adba79295c
  • fuzz/corpus/resp_parse/0b7845dccb43a2e188824c34e1327241f34016ae
  • fuzz/corpus/resp_parse/0b8ace0870415e73bdcdb4c2f727a50188398dba
  • fuzz/corpus/resp_parse/0b8e1f1809e8fff227d0ca3cda121f62d219f854
  • fuzz/corpus/resp_parse/0bafd7783f69a6bb1b1dfe1489c51e1e1640f680
  • fuzz/corpus/resp_parse/0bb128c201781b12c6b88f5eef8e06516ad6da6d
  • fuzz/corpus/resp_parse/0bb935bd67b679062f51df3e12f51866273bdca5
  • fuzz/corpus/resp_parse/0bcbc35fe03b9d88133ce12010937ab19555bb3a
  • fuzz/corpus/resp_parse/0bf48eee9bd5721fb041a158e4af8e1e70c92fe0
  • fuzz/corpus/resp_parse/0c0767869baf004a39de23b5c7693dc1880de478
  • fuzz/corpus/resp_parse/0c2143ae6245889b8ba171a7aa261228e9e1b2bc
  • fuzz/corpus/resp_parse/0c88b2a69fee5dc15b907ee4759d17b078ca117e
  • fuzz/corpus/resp_parse/0c984bee8481d6c79606bf7a88da0c27a47c80a8
  • fuzz/corpus/resp_parse/0c9a4ca11d5fb88b2afe1be789e6fc91b7688894
  • fuzz/corpus/resp_parse/0c9bd67a3d065fca761927787584c35a1fe44393
  • fuzz/corpus/resp_parse/0c9eac8a5f50a41525a76ee5928aa95fcd8c4639
  • fuzz/corpus/resp_parse/0cc016c2ab4c2b7f6c8e449fccd9ec8109ccaf06
  • fuzz/corpus/resp_parse/0ce06ce229789896d39b26a5f5bd243b35e5fde5
  • fuzz/corpus/resp_parse/0ceb5abb2c037b909904e9a6926a8226347a2703
  • fuzz/corpus/resp_parse/0cf6816c0b6409e690498b261ab7c98ebf87f536
  • fuzz/corpus/resp_parse/0d08d026021d75e2b84d0834491261581f06f98b
  • fuzz/corpus/resp_parse/0d10cc7fe4c49203370a94d0d8114f0663c7e050
  • fuzz/corpus/resp_parse/0d1f485dae699a2ced057d2ea1d50dc146b78154
  • fuzz/corpus/resp_parse/0d307c30b806b1ae59d5540e1310c206a42a3abc
  • fuzz/corpus/resp_parse/0d3aac5ae35a4e5e0cd759272f308182ebcabf6f
  • fuzz/corpus/resp_parse/0d40af2d2a39f1a48494191a7828b46800986fb4
  • fuzz/corpus/resp_parse/0d51c9955916808de640fd6f3fe6d4b18faddb34
  • fuzz/corpus/resp_parse/0d8a8d1e3c3e3b4388ed126b92d5aae844cb3962
  • fuzz/corpus/resp_parse/0da3377b8e45022df885fdabbffb1facf5e20b89
  • fuzz/corpus/resp_parse/0dae3f0fa1c1d8618b2e84c8c9a672f2e02ad630
  • fuzz/corpus/resp_parse/0dced3f11633cf3108d126e51459db93b45cc3b3
  • fuzz/corpus/resp_parse/0dcf768578199e193d72c18ccc4f92a0ac6fb1f7
  • fuzz/corpus/resp_parse/0dd746de00b4db9056cfd2269cc35502bd03b0de
  • fuzz/corpus/resp_parse/0e135ad31cbe8bd86533100f7e92fe35c8f1eac8
  • fuzz/corpus/resp_parse/0e54da661444cc938dde99cc48f92281a7fc3f78
  • fuzz/corpus/resp_parse/0e613e453a24d4611cb4bd54fe2e8baecf80219f
  • fuzz/corpus/resp_parse/0e666f7b8fd7d52f608c89ae8205e8122631415d
  • fuzz/corpus/resp_parse/0e697533aae581835d3ecc575977113ad3c252c7
  • fuzz/corpus/resp_parse/0e93171f01ef5ead8e2af9eb042466542b5caf7b
  • fuzz/corpus/resp_parse/0e9721b0ceb08107143597a61dd58b5bcaa7fde8
  • fuzz/corpus/resp_parse/0eabaa91f93aa1ddc01baee7126cc85ed1b5c189
  • fuzz/corpus/resp_parse/0eb4c1e48d1ad533718c8739a39a2ffee4ac9359
  • fuzz/corpus/resp_parse/0ec5a6ab5e2264aa3a915cdbea161b6bd5c162cb
  • fuzz/corpus/resp_parse/0ed636aa97e3409add0ec9f4c64530c89094f548
  • fuzz/corpus/resp_parse/0eed610b34415a7bd9d59893a17aa145c8422c66
  • fuzz/corpus/resp_parse/0efdb8425200da3570871438c522a00171435e3c
  • fuzz/corpus/resp_parse/0f032ae35ddee9bedcab2be7eea82f164256df73
  • fuzz/corpus/resp_parse/0f2f518838ea2b3e4ac3e0cc00a1553c2d90c7d5
  • fuzz/corpus/resp_parse/0f4a2dd4afe3f2df5e895c7e59ce2c48c0a3e051
  • fuzz/corpus/resp_parse/0f4dba5b9c6ffe96a7d749ef0015bfe91ca3d233
  • fuzz/corpus/resp_parse/0f887cd1760378042695d68e9ea20baf0e052c6d
  • fuzz/corpus/resp_parse/0fee2e09009deb5afcaa633836baa80cc7f8dc45
  • fuzz/corpus/resp_parse/102f660fe321161b054713944a4a12a0f237d921
  • fuzz/corpus/resp_parse/10403be9462a262a64be27c3a5312aa0a9d30d54
  • fuzz/corpus/resp_parse/104c93cbd1d10f45fec26239dda73115968d0d85
  • fuzz/corpus/resp_parse/106585cff95fd12114ec27d563b5fb4d8c7f3476
  • fuzz/corpus/resp_parse/106f5da76aa476d4803364b48f7aae8b800ec2f6
  • fuzz/corpus/resp_parse/107a3b59f305cbcb7dca471099c0bff087e6b8fc
  • fuzz/corpus/resp_parse/1081bb766feb46cb0350e295de333f49b5bdbcab
  • fuzz/corpus/resp_parse/108eb9202baa090db74c0e57a0da590f796dad93
  • fuzz/corpus/resp_parse/10d41d465fbb636e523ac0983bb875687fdb56e8
  • fuzz/corpus/resp_parse/110e10eed3aed731f350f205fd8b35ea3ad064bf
  • fuzz/corpus/resp_parse/115098bf81e1764f67979505237bcb1f72a01a1f
  • fuzz/corpus/resp_parse/115fc56e49f46b2d608ac8c4df5fa825526ac942
  • fuzz/corpus/resp_parse/118852e0ebedb93fab90f9fb5232b7245cd6bbb4
  • fuzz/corpus/resp_parse/11c2b0e40039d61917f9bffbbb51039432d37c63
  • fuzz/corpus/resp_parse/11dbaa70fc02076fdeb49a1e5d04ce02b570eda9
  • fuzz/corpus/resp_parse/11de62fb20522deeb44cc9830b91ac3cb6ef9b4e
  • fuzz/corpus/resp_parse/11ed4bfa0b4fdf1d10fc8dac10c564a8473228cc
  • fuzz/corpus/resp_parse/11efc0c58842ea69c6c39a99c5ea9fbb5c9952f0
  • fuzz/corpus/resp_parse/1226b4b1247715dc8cd1ddcb7110f08b575860ea
  • fuzz/corpus/resp_parse/122b12a12e97fcce6d133ef4953bf9963ca6888b
  • fuzz/corpus/resp_parse/12420e36d1ff4a55fe65a166a1c20001828db369
  • fuzz/corpus/resp_parse/128ca079152d1e6682a4d9964e449c9fe4f6c388
  • fuzz/corpus/resp_parse/12df27d1c07739b3c55947db65929f5861a82879
  • fuzz/corpus/resp_parse/12fabc657667ff54eddf5fd83bd9f268b5d10e27
  • fuzz/corpus/resp_parse/12fd51fb8e575cb95de695f8a24c7e3a675a278b
  • fuzz/corpus/resp_parse/132de89b380420f6bb53e7ce1e4850777bdc1f32
  • fuzz/corpus/resp_parse/13551e6a917fa9ac0193750b09a1110a67edc76f
  • fuzz/corpus/resp_parse/1358c1d89cc05c8d1fb2c143c092a6e3a1f123f0
  • fuzz/corpus/resp_parse/13739d54891261082eda1d28714e050a44db1fcb
  • fuzz/corpus/resp_parse/1374b4f0c8db26a1dfa4de0102aae736d0d7d8a8
  • fuzz/corpus/resp_parse/13b79733850cbca0ac4fd556a8164418b9f5370a
  • fuzz/corpus/resp_parse/13e95eb21676e4ba239c62053b7dd160b55fc028
  • fuzz/corpus/resp_parse/13ea1ed73812d6a1b43168a0b0b64d2ed9bd6294
  • fuzz/corpus/resp_parse/1401955c55ad5c5ca4fa7aad8619a1326151c7df
  • fuzz/corpus/resp_parse/1425f5587d55fc187da6e4134dd1826a9bd30ce7
  • fuzz/corpus/resp_parse/14292fc53290c0baaad46e51ffebfc555c07660e
  • fuzz/corpus/resp_parse/14879b26e61a6bc1ae8b8cb61b32f4faafac6ca7
  • fuzz/corpus/resp_parse/14a0880c52df299a39ee978f8ef5a61b304dd0bd
  • fuzz/corpus/resp_parse/14cf17b5afc0ed0425a3b1d5ba064e9cd37a7fd3
  • fuzz/corpus/resp_parse/14d725281894d5e1c50a0509f4c83a49b132d814
  • fuzz/corpus/resp_parse/155726dded85074c0f1f13422875407bdeae4109
  • fuzz/corpus/resp_parse/1575f64caf16d2b0b473d5a91423353f10978eb8
  • fuzz/corpus/resp_parse/1577c36aa5e565bad3f9a8922da2e9ff8757cba2
  • fuzz/corpus/resp_parse/158719f4a52530cff855ed5110a1b80d46252c0e
  • fuzz/corpus/resp_parse/15b333fd305725f609fadc6da529d6c84c086060
  • fuzz/corpus/resp_parse/15f0c0dd61db631d128180af9aa2cb741c2b1159
  • fuzz/corpus/resp_parse/15f7c6db66327c72e1403cf5fd2143f6df9bd72e
  • fuzz/corpus/resp_parse/16359919c5c5e88425d4ffa619174494af934a8b
  • fuzz/corpus/resp_parse/16463c4ce0d47db59cfab3200f99acae5b2ca97d
  • fuzz/corpus/resp_parse/16a801be65c26a2fda6951d756d0c8d2a4ac1d2e
  • fuzz/corpus/resp_parse/16afaa86ad45564b0d8c002067873613b8cbe5c9
  • fuzz/corpus/resp_parse/16cb92e79df5bd1ca0ffb769cddb910cc61edf90
  • fuzz/corpus/resp_parse/16cebbb74c2448743bcf091c92df1782bf475f32
  • fuzz/corpus/resp_parse/16ecffee7f505158dd9b71f7fef6eb2c8c5ce4cb
  • fuzz/corpus/resp_parse/16fa8500861c4f14a5cd10acd0564771aca9252b
  • fuzz/corpus/resp_parse/170140f2e0e1fa5947ee0361ef9d930c3cbcf47b
  • fuzz/corpus/resp_parse/1724b2814d9f46a4e220afcdbc2c26169aa988ef
  • fuzz/corpus/resp_parse/17419b73539f0f67e4933cc284a6cac286b7ba6b
  • fuzz/corpus/resp_parse/1742040b36cecd1ee2ef8227c5e162cb753cbed3
  • fuzz/corpus/resp_parse/1746acd6a0d0db58dfdc9fe005d04cfdcb191718
  • fuzz/corpus/resp_parse/1752b0004e85775368919b0ba650abcddea5ab0f
  • fuzz/corpus/resp_parse/177113e18c465fec5c064e78175de76c624af5e6
  • fuzz/corpus/resp_parse/177217773b026c2766974e24053c0816fa305678
  • fuzz/corpus/resp_parse/1791729a130040bb3773e95c0b9536639f22cd16
  • fuzz/corpus/resp_parse/17b6d8c17495081ea2d3112831d598838dc279eb
  • fuzz/corpus/resp_parse/17c1c3a08a77cbce00321528578dc0b29d37e21d
  • fuzz/corpus/resp_parse/17d2956b1e21145eedcd6fbd1b7d24cdf882ed12
  • fuzz/corpus/resp_parse/17e25e70b2d37cfccde952ddff3f13af7ae0ca8a
  • fuzz/corpus/resp_parse/1821a0e1d15168fc8612968296cf656b9dffbf04
  • fuzz/corpus/resp_parse/18383c6035f99ac7567de3a2cf19b7b118375202
  • fuzz/corpus/resp_parse/185bbbce7514c73792266121c8800f08fc60608a
  • fuzz/corpus/resp_parse/187106e04c02cabdc326a8dca49614d98c792ef1
  • fuzz/corpus/resp_parse/187fe3b480ec179c97616d5a0e44983ae0a61a42
  • fuzz/corpus/resp_parse/18a43f11f28dc0fc0daa0a92e20989758e5d9143
  • fuzz/corpus/resp_parse/18deebc53b2ab9b7b5eaaa6d816ddccee7d7031b
  • fuzz/corpus/resp_parse/192408eda165de8435961b37e0dab62a6dcff0b2
  • fuzz/corpus/resp_parse/1935303b275b51233fa164f079a2fb04d7feb835
  • fuzz/corpus/resp_parse/19371bb5c71fc24c40c89fd4507363850c0967aa
  • fuzz/corpus/resp_parse/193772e4446c206d5a068cb9134eb985cdc667a0
  • fuzz/corpus/resp_parse/193fc46598e2381ac4cdbb5d938a0a2aa8ea8335
  • fuzz/corpus/resp_parse/19b91572719d2571bcd029805a600aa1a204ff80
  • fuzz/corpus/resp_parse/19cd406214791eda14f5385071fa6c23dc25db83
  • fuzz/corpus/resp_parse/19d0304aed4cd443db27b6b22390a40f0769c8f7
  • fuzz/corpus/resp_parse/19d385ea60e651bfe6ad46015c0fa9357d27bf8d
  • fuzz/corpus/resp_parse/19dd104353acadfc45b4621a60c6847f9e534ccc
  • fuzz/corpus/resp_parse/19ec803a20e45e24de1d79a4bb58095b0d99f832
  • fuzz/corpus/resp_parse/1a1a6c5a25816a6a1349eea398dea34533cf4a6c
  • fuzz/corpus/resp_parse/1a1accea448c4492db2b8cef64e30c7f1fb24fc7
  • fuzz/corpus/resp_parse/1a29f0150d8e6a16b558b9bd4cd22d49fb005ddd
  • fuzz/corpus/resp_parse/1a34ab43f1b754e6226bac8732e843ac37c07edf
  • fuzz/corpus/resp_parse/1a4df2754bc9731c39466c20b4e340c87756a110
  • fuzz/corpus/resp_parse/1a5412b943baf44b9b264ab17b07c6cfac428c2a
  • fuzz/corpus/resp_parse/1a5b8a8d2e213088e50c90a724425e5e19fe6375
  • fuzz/corpus/resp_parse/1acf06e1c895d2ba2c69d55e14e2169c4bed16ab
  • fuzz/corpus/resp_parse/1ad56ab29cf15c5da7cd46504a0cf3c206e0fa96
  • fuzz/corpus/resp_parse/1ae4050fa92c62d27185f47d42442d49f2ad8768
  • fuzz/corpus/resp_parse/1b28fbc39f33bf8e1774e921e142c33662816b57
  • fuzz/corpus/resp_parse/1b2cbce1a166e38c648ecbd682b2a195088c584e
  • fuzz/corpus/resp_parse/1b2d45510f2e633dca8ae29785842a9be2f41aa6
  • fuzz/corpus/resp_parse/1b741ee7e77eb6f7543ea7c398c8e550362d9033
  • fuzz/corpus/resp_parse/1b75aa24f743a80bb85cd8cc921c66f779783f1f
  • fuzz/corpus/resp_parse/1b8271baf64bdf41511f48440604dc4f3d9e910a
  • fuzz/corpus/resp_parse/1b8a5f1e5565af607278c77322079c1666f05e8d
  • fuzz/corpus/resp_parse/1bca4c5bba7b2eb8ea38a8bcbec2d5971aeee43a
  • fuzz/corpus/resp_parse/1bdd06964e19fba7a59f51680ec0248951fafaa9
  • fuzz/corpus/resp_parse/1be49290cb214ae2e02ac0c5443d2b2aae5c8e1c
  • fuzz/corpus/resp_parse/1c2320a304de64d8e10eb93f746ad945058cccab
  • fuzz/corpus/resp_parse/1c69e3fb1692af61fa1dccc4f8b428591fcbf8ad
  • fuzz/corpus/resp_parse/1c9b1da306d0e63728e397b83a72a1282c4502c6
  • fuzz/corpus/resp_parse/1cbdb1850a7ee8e31646a2836e7fb540be760638
  • fuzz/corpus/resp_parse/1ccb02cf3e526925ae7b1fdcf9a15eb0f30f2c95
  • fuzz/corpus/resp_parse/1cf624806c04aeb16a470b9c8e2d6ea1b8638954
  • fuzz/corpus/resp_parse/1cf6d1288cc354eb7258c9d68f4b08c2bf33d977
  • fuzz/corpus/resp_parse/1d1420d6d4570dea2b1e9e46d5a818065b00a9ad
  • fuzz/corpus/resp_parse/1d46dc384288c507bbef7669e98740238dbd6768
  • fuzz/corpus/resp_parse/1d67693bd5ed337cec93a43eea8083a42f017465
  • fuzz/corpus/resp_parse/1d70fc5a86c02428eac241ee7839d67c2e190c3e
  • fuzz/corpus/resp_parse/1e040bb22c35cb17d4041017efd8f6fc0d3e04d6
  • fuzz/corpus/resp_parse/1e100db335d4a5d82aeb0e2445c89f30aa5adacd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v0.1.3-production-readiness

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

v0.1.3 Production Readiness — Phases 87-91: Correctness Hardening, Toolchain Modernization, and Code Hygiene Refactoring

✨ Enhancement 🧪 Tests

Grey Divider

Walkthroughs

Description
  **v0.1.3 Production Readiness — Phases 87-91**: Comprehensive production hardening milestone with
  correctness improvements, toolchain modernization, and major code hygiene refactoring.
  **Phase 87: Production Contract**
• Published docs/PRODUCTION-CONTRACT.md with v1.0 promises: per-command-class SLOs, supported
  platform matrix, durability semantics, and 49-item GA Exit Criteria checklist
  **Phase 88: Rust 1.85 → 1.94.0 Upgrade**
• MSRV bumped with rust-toolchain.toml committed for reproducible builds
• All CI workflows pinned to dtolnay/rust-toolchain@1.94.0
• 16 clippy::manual_is_multiple_of lint fixes across 10 files
  **Phase 89: Correctness Hardening — Fuzz & Loom**
• 7 cargo-fuzz targets: resp_parse, resp_parse_differential, inline_parse, wal_v3_record,
  rdb_load, gossip_deser, acl_rule
• Loom model tests for ResponseSlot fill/poll/reset state machine under all thread interleavings
• **Critical bug fix**: RESP3 Set/Push/Map handlers in parse_frame_zerocopy now validate for -1
  (null) and negative counts before capacity operations, preventing overflow crashes. 4 regression
  tests added.
• Fuzz CI workflow (.github/workflows/fuzz.yml): 15 min/target on PR, 6h nightly
  **Phase 90: Unsafe Audit & Panic Eradication**
• 156/156 unsafe blocks now have // SAFETY: comments explaining invariants, CI-enforced by
  scripts/audit-unsafe.sh
• Published docs/security/unsafe-audit.md with 7 categories of unsafe usage, risks, and
  mitigations
• All hot-path unwrap()/expect() calls annotated with #[allow(clippy::unwrap_used)] +
  justification
• Ratchet script (scripts/audit-unwrap.sh) prevents new unannotated unwraps
  **Phase 91: Code Hygiene — File Splits (8 oversize files → modular subfiles)**
• sorted_set.rs (3092 → mod 1347 + read 1270 + write 518): Dual-structure consistency helpers,
  comprehensive range query utilities
• stream.rs (2028 → mod 694 + read 533 + write 827): Consumer group management,
  XADD/XTRIM/XGROUP/XREADGROUP/XCLAIM implementations
• string.rs (1867 → mod 871 + read 376 + write 643): Numeric parsing/formatting helpers,
  SET/GET/INCR/APPEND operations
• set.rs (1618 → mod 529 + read 742 + write 404): Set operations with glob matching and collection
  helpers
• list.rs (1521 → mod 486 + read 609 + write 527): Index resolution, LPUSH/RPUSH/LRANGE/LMOVE
  operations
• hash.rs (1353 → mod 475 + read 549 + write 345): Field operations and scan functionality
• db.rs (1655 → 1419 + db_read 243): Ref enum extraction with public re-exports maintaining API
  compatibility
• bptree.rs (1667 → 1399 + bptree_iter 343): Internal API exposed for iterator implementation
• hnsw/graph.rs (1555 → 1220 + graph_serde 381): Serialization logic extracted
• Zero public API changes — all re-exports maintain same import paths
• 1881/1881 unit tests pass (4 new parser regression tests added)
Diagram
flowchart LR
  A["Production Contract<br/>Phase 87"] --> B["Rust 1.94.0<br/>Phase 88"]
  B --> C["Fuzz & Loom<br/>Phase 89"]
  C --> D["Bug Fix:<br/>RESP3 Validation"]
  C --> E["Unsafe Audit<br/>Phase 90"]
  E --> F["156 SAFETY Comments<br/>Panic Eradication"]
  F --> G["Code Hygiene<br/>Phase 91"]
  G --> H["8 Files Split<br/>≤1500 lines each"]
  H --> I["1881 Tests Pass<br/>Zero API Changes"]
Loading

Grey Divider

File Changes

1. src/command/sorted_set/mod.rs ✨ Enhancement +1347/-0

Sorted set module refactoring with shared helpers and tests

• New module file created as part of Phase 91 code hygiene refactoring, splitting the original
 3092-line sorted_set.rs into modular subfiles
• Contains shared helpers for sorted set operations: format_score(), zadd_member(),
 zrem_member(), score/lex boundary parsing, and range query utilities
• Implements dual-structure consistency helpers (zadd_member, zrem_member) to maintain HashMap
 and BPTree synchronization
• Includes comprehensive test suite (1881 tests total) covering ZADD, ZREM, ZSCORE, ZCARD, ZINCRBY,
 ZRANK, ZREVRANK, ZPOPMIN, ZPOPMAX, ZSCAN, ZRANGE variants, ZCOUNT, ZLEXCOUNT, ZUNIONSTORE,
 ZINTERSTORE, and dual-structure consistency validation

src/command/sorted_set/mod.rs


2. src/command/sorted_set/sorted_set_read.rs ✨ Enhancement +1270/-0

Sorted set read-only command implementations and variants

• New file containing all read-only sorted set command implementations extracted from original
 sorted_set.rs
• Implements mutable-path read commands: zscore(), zcard(), zrank(), zrevrank(), zscan(),
 and range commands (zrange(), zrevrange(), zrangebyscore(), zrevrangebyscore(), zcount(),
 zlexcount())
• Provides read-only variants (*_readonly() functions) for RwLock read-path access with
 SortedSetRef abstraction supporting BPTree, Listpack, and Legacy encodings
• Handles complex argument parsing for BYSCORE, BYLEX, REV, WITHSCORES, LIMIT, and MATCH options
 across all range query variants

src/command/sorted_set/sorted_set_read.rs


3. src/storage/db.rs ✨ Enhancement +19/-239

Database module refactoring with ref enums extracted

• Removed 236 lines of HashRef, ListRef, SetRef, and SortedSetRef enum definitions and
 implementations (moved to new db_read.rs module)
• Added pub use re-exports from db_read module to maintain public API compatibility
• Added #[allow(clippy::unwrap_used)] annotations with justification comments to 13 methods where
 unwrap() is safe due to guaranteed preconditions (e.g., after insert() or confirmed type checks)
• Removed unused imports (BTreeMap, OrderedFloat, Listpack) no longer needed after ref enum
 extraction

src/storage/db.rs


View more (116)
4. src/storage/dashtable/simd.rs 📝 Documentation +3/-0

Safety documentation for SIMD unsafe blocks in tests

• Added three // SAFETY: comments to unsafe blocks in test functions explaining SSE2 baseline
 availability and Group alignment guarantees
• Comments document that SSE2 is baseline on x86_64 and Group is 16-byte aligned, justifying safety
 of g.match_h2() and g.match_empty_or_deleted() calls

src/storage/dashtable/simd.rs


5. fuzz/corpus/resp_parse/36f3e7262207e1d31913f0049a1a6772f7fbf1a8 🧪 Tests +1/-0

Fuzz corpus test case for RESP parser

• New fuzz corpus file added for resp_parse fuzzing target as part of Phase 89 correctness
 hardening
• Contains minimal test case for RESP protocol parser fuzzing

fuzz/corpus/resp_parse/36f3e7262207e1d31913f0049a1a6772f7fbf1a8


6. src/command/string/mod.rs ✨ Enhancement +871/-0

String command module refactoring with comprehensive test coverage

• Created new modular structure splitting string command handlers into string_read and
 string_write submodules with public re-exports
• Implemented shared helper functions: parse_i64, parse_positive_i64, parse_f64, and
 format_float for numeric parsing and formatting
• Added comprehensive test suite (60+ tests) covering GET/SET, MGET/MSET, INCR/DECR, INCRBYFLOAT,
 APPEND, STRLEN, SETNX, SETEX, PSETEX, GETSET, GETDEL, GETEX, GETRANGE, SETRANGE, and SUBSTR
 operations
• Tests verify correctness of TTL preservation, type checking, edge cases, and Redis-compatible
 behavior

src/command/string/mod.rs


7. src/command/stream/stream_write.rs ✨ Enhancement +827/-0

Stream write operations and consumer group management implementation

• Implemented stream write command handlers: xadd, xtrim, xdel, xgroup, xreadgroup,
 xack, xclaim, xautoclaimxadd supports NOMKSTREAM, MAXLEN/MINID trimming strategies with approximate/exact modifiers, and
 auto-ID generation with * or ms-* patterns
• xgroup handles CREATE, DESTROY, SETID, CREATECONSUMER, DELCONSUMER subcommands with MKSTREAM
 support
• xreadgroup implements consumer group reading with COUNT and NOACK options, supporting both new
 entries (>) and pending entry replay
• xclaim and xautoclaim enable consumer ownership transfer with idle-time thresholds

src/command/stream/stream_write.rs


8. src/command/stream/mod.rs ✨ Enhancement +694/-0

Stream command module with consumer group integration tests

• Created modular stream command structure with stream_read and stream_write submodules and
 public re-exports
• Implemented format_entry helper to serialize stream entries as nested RESP arrays `[id, [field,
 value, ...]]`
• Added 40+ integration tests covering XADD, XLEN, XRANGE, XREVRANGE, XTRIM, XDEL, XREAD, XGROUP,
 XREADGROUP, XACK, XPENDING, XCLAIM, XAUTOCLAIM, and XINFO operations
• Tests validate consumer group workflows, pending entry lists, ownership transfers, and edge cases
 like NOMKSTREAM and approximate trimming

src/command/stream/mod.rs


9. src/command/list/mod.rs ✨ Enhancement +527/-0

List command module refactoring with comprehensive operation tests

• Refactored list command module into list_read and list_write submodules with public re-exports
• Implemented shared helpers: parse_i64 for numeric parsing and resolve_index for
 Redis-compatible negative index resolution
• Added 40+ tests covering LPUSH, RPUSH, LPOP, RPOP, LLEN, LRANGE, LINDEX, LSET, LINSERT, LREM,
 LTRIM, LPOS, and LMOVE operations
• Tests verify TTL handling, WRONGTYPE errors, empty list cleanup, and complex operations like LMOVE
 with same-key rotation

src/command/list/mod.rs


10. fuzz/fuzz_targets/gossip_deser.rs 🧪 Tests +20/-0

Gossip protocol deserialization fuzzing target

• Created new fuzzing target for cluster gossip message deserialization
• Exercises magic validation, version checking, message type dispatch, slot bitmap parsing, and
 truncation handling
• Implements roundtrip verification: deserialize → serialize → deserialize must succeed without
 panics

fuzz/fuzz_targets/gossip_deser.rs


11. src/command/set/set_read.rs Code hygiene +742/-0

Set command read operations split into dedicated module

• New file containing 742 lines of read-only set command handlers (SMEMBERS, SCARD, SISMEMBER,
 SMISMEMBER, SINTER, SUNION, SDIFF, SRANDMEMBER, SSCAN)
• Implements both mutable and read-only variants of each command for RwLock read-path support
• Includes helper function collect_sets_readonly for non-mutating set collection with expiry
 checking

src/command/set/set_read.rs


12. src/command/string/string_write.rs Code hygiene +643/-0

String command write operations split into dedicated module

• New file containing 643 lines of write-only string command handlers (SET, MSET, INCR,
 DECR, INCRBY, DECRBY, INCRBYFLOAT, APPEND, SETRANGE, SETNX, SETEX, PSETEX,
 GETSET)
• Implements full SET command with options (EX, PX, EXAT, PXAT, NX, XX, KEEPTTL,
 GET)
• Includes internal helper incrby_internal for increment/decrement operations with overflow
 checking

src/command/string/string_write.rs


13. src/command/hash/mod.rs Code hygiene +475/-0

Hash command module reorganization with comprehensive tests

• New module file (475 lines) re-exporting hash read/write submodules
• Contains comprehensive test suite covering HSET, HGET, HDEL, HMSET, HMGET, HGETALL,
 HEXISTS, HLEN, HKEYS, HVALS, HINCRBY, HINCRBYFLOAT, HSETNX, HSCAN
• Tests verify field operations, missing keys, type errors, and scan functionality with MATCH and
 COUNT options

src/command/hash/mod.rs


14. src/command/set/mod.rs Code hygiene +529/-0

Set command module reorganization with shared helpers

• New module file (529 lines) re-exporting set read/write submodules
• Defines shared helpers: parse_int, glob_match, collect_sets for set operations
• Includes extensive test suite for all set commands (SADD, SREM, SMEMBERS, SINTER,
 SUNION, SDIFF, SINTERSTORE, SUNIONSTORE, SDIFFSTORE, SRANDMEMBER, SPOP, SSCAN)

src/command/set/mod.rs


15. src/command/stream/stream_read.rs Code hygiene +533/-0

Stream command read operations split into dedicated module

• New file containing 533 lines of read-only stream command handlers (XLEN, XRANGE, XREVRANGE,
 XREAD, XPENDING, XINFO)
• Implements stream range queries with optional COUNT parameter and cursor-based iteration
• Handles consumer group operations including pending entry tracking and consumer idle time
 calculation

src/command/stream/stream_read.rs


16. src/storage/bptree.rs ✨ Enhancement +69/-339

BPTree internal API exposed for iterator implementation

• Added public re-export of BPTreeIter and BPTreeRevIter from bptree_iter submodule
• Exposed internal types and methods as pub(crate): NodeId, InternalNode, LeafNode, and
 accessor methods for tree structure
• Added public accessor methods: root_id(), height(), leaf_head(), leaf_tail(),
 leaf_pub(), internal_pub(), find_leaf_pub()

src/storage/bptree.rs


17. tests/loom_response_slot.rs 🧪 Tests +237/-0

Loom model tests for ResponseSlot state machine correctness

• New Loom model test file (237 lines) verifying ResponseSlot lock-free SPSC state machine
 correctness
• Includes non-Loom fallback tests using standard threads for validation
• Tests all state transitions: EMPTYfillFILLEDpoll_takeEMPTY under all
 possible thread interleavings
• Verifies data visibility, atomicity, and reset semantics across concurrent access patterns

tests/loom_response_slot.rs


18. fuzz/fuzz_targets/acl_rule.rs 🧪 Tests +21/-0

Fuzz target for ACL rule parser robustness

• New cargo-fuzz target (21 lines) for fuzzing ACL rule parser
• Exercises all rule prefix paths and modifiers (+, -, ~, &, >, <, #, !, %R~,
 %W~, on, off, nopass, resetpass, resetkeys, resetchannels, reset)
• Validates parser robustness by ensuring no panics on arbitrary UTF-8 input

fuzz/fuzz_targets/acl_rule.rs


19. .github/workflows/ci.yml Additional files +15/-5

...

.github/workflows/ci.yml


20. .github/workflows/claude-code-review.yml Additional files +0/-44

...

.github/workflows/claude-code-review.yml


21. .github/workflows/codeql.yml Additional files +1/-1

...

.github/workflows/codeql.yml


22. .github/workflows/fuzz.yml Additional files +74/-0

...

.github/workflows/fuzz.yml


23. .github/workflows/release.yml Additional files +1/-1

...

.github/workflows/release.yml


24. .planning Additional files +1/-1

...

.planning


25. CHANGELOG.md Additional files +12/-1

...

CHANGELOG.md


26. CLAUDE.md Additional files +32/-4

...

CLAUDE.md


27. Cargo.toml Additional files +2/-1

...

Cargo.toml


28. README.md Additional files +4/-0

...

README.md


29. docs/PRODUCTION-CONTRACT.md Additional files +212/-0

...

docs/PRODUCTION-CONTRACT.md


30. docs/runbooks/README.md Additional files +16/-0

...

docs/runbooks/README.md


31. docs/security/unsafe-audit.md Additional files +94/-0

...

docs/security/unsafe-audit.md


32. fuzz/Cargo.toml Additional files +60/-0

...

fuzz/Cargo.toml


33. fuzz/artifacts/resp_parse/crash-bc6d3eb6b9193b3f9f7844b01d2356dff5b38ee5 Additional files +0/-0

...

fuzz/artifacts/resp_parse/crash-bc6d3eb6b9193b3f9f7844b01d2356dff5b38ee5


34. fuzz/artifacts/resp_parse/crash-d910d9fd212b15baaaea4eefbe68be05fb2dc3d9 Additional files +16/-0

...

fuzz/artifacts/resp_parse/crash-d910d9fd212b15baaaea4eefbe68be05fb2dc3d9


35. fuzz/artifacts/resp_parse/minimized-from-bc6d3eb6b9193b3f9f7844b01d2356dff5b38ee5 Additional files +0/-0

...

fuzz/artifacts/resp_parse/minimized-from-bc6d3eb6b9193b3f9f7844b01d2356dff5b38ee5


36. fuzz/corpus/inline_parse/inline_get Additional files +1/-0

...

fuzz/corpus/inline_parse/inline_get


37. fuzz/corpus/inline_parse/inline_set Additional files +1/-0

...

fuzz/corpus/inline_parse/inline_set


38. fuzz/corpus/resp_parse/001d928397e149bb48dc7fc52408fd380793f3e1 Additional files +1/-0

...

fuzz/corpus/resp_parse/001d928397e149bb48dc7fc52408fd380793f3e1


39. fuzz/corpus/resp_parse/00be7e542930dfd98b9eafe4e8f5accbe5991be5 Additional files +0/-0

...

fuzz/corpus/resp_parse/00be7e542930dfd98b9eafe4e8f5accbe5991be5


40. fuzz/corpus/resp_parse/00da749f2b75f2398db07fbfc0a5c8c52c7b9fca Additional files +4/-0

...

fuzz/corpus/resp_parse/00da749f2b75f2398db07fbfc0a5c8c52c7b9fca


41. fuzz/corpus/resp_parse/00eeed4dc621ecc360b44282844348f34edce581 Additional files +0/-0

...

fuzz/corpus/resp_parse/00eeed4dc621ecc360b44282844348f34edce581


42. fuzz/corpus/resp_parse/01028624b6c7cf7735b77dbaefcd5770bc5c17a3 Additional files +0/-0

...

fuzz/corpus/resp_parse/01028624b6c7cf7735b77dbaefcd5770bc5c17a3


43. fuzz/corpus/resp_parse/01fc0304ce08a143076d38086e906872a3af7779 Additional files +7/-0

...

fuzz/corpus/resp_parse/01fc0304ce08a143076d38086e906872a3af7779


44. fuzz/corpus/resp_parse/0219f2bafa59ee04e4a0966152a30e4a1f3e263f Additional files +0/-0

...

fuzz/corpus/resp_parse/0219f2bafa59ee04e4a0966152a30e4a1f3e263f


45. fuzz/corpus/resp_parse/025aeca62c64fc59f74eae92c534d48c72a9c48e Additional files +2/-0

...

fuzz/corpus/resp_parse/025aeca62c64fc59f74eae92c534d48c72a9c48e


46. fuzz/corpus/resp_parse/025d36c61a11a06a64e5a0ec89dbcb10041bc1e7 Additional files +6/-0

...

fuzz/corpus/resp_parse/025d36c61a11a06a64e5a0ec89dbcb10041bc1e7


47. fuzz/corpus/resp_parse/031291feb7aab9283dcda4bd1069c9c9655c2d7a Additional files +0/-0

...

fuzz/corpus/resp_parse/031291feb7aab9283dcda4bd1069c9c9655c2d7a


48. fuzz/corpus/resp_parse/03237f8bfd23eec10649901abac034ef86256c13 Additional files +0/-0

...

fuzz/corpus/resp_parse/03237f8bfd23eec10649901abac034ef86256c13


49. fuzz/corpus/resp_parse/0381dbd10dd5645aaa215139dc9d768e7fc3bb38 Additional files +1/-0

...

fuzz/corpus/resp_parse/0381dbd10dd5645aaa215139dc9d768e7fc3bb38


50. fuzz/corpus/resp_parse/03f0938b66d2948fcce05d086035370309355b48 Additional files +5/-0

...

fuzz/corpus/resp_parse/03f0938b66d2948fcce05d086035370309355b48


51. fuzz/corpus/resp_parse/04219232335aefc1c12294bb6ce58fe200648d1e Additional files +0/-0

...

fuzz/corpus/resp_parse/04219232335aefc1c12294bb6ce58fe200648d1e


52. fuzz/corpus/resp_parse/05a63bd48be2bf6cd3d146cc6915e279bc91f4ce Additional files +2/-0

...

fuzz/corpus/resp_parse/05a63bd48be2bf6cd3d146cc6915e279bc91f4ce


53. fuzz/corpus/resp_parse/05b8f616c5cd54a3d39e4d65706be74c7b0e0b21 Additional files +21/-0

...

fuzz/corpus/resp_parse/05b8f616c5cd54a3d39e4d65706be74c7b0e0b21


54. fuzz/corpus/resp_parse/062dfe959f081ab42ba7c5be1184075c7ecb60ee Additional files +0/-0

...

fuzz/corpus/resp_parse/062dfe959f081ab42ba7c5be1184075c7ecb60ee


55. fuzz/corpus/resp_parse/066ba65ccc554250e9a39900d39c4c7fcda91c17 Additional files +0/-0

...

fuzz/corpus/resp_parse/066ba65ccc554250e9a39900d39c4c7fcda91c17


56. fuzz/corpus/resp_parse/0670859201b6ed8f3f231bd8f2a2bb875bd4f403 Additional files +0/-0

...

fuzz/corpus/resp_parse/0670859201b6ed8f3f231bd8f2a2bb875bd4f403


57. fuzz/corpus/resp_parse/068bbf8fb12c6f8e6e02092f7104757e0b3091b1 Additional files +6/-0

...

fuzz/corpus/resp_parse/068bbf8fb12c6f8e6e02092f7104757e0b3091b1


58. fuzz/corpus/resp_parse/06ff8eab61f294a9eebe6874aa217f1d94b91bde Additional files +3/-0

...

fuzz/corpus/resp_parse/06ff8eab61f294a9eebe6874aa217f1d94b91bde


59. fuzz/corpus/resp_parse/073f83e0c521d3121dfb08ff9026858a0a7b2a22 Additional files +4/-0

...

fuzz/corpus/resp_parse/073f83e0c521d3121dfb08ff9026858a0a7b2a22


60. fuzz/corpus/resp_parse/0794da8ef33f263b9cb94f9eff1a39cbb799074c Additional files +1/-0

...

fuzz/corpus/resp_parse/0794da8ef33f263b9cb94f9eff1a39cbb799074c


61. fuzz/corpus/resp_parse/07e44e928d50c5b5376b1d1ddfa514e2fcea9b10 Additional files +1/-0

...

fuzz/corpus/resp_parse/07e44e928d50c5b5376b1d1ddfa514e2fcea9b10


62. fuzz/corpus/resp_parse/0999b50c6830dcd12d0501a7c53d461b3b68638f Additional files +5/-0

...

fuzz/corpus/resp_parse/0999b50c6830dcd12d0501a7c53d461b3b68638f


63. fuzz/corpus/resp_parse/09f0d4598a703d78bc1f03f4284f949097e1198b Additional files +4/-0

...

fuzz/corpus/resp_parse/09f0d4598a703d78bc1f03f4284f949097e1198b


64. fuzz/corpus/resp_parse/0a1c1818c1bad127d5d7f88a0dcc67edd2725ad2 Additional files +0/-0

...

fuzz/corpus/resp_parse/0a1c1818c1bad127d5d7f88a0dcc67edd2725ad2


65. fuzz/corpus/resp_parse/0b3de75c0fa5f2d36a8858c884c9b7adba79295c Additional files +0/-0

...

fuzz/corpus/resp_parse/0b3de75c0fa5f2d36a8858c884c9b7adba79295c


66. fuzz/corpus/resp_parse/0bb128c201781b12c6b88f5eef8e06516ad6da6d Additional files +1/-0

...

fuzz/corpus/resp_parse/0bb128c201781b12c6b88f5eef8e06516ad6da6d


67. fuzz/corpus/resp_parse/0bb935bd67b679062f51df3e12f51866273bdca5 Additional files +0/-0

...

fuzz/corpus/resp_parse/0bb935bd67b679062f51df3e12f51866273bdca5


68. fuzz/corpus/resp_parse/0bcbc35fe03b9d88133ce12010937ab19555bb3a Additional files +1/-0

...

fuzz/corpus/resp_parse/0bcbc35fe03b9d88133ce12010937ab19555bb3a


69. fuzz/corpus/resp_parse/0bf48eee9bd5721fb041a158e4af8e1e70c92fe0 Additional files +4/-0

...

fuzz/corpus/resp_parse/0bf48eee9bd5721fb041a158e4af8e1e70c92fe0


70. fuzz/corpus/resp_parse/0c88b2a69fee5dc15b907ee4759d17b078ca117e Additional files +0/-0

...

fuzz/corpus/resp_parse/0c88b2a69fee5dc15b907ee4759d17b078ca117e


71. fuzz/corpus/resp_parse/0cc016c2ab4c2b7f6c8e449fccd9ec8109ccaf06 Additional files +0/-0

...

fuzz/corpus/resp_parse/0cc016c2ab4c2b7f6c8e449fccd9ec8109ccaf06


72. fuzz/corpus/resp_parse/0d08d026021d75e2b84d0834491261581f06f98b Additional files +0/-0

...

fuzz/corpus/resp_parse/0d08d026021d75e2b84d0834491261581f06f98b


73. fuzz/corpus/resp_parse/0d1f485dae699a2ced057d2ea1d50dc146b78154 Additional files +0/-0

...

fuzz/corpus/resp_parse/0d1f485dae699a2ced057d2ea1d50dc146b78154


74. fuzz/corpus/resp_parse/0d307c30b806b1ae59d5540e1310c206a42a3abc Additional files +0/-0

...

fuzz/corpus/resp_parse/0d307c30b806b1ae59d5540e1310c206a42a3abc


75. fuzz/corpus/resp_parse/0d8a8d1e3c3e3b4388ed126b92d5aae844cb3962 Additional files +0/-0

...

fuzz/corpus/resp_parse/0d8a8d1e3c3e3b4388ed126b92d5aae844cb3962


76. fuzz/corpus/resp_parse/0e135ad31cbe8bd86533100f7e92fe35c8f1eac8 Additional files +0/-0

...

fuzz/corpus/resp_parse/0e135ad31cbe8bd86533100f7e92fe35c8f1eac8


77. fuzz/corpus/resp_parse/0e54da661444cc938dde99cc48f92281a7fc3f78 Additional files +6/-0

...

fuzz/corpus/resp_parse/0e54da661444cc938dde99cc48f92281a7fc3f78


78. fuzz/corpus/resp_parse/0e93171f01ef5ead8e2af9eb042466542b5caf7b Additional files +15/-0

...

fuzz/corpus/resp_parse/0e93171f01ef5ead8e2af9eb042466542b5caf7b


79. fuzz/corpus/resp_parse/0eb4c1e48d1ad533718c8739a39a2ffee4ac9359 Additional files +0/-0

...

fuzz/corpus/resp_parse/0eb4c1e48d1ad533718c8739a39a2ffee4ac9359


80. fuzz/corpus/resp_parse/0f032ae35ddee9bedcab2be7eea82f164256df73 Additional files +0/-0

...

fuzz/corpus/resp_parse/0f032ae35ddee9bedcab2be7eea82f164256df73


81. fuzz/corpus/resp_parse/104c93cbd1d10f45fec26239dda73115968d0d85 Additional files +4/-0

...

fuzz/corpus/resp_parse/104c93cbd1d10f45fec26239dda73115968d0d85


82. fuzz/corpus/resp_parse/1081bb766feb46cb0350e295de333f49b5bdbcab Additional files +0/-0

...

fuzz/corpus/resp_parse/1081bb766feb46cb0350e295de333f49b5bdbcab


83. fuzz/corpus/resp_parse/115fc56e49f46b2d608ac8c4df5fa825526ac942 Additional files +0/-0

...

fuzz/corpus/resp_parse/115fc56e49f46b2d608ac8c4df5fa825526ac942


84. fuzz/corpus/resp_parse/12420e36d1ff4a55fe65a166a1c20001828db369 Additional files +6/-0

...

fuzz/corpus/resp_parse/12420e36d1ff4a55fe65a166a1c20001828db369


85. fuzz/corpus/resp_parse/1358c1d89cc05c8d1fb2c143c092a6e3a1f123f0 Additional files +6/-0

...

fuzz/corpus/resp_parse/1358c1d89cc05c8d1fb2c143c092a6e3a1f123f0


86. fuzz/corpus/resp_parse/13b79733850cbca0ac4fd556a8164418b9f5370a Additional files +4/-0

...

fuzz/corpus/resp_parse/13b79733850cbca0ac4fd556a8164418b9f5370a


87. fuzz/corpus/resp_parse/13e95eb21676e4ba239c62053b7dd160b55fc028 Additional files +3/-0

...

fuzz/corpus/resp_parse/13e95eb21676e4ba239c62053b7dd160b55fc028


88. fuzz/corpus/resp_parse/14cf17b5afc0ed0425a3b1d5ba064e9cd37a7fd3 Additional files +0/-0

...

fuzz/corpus/resp_parse/14cf17b5afc0ed0425a3b1d5ba064e9cd37a7fd3


89. fuzz/corpus/resp_parse/14d725281894d5e1c50a0509f4c83a49b132d814 Additional files +1/-0

...

fuzz/corpus/resp_parse/14d725281894d5e1c50a0509f4c83a49b132d814


90. fuzz/corpus/resp_parse/1575f64caf16d2b0b473d5a91423353f10978eb8 Additional files +0/-0

...

fuzz/corpus/resp_parse/1575f64caf16d2b0b473d5a91423353f10978eb8


91. fuzz/corpus/resp_parse/1577c36aa5e565bad3f9a8922da2e9ff8757cba2 Additional files +0/-0

...

fuzz/corpus/resp_parse/1577c36aa5e565bad3f9a8922da2e9ff8757cba2


92. fuzz/corpus/resp_parse/16a801be65c26a2fda6951d756d0c8d2a4ac1d2e Additional files +6/-0

...

fuzz/corpus/resp_parse/16a801be65c26a2fda6951d756d0c8d2a4ac1d2e


93. fuzz/corpus/resp_parse/16afaa86ad45564b0d8c002067873613b8cbe5c9 Additional files +0/-0

...

fuzz/corpus/resp_parse/16afaa86ad45564b0d8c002067873613b8cbe5c9


94. fuzz/corpus/resp_parse/16cb92e79df5bd1ca0ffb769cddb910cc61edf90 Additional files +5/-0

...

fuzz/corpus/resp_parse/16cb92e79df5bd1ca0ffb769cddb910cc61edf90


95. fuzz/corpus/resp_parse/16cebbb74c2448743bcf091c92df1782bf475f32 Additional files +2/-0

...

fuzz/corpus/resp_parse/16cebbb74c2448743bcf091c92df1782bf475f32


96. fuzz/corpus/resp_parse/1752b0004e85775368919b0ba650abcddea5ab0f Additional files +2/-0

...

fuzz/corpus/resp_parse/1752b0004e85775368919b0ba650abcddea5ab0f


97. fuzz/corpus/resp_parse/177113e18c465fec5c064e78175de76c624af5e6 Additional files +0/-0

...

fuzz/corpus/resp_parse/177113e18c465fec5c064e78175de76c624af5e6


98. fuzz/corpus/resp_parse/17e25e70b2d37cfccde952ddff3f13af7ae0ca8a Additional files +0/-0

...

fuzz/corpus/resp_parse/17e25e70b2d37cfccde952ddff3f13af7ae0ca8a


99. fuzz/corpus/resp_parse/185bbbce7514c73792266121c8800f08fc60608a Additional files +1/-0

...

fuzz/corpus/resp_parse/185bbbce7514c73792266121c8800f08fc60608a


100. fuzz/corpus/resp_parse/192408eda165de8435961b37e0dab62a6dcff0b2 Additional files +1/-0

...

fuzz/corpus/resp_parse/192408eda165de8435961b37e0dab62a6dcff0b2


101. fuzz/corpus/resp_parse/19ec803a20e45e24de1d79a4bb58095b0d99f832 Additional files +2/-0

...

fuzz/corpus/resp_parse/19ec803a20e45e24de1d79a4bb58095b0d99f832


102. fuzz/corpus/resp_parse/1a5412b943baf44b9b264ab17b07c6cfac428c2a Additional files +2/-0

...

fuzz/corpus/resp_parse/1a5412b943baf44b9b264ab17b07c6cfac428c2a


103. fuzz/corpus/resp_parse/1acf06e1c895d2ba2c69d55e14e2169c4bed16ab Additional files +1/-0

...

fuzz/corpus/resp_parse/1acf06e1c895d2ba2c69d55e14e2169c4bed16ab


104. fuzz/corpus/resp_parse/1ae4050fa92c62d27185f47d42442d49f2ad8768 Additional files +2/-0

...

fuzz/corpus/resp_parse/1ae4050fa92c62d27185f47d42442d49f2ad8768


105. fuzz/corpus/resp_parse/1b28fbc39f33bf8e1774e921e142c33662816b57 Additional files +1/-0

...

fuzz/corpus/resp_parse/1b28fbc39f33bf8e1774e921e142c33662816b57


106. fuzz/corpus/resp_parse/1b2cbce1a166e38c648ecbd682b2a195088c584e Additional files +0/-0

...

fuzz/corpus/resp_parse/1b2cbce1a166e38c648ecbd682b2a195088c584e


107. fuzz/corpus/resp_parse/1b2d45510f2e633dca8ae29785842a9be2f41aa6 Additional files +0/-0

...

fuzz/corpus/resp_parse/1b2d45510f2e633dca8ae29785842a9be2f41aa6


108. fuzz/corpus/resp_parse/1b75aa24f743a80bb85cd8cc921c66f779783f1f Additional files +1/-0

...

fuzz/corpus/resp_parse/1b75aa24f743a80bb85cd8cc921c66f779783f1f


109. fuzz/corpus/resp_parse/1b8a5f1e5565af607278c77322079c1666f05e8d Additional files +5/-0

...

fuzz/corpus/resp_parse/1b8a5f1e5565af607278c77322079c1666f05e8d


110. fuzz/corpus/resp_parse/1bca4c5bba7b2eb8ea38a8bcbec2d5971aeee43a Additional files +4/-0

...

fuzz/corpus/resp_parse/1bca4c5bba7b2eb8ea38a8bcbec2d5971aeee43a


111. fuzz/corpus/resp_parse/1c69e3fb1692af61fa1dccc4f8b428591fcbf8ad Additional files +1/-0

...

fuzz/corpus/resp_parse/1c69e3fb1692af61fa1dccc4f8b428591fcbf8ad


112. fuzz/corpus/resp_parse/1c9b1da306d0e63728e397b83a72a1282c4502c6 Additional files +3/-0

...

fuzz/corpus/resp_parse/1c9b1da306d0e63728e397b83a72a1282c4502c6


113. fuzz/corpus/resp_parse/1d1420d6d4570dea2b1e9e46d5a818065b00a9ad Additional files +2/-0

...

fuzz/corpus/resp_parse/1d1420d6d4570dea2b1e9e46d5a818065b00a9ad


114. fuzz/corpus/resp_parse/1d67693bd5ed337cec93a43eea8083a42f017465 Additional files +5/-0

...

fuzz/corpus/resp_parse/1d67693bd5ed337cec93a43eea8083a42f017465


115. fuzz/corpus/resp_parse/1fb3ef8a4dc560fa13e35c1a68dcf5fa0442de85 Additional files +1/-0

...

fuzz/corpus/resp_parse/1fb3ef8a4dc560fa13e35c1a68dcf5fa0442de85


116. fuzz/corpus/resp_parse/1fb8f2524c38903f699e572999c6f59a86325972 Additional files +2/-0

...

fuzz/corpus/resp_parse/1fb8f2524c38903f699e572999c6f59a86325972


117. fuzz/corpus/resp_parse/1fbb01d0c3cda567125e69111dd73c5245429fa9 Additional files +0/-0

...

fuzz/corpus/resp_parse/1fbb01d0c3cda567125e69111dd73c5245429fa9


118. fuzz/corpus/resp_parse/1ffc45ed92993f6ac8a4a8d3f0ad2a8f0a28b2a7 Additional files +0/-0

...

fuzz/corpus/resp_parse/1ffc45ed92993f6ac8a4a8d3f0ad2a8f0a28b2a7


119. Additional files not shown Additional files +0/-0

...

Additional files not shown


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Apr 9, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX Issues (0)

Grey Divider


Action required

1. hscan uses Vec::new()📘
Description
New hot-path code in src/command/ introduces Vec::new() and to_string(), which can add
avoidable allocations and formatting overhead on request execution paths. This violates the
documented hot-path allocation restrictions.
Code

src/command/hash/hash_read.rs[R256-286]

+    let total = fields.len();
+    let mut results = Vec::new();
+    let mut pos = cursor;
+    let mut checked = 0;
+
+    while pos < total && checked < count {
+        let (field, value) = fields[pos];
+        pos += 1;
+        checked += 1;
+
+        // MATCH filter on field name
+        if let Some(pattern) = match_pattern {
+            if !crate::command::key::glob_match(pattern, field) {
+                continue;
+            }
+        }
+
+        results.push(Frame::BulkString(field.clone()));
+        results.push(Frame::BulkString(value.clone()));
+    }
+
+    let next_cursor = if pos >= total {
+        Bytes::from_static(b"0")
+    } else {
+        Bytes::from(pos.to_string())
+    };
+
+    Frame::Array(framevec![
+        Frame::BulkString(next_cursor),
+        Frame::Array(results.into()),
+    ])
Evidence
PR Compliance ID 3 forbids introducing Vec::new() and to_string() in src/command/ hot paths.
In hscan, the PR adds let mut results = Vec::new(); and formats the cursor with
Bytes::from(pos.to_string()).

CLAUDE.md
src/command/hash/hash_read.rs[256-286]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`hscan` allocates via `Vec::new()` and `pos.to_string()` in a documented hot-path module.
## Issue Context
Rule requires avoiding `Vec::new()`, `to_string()`, and similar allocation-heavy helpers in `src/command/`.
## Fix Focus Areas
- src/command/hash/hash_read.rs[256-286]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. hash_write uses format!()📘
Description
New command write-path code uses to_string() and format!() to build response payloads, adding
allocations and expensive formatting in src/command/. This violates the hot-path allocation
restrictions.
Code

src/command/hash/hash_write.rs[R248-314]

+        None => 0,
+    };
+    let new_value = current + increment;
+    map.insert(field, Bytes::from(new_value.to_string()));
+    Frame::Integer(new_value)
+}
+
+/// HINCRBYFLOAT key field increment
+///
+/// Increments the float value of a hash field by the given amount.
+/// Returns the new value as a bulk string.
+pub fn hincrbyfloat(db: &mut Database, args: &[Frame]) -> Frame {
+    if args.len() != 3 {
+        return err_wrong_args("HINCRBYFLOAT");
+    }
+    let key = match extract_bytes(&args[0]) {
+        Some(k) => k.as_ref(),
+        None => return err_wrong_args("HINCRBYFLOAT"),
+    };
+    let field = match extract_bytes(&args[1]) {
+        Some(f) => f.clone(),
+        None => return err_wrong_args("HINCRBYFLOAT"),
+    };
+    let increment: f64 = match extract_bytes(&args[2]) {
+        Some(v) => match std::str::from_utf8(v).ok().and_then(|s| s.parse().ok()) {
+            Some(n) => n,
+            None => return Frame::Error(Bytes::from_static(b"ERR value is not a valid float")),
+        },
+        None => return err_wrong_args("HINCRBYFLOAT"),
+    };
+    let map = match db.get_or_create_hash(key) {
+        Ok(m) => m,
+        Err(e) => return e,
+    };
+    let current: f64 = match map.get(&field) {
+        Some(v) => match std::str::from_utf8(v).ok().and_then(|s| s.parse().ok()) {
+            Some(n) => n,
+            None => {
+                return Frame::Error(Bytes::from_static(b"ERR hash value is not a valid float"));
+            }
+        },
+        None => 0.0,
+    };
+    let new_value = current + increment;
+    // Format like Redis: integer-like floats get no decimal, otherwise trim trailing zeros
+    let formatted = format_float(new_value);
+    map.insert(field, Bytes::from(formatted.clone()));
+    Frame::BulkString(Bytes::from(formatted))
+}
+
+/// Format a float value in Redis style.
+/// If the value is an exact integer, format without decimal point.
+/// Otherwise, format with necessary precision, trimming trailing zeros.
+pub(super) fn format_float(v: f64) -> String {
+    if v == v.floor() && v.is_finite() {
+        // Check if it fits in i64 range for clean integer formatting
+        if v >= i64::MIN as f64 && v <= i64::MAX as f64 {
+            return format!("{}", v as i64);
+        }
+    }
+    // Use enough precision and trim trailing zeros
+    let s = format!("{:.17}", v);
+    let s = s.trim_end_matches('0');
+    // Don't leave trailing dot
+    let s = s.trim_end_matches('.');
+    s.to_string()
+}
Evidence
PR Compliance ID 3 forbids introducing format!()/to_string() in src/command/. The PR adds
Bytes::from(new_value.to_string()) and multiple format!() calls inside format_float() used by
HINCRBYFLOAT.

CLAUDE.md
src/command/hash/hash_write.rs[248-314]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Hot-path hash write commands build numeric replies via `to_string()` and `format!()`, which introduce avoidable allocations.
## Issue Context
The compliance rule requires avoiding heap allocations/formatting in `src/command/` hot paths.
## Fix Focus Areas
- src/command/hash/hash_write.rs[248-314]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. set_write has unwrap()📘
Description
New set command write-path code introduces multiple .unwrap() calls that can panic in library
code. This violates the requirement to avoid panics in non-test code paths.
Code

src/command/set/set_write.rs[R54-56]

+                for arg in &args[1..] {
+                    if let Some(member) = extract_bytes(arg) {
+                        let val = try_parse_i64(member).unwrap();
Evidence
PR Compliance ID 6 forbids unwrap()/expect() in non-test library code. The PR adds
try_parse_i64(member).unwrap() in sadd and also uses .unwrap() in spop (random selection and
DB access), any of which can panic and crash the server under unexpected inputs/state.

CLAUDE.md
src/command/set/set_write.rs[54-56]
src/command/set/set_write.rs[182-186]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`src/command/set/set_write.rs` introduces `.unwrap()` in non-test command handlers, which can panic.
## Issue Context
Compliance requires avoiding panics in library code; unexpected parse/state conditions must be handled by returning `Frame::Error(...)` (or a safe fallback) instead of panicking.
## Fix Focus Areas
- src/command/set/set_write.rs[54-56]
- src/command/set/set_write.rs[182-186]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (3)
4. srandmember unwraps choose()📘
Description
New read-path set command code uses .unwrap() when selecting random members, which can panic in
library code. This violates the no-unwrap() requirement outside tests.
Code

src/command/set/set_read.rs[R270-273]

+    if args.len() == 1 {
+        // Single random member
+        let chosen = members.choose(&mut rng).unwrap();
+        return Frame::BulkString((*chosen).clone());
Evidence
PR Compliance ID 6 forbids unwrap() in non-test library code. The PR adds `members.choose(&mut
rng).unwrap() (and another unwrap()` in the duplicate-selection loop), which can panic if
invariants are broken and is disallowed by policy.

CLAUDE.md
src/command/set/set_read.rs[267-305]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`SRANDMEMBER` uses `.unwrap()` on `choose()`, which is disallowed in non-test library code.
## Issue Context
Even if the set is checked as non-empty, compliance requires avoiding panics and handling unexpected states safely.
## Fix Focus Areas
- src/command/set/set_read.rs[267-305]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. parse_frame_zerocopy uses unwrap📘
Description
The protocol zero-copy parser includes newly-modified unwrap() calls when parsing counts, which
can panic on malformed input. This violates the requirement to avoid unwrap() in non-test library
code and can enable request-triggered crashes.
Code

src/protocol/parse.rs[R357-365]

let crlf = find_crlf(buf, *pos).unwrap();
let line = &buf[*pos..crlf];
-            let count = atoi::atoi::<i64>(line).unwrap() as usize;
+            let count = atoi::atoi::<i64>(line).unwrap();
*pos = crlf + 2;
-            let mut entries = Vec::with_capacity(count);
+            if count == -1 {
+                return Frame::Null;
+            }
+            let count = count as usize;
+            let mut entries = Vec::with_capacity(count.min(config.max_array_length));
Evidence
PR Compliance ID 6 forbids unwrap() in non-test library code. The PR modifies the RESP3
map/set/push parsing to use atoi::atoi::(line).unwrap() for counts, which will still panic if
parsing fails (untrusted network input).

CLAUDE.md
src/protocol/parse.rs[356-383]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`src/protocol/parse.rs` uses `unwrap()` while parsing protocol frames, which can panic on malformed input.
## Issue Context
Parsing runs on untrusted client data; failures must be handled by returning a structured error instead of panicking.
## Fix Focus Areas
- src/protocol/parse.rs[356-383]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Null map rejected🐞
Description
parse_frame_zerocopy now treats RESP3 map length -1 as Frame::Null, but validate_frame and
parse_single_frame_zc still reject any negative map length, so %-1\r\n will always fail parsing.
This makes the new null-map handler unreachable and breaks RESP3 null map semantics despite the PR’s
stated fix scope.
Code

src/protocol/parse.rs[R356-366]

// Map
let crlf = find_crlf(buf, *pos).unwrap();
let line = &buf[*pos..crlf];
-            let count = atoi::atoi::<i64>(line).unwrap() as usize;
+            let count = atoi::atoi::<i64>(line).unwrap();
*pos = crlf + 2;
-            let mut entries = Vec::with_capacity(count);
+            if count == -1 {
+                return Frame::Null;
+            }
+            let count = count as usize;
+            let mut entries = Vec::with_capacity(count.min(config.max_array_length));
for _ in 0..count {
Evidence
The PR-added zero-copy map handler returns Frame::Null on count == -1, but the parse pipeline
calls validate_frame first, and that function errors on any count < 0 for maps;
parse_single_frame_zc also errors on count < 0. Therefore, a null map frame is rejected before
the zero-copy handler can run, and the code paths disagree on what is valid input.

src/protocol/parse.rs[355-372]
src/protocol/parse.rs[664-688]
src/protocol/parse.rs[150-166]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
RESP3 null maps (`%-1\r\n`) are still rejected during validation even though `parse_frame_zerocopy` now explicitly returns `Frame::Null` for map length `-1`. Because `parse()` always runs `validate_frame()` before `parse_frame_zerocopy()`, the null-map handling is currently unreachable and the two-pass parser is semantically inconsistent.
### Issue Context
- Pass 1 (`validate_frame`) decides whether parsing proceeds.
- Pass 2 (`parse_frame_zerocopy`) now accepts `count == -1` for maps.
- Other aggregate RESP3 types (array/set/push) already treat `-1` as null in validation.
### Fix Focus Areas
- src/protocol/parse.rs[664-688]
- src/protocol/parse.rs[150-166]
- src/protocol/parse.rs[355-372]
### What to change
1. In `validate_frame`’s `b'%'` branch, treat `count == -1` as a valid null map (return `Ok(())`), and keep rejecting `count < -1`.
2. In `parse_single_frame_zc`’s `b'%'` branch, treat `count == -1` as `Ok(Frame::Null)` to keep semantics aligned across parser implementations.
3. Add a regression unit test similar to the new set/push tests:
- `parse_bytes(b"%-1\r\n").unwrap().unwrap() == Frame::Null`
4. (Optional but recommended) Align the legacy `parse_single_frame` map handler similarly if it’s intended to stay correct/usable.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment thread src/command/hash/hash_read.rs
Comment thread src/command/hash/hash_write.rs
Comment thread src/command/set/set_write.rs Outdated
Comment thread src/command/set/set_read.rs
Comment thread src/protocol/parse.rs Outdated
Comment thread src/protocol/parse.rs Outdated
TinDang97 added a commit that referenced this pull request Apr 9, 2026
1. hash_read.rs: Vec::new() → Vec::with_capacity() in hscan;
   pos.to_string() → itoa::Buffer for cursor serialization (hot-path
   allocation rule)

2. hash_write.rs: new_value.to_string() → itoa::Buffer in HINCRBY
   (hot-path allocation rule). format_float() kept as-is — float
   formatting inherently requires allocation.

3. set_write.rs: try_parse_i64().unwrap() → let-else continue;
   choose().unwrap() → let-else with Frame::Null fallback;
   get_or_create_set().unwrap() → let-else with Frame::Null fallback

4. set_read.rs: choose().unwrap() → let-else with Frame::Null/break
   in srandmember (both single and duplicate-allowed paths, both
   mutable and readonly variants)

5. parse.rs parse_frame_zerocopy: unwraps retained with #[allow] —
   post-validation guarantees; fuzzing covers divergence risk

6. parse.rs RESP3 null map bug: validate_frame now allows %-1 as null
   map (was rejecting all negative map counts, making the null-map
   handler in parse_frame_zerocopy unreachable). Also fixed in
   parse_single_frame_zc. Added test_resp3_null_map and
   test_resp3_negative_map_count regression tests.

48/48 parser tests pass, clippy clean both feature sets.
TinDang97 added a commit that referenced this pull request Apr 9, 2026
1. hash_read.rs: Vec::new() → Vec::with_capacity() in hscan;
   pos.to_string() → itoa::Buffer for cursor serialization (hot-path
   allocation rule)

2. hash_write.rs: new_value.to_string() → itoa::Buffer in HINCRBY
   (hot-path allocation rule). format_float() kept as-is — float
   formatting inherently requires allocation.

3. set_write.rs: try_parse_i64().unwrap() → let-else continue;
   choose().unwrap() → let-else with Frame::Null fallback;
   get_or_create_set().unwrap() → let-else with Frame::Null fallback

4. set_read.rs: choose().unwrap() → let-else with Frame::Null/break
   in srandmember (both single and duplicate-allowed paths, both
   mutable and readonly variants)

5. parse.rs parse_frame_zerocopy: unwraps retained with #[allow] —
   post-validation guarantees; fuzzing covers divergence risk

6. parse.rs RESP3 null map bug: validate_frame now allows %-1 as null
   map (was rejecting all negative map counts, making the null-map
   handler in parse_frame_zerocopy unreachable). Also fixed in
   parse_single_frame_zc. Added test_resp3_null_map and
   test_resp3_negative_map_count regression tests.

48/48 parser tests pass, clippy clean both feature sets.
@TinDang97 TinDang97 force-pushed the v0.1.3-production-readiness branch from 8a9e6ff to aae1918 Compare April 9, 2026 05:42
TinDang97 added 18 commits April 9, 2026 12:46
Moon v1.0 promises landed as docs/PRODUCTION-CONTRACT.md — the single
source of truth every v0.1.3 hardening phase tests against.

Sections:
- Supported Platforms (Tier 1 Linux aarch64, Tier 2 x86_64, Tier 3 CI)
- Performance SLOs per command class (provisional until Phase 97)
- Durability Modes (appendfsync × crash-class RPO/RTO matrix)
- Availability & Replication Guarantees
- Security Guarantees
- Out of Scope with per-item rationale
- GA Exit Criteria Checklist (49/49 Active REQ-IDs traced)

Also:
- CHANGELOG [Unreleased] entry documenting the publication
- README Production Readiness section pointing at the contract
- docs/runbooks/ stub directory for Phase 99 (REL-05)

Closes CONTRACT-01 (Phase 87 of milestone v0.1.3).
- Cargo.toml rust-version = "1.94"
- New rust-toolchain.toml pinning channel 1.94.0 (auto-install on clone)
- CI workflows: dtolnay/rust-toolchain@stable → @1.94.0 (6 swaps)
- MSRV job renamed from (1.85) to (1.94)
- CLAUDE.md: all 1.85 references → 1.94
- CHANGELOG [Unreleased] documents the bump

Closes RUST-01 (Phase 88 of milestone v0.1.3).
CI verification deferred to next push — file edits only.
Rust 1.94 introduced clippy::manual_is_multiple_of lint. All 16 call
sites across 10 files auto-fixed via `cargo clippy --fix`:
  - command/{stream,string,hash,config,sorted_set}.rs
  - persistence/auto_save.rs, shard/coordinator.rs
  - vector/{turbo_quant/encoder,diskann/pq}.rs
  - storage/tiered/cold_tier.rs

Verification (on moon-dev VM, Rust 1.94.0):
  - cargo clippy -- -D warnings: clean (default + tokio features)
  - 1877/1877 unit tests pass (lib-only)
  - 33 integration test failures are pre-existing (server command
    dispatch under tokio runtime, not toolchain-related)

Part of Phase 88, RUST-01.
…crash

Phase 89 (Correctness Hardening — Fuzz & Loom) infrastructure:

Fuzz targets (7 targets, cargo +nightly fuzz):
  - resp_parse: RESP2/RESP3 parser with bounded config
  - resp_parse_differential: same input → two identical parses invariant
  - inline_parse: telnet-style command parser
  - wal_v3_record: WAL v3 record decoder (CRC32C, LZ4, truncation)
  - rdb_load: RDB snapshot loader (magic, type tags, checksums)
  - gossip_deser: cluster bus gossip message + roundtrip
  - acl_rule: ACL rule string parser (all prefix paths)

Loom model tests:
  - ResponseSlot fill/take state machine under all interleavings
  - Concurrent fill + take race (loom exhaustive)
  - Fill → take → refill cycle (reusability)
  - Non-loom std-thread smoke tests for CI without loom feature

CI:
  - .github/workflows/fuzz.yml: 15m per target on PR, 6h nightly

Bug fix (found by fuzzer in 10 seconds):
  - RESP3 Set (~), Push (>), Map (%) handlers in parse_frame_zerocopy
    did `atoi().unwrap() as usize` without checking for -1 (null) or
    negative counts → capacity overflow in FrameVec::with_capacity.
  - Fixed: null check (-1 → Frame::Null), negative check (< 0 rejected),
    capacity clamped to max_array_length.
  - Added regression tests: test_fuzz_crash_resp3_set_negative_count,
    test_resp3_null_set, test_resp3_null_push, test_resp3_negative_set_count.
  - 46/46 parser tests pass.

Known: second fuzz crash pending investigation (validation/zerocopy
position divergence on bare LF without CR). Tracked for gap closure.

Closes FUZZ-01 (infrastructure), LOOM-01 (infrastructure), SEC-08 (ACL
fuzz target). 24h clean run deferred to CI wall-clock.
Every unsafe block in src/ now has a preceding // SAFETY: comment
explaining the invariant that makes the operation sound. Categories:

- UnsafeCell access guarded by atomic state machine (response_slot.rs)
- Tagged-pointer dereference after tag verification (compact_value.rs, compact_key.rs)
- MaybeUninit access after bounds-checked hash probing (dashtable/segment.rs)
- SIMD intrinsics behind target_feature gates (dashtable/simd.rs, avx512.rs)
- io_uring SQE submission with registered FDs/buffers (uring_driver.rs, buf_ring.rs)
- OwnedFd::from_raw_fd after dup/accept (conn_accept.rs, event_loop.rs, listener.rs)
- Pointer arithmetic in HNSW TQ-ADC search (hnsw/search.rs)
- mmap with validated file descriptor (sealed_mmap.rs)

Added scripts/audit-unsafe.sh — CI enforcer that fails on any unsafe
block without a SAFETY comment within 3 preceding lines.

Result: 156/156 blocks annotated, 0 violations.
Part of UNSAFE-01, SEC-05 (Phase 90 of v0.1.3).
…ates

PANIC-01 partial: annotated all unwrap/expect in hot-path modules with
#[allow(clippy::unwrap_used)] + justification comments. Categories:
  - Post-validation (parse_frame_zerocopy: 20 calls)
  - Atomic-invariant (response_slot: 2 calls)
  - RwLock poison (handlers: ~15 calls)
  - Control-flow-guarded Option (pubsub_rx/tx, pending: ~10 calls)
  - Insert-then-get (db.rs: ~15 calls)
  - Startup/init (listener, metadata: ~5 calls)

SEC-05: docs/security/unsafe-audit.md published — categories,
invariants, risks, enforcement, and v1.0 recommendations.

CI enforcement:
  - scripts/audit-unsafe.sh: fails on unsafe blocks without SAFETY comment
  - scripts/audit-unwrap.sh: ratchet (baseline=35, prevents increase)
  - .github/workflows/ci.yml: safety-audit job runs both scripts

Closes UNSAFE-01, PANIC-01 (annotation), SEC-05.
Remaining: 35 un-annotated unwraps in src/command/ to fix in Phase 91.
HYGIENE-01: Split command and storage files exceeding 1500-line rule:

Command modules (converted to directory modules with read/write splits):
  - sorted_set.rs (3092 → mod 1347 + read 1270 + write 518)
  - stream.rs (2028 → mod 694 + read 533 + write 827)
  - string.rs (1867 → mod 871 + read 376 + write 643)
  - set.rs (1618 → mod 529 + read 742 + write 404)
  - list.rs (1521 → mod 486 + read 609 + write 527)
  - hash.rs (1353 → mod 475 + read 549 + write 345) [proactive]

Storage modules (kept as files with extracted submodules):
  - db.rs (1655 → 1419 + db_read.rs 243)
  - bptree.rs (1667 → 1399 + bptree_iter.rs 343)

All split files individually ≤ 1500 lines. Re-exports maintain same
public API paths — no downstream import changes needed.

Remaining > 1500 (deferred to HYGIENE-02 handler unification):
  - handler_monoio.rs (2005)
  - handler_sharded.rs (1650)
  - event_loop.rs (1505)

Verification:
  - cargo clippy -D warnings: clean (both feature sets)
  - 1881/1881 unit tests pass
  - Zero public API changes

Closes HYGIENE-01 (8/10 files, remaining 3 are handler unification scope).
1. hash_read.rs: Vec::new() → Vec::with_capacity() in hscan;
   pos.to_string() → itoa::Buffer for cursor serialization (hot-path
   allocation rule)

2. hash_write.rs: new_value.to_string() → itoa::Buffer in HINCRBY
   (hot-path allocation rule). format_float() kept as-is — float
   formatting inherently requires allocation.

3. set_write.rs: try_parse_i64().unwrap() → let-else continue;
   choose().unwrap() → let-else with Frame::Null fallback;
   get_or_create_set().unwrap() → let-else with Frame::Null fallback

4. set_read.rs: choose().unwrap() → let-else with Frame::Null/break
   in srandmember (both single and duplicate-allowed paths, both
   mutable and readonly variants)

5. parse.rs parse_frame_zerocopy: unwraps retained with #[allow] —
   post-validation guarantees; fuzzing covers divergence risk

6. parse.rs RESP3 null map bug: validate_frame now allows %-1 as null
   map (was rejecting all negative map counts, making the null-map
   handler in parse_frame_zerocopy unreachable). Also fixed in
   parse_single_frame_zc. Added test_resp3_null_map and
   test_resp3_negative_map_count regression tests.

48/48 parser tests pass, clippy clean both feature sets.
Fuzz CI:
- Remove rust-toolchain.toml before fuzzing so nightly compiler is
  used (-Zsanitizer=address requires nightly, rust-toolchain.toml
  was overriding +nightly to stable 1.94.0)
- Use explicit cargo +nightly for fuzz run

audit-unwrap.sh:
- Fix set -e crash: grep for #[cfg(test)] now has || true to prevent
  early exit on files without test modules (split submodules)
- Baseline corrected from 22 to 98 (true count after script bug fix;
  includes function-level #[allow] not detected by line-level grep
  and split submodule files without #[cfg(test)])
…ash #2)

Replaced every .unwrap() in parse_frame_zerocopy with defensive
fallbacks (return Frame::Null) using crlf_or_null!/atoi_or_null!/
parse_count! macros. The function no longer panics on ANY input.

Root cause: validation pass and zerocopy pass could diverge on
position tracking when input contains bare \n without \r (e.g.
*5\n\r\n). Validation would advance pos differently than zerocopy,
causing atoi to receive garbage bytes and panic.

Fix approach: instead of trying to keep two passes in perfect sync
(fragile), make the zerocopy pass self-defending — any parse failure
returns Frame::Null rather than crashing. This is correct because:
- Valid RESP never produces Null where a real frame is expected
- The server treats unexpected Null as a protocol error
- No server crash from malformed client input

Verification:
- All 3 prior crash artifacts execute clean (0 crashes)
- 1.6M fuzz iterations in 60s with 0 crashes
- 48/48 parser tests pass
- cargo clippy -D warnings clean (both feature sets)
CONTRIBUTING.md — contributor guide covering:
- Golden rules (no crash on client input, no hot-path alloc, SAFETY comments)
- PR checklist, code conventions, error handling contract
- Unwrap policy with allowed/forbidden examples
- Hot-path allocation rules with allowed/forbidden patterns
- Module split convention (directory modules with re-exports)
- Unsafe code contract (approval, SAFETY, audit categories)
- Fuzzing contract (every deserializer needs a fuzz target)
- Lock-free data structure contract (loom models required)
- CI pipeline table with blocking status

docs/API-CONTRACT.md — API stability tiers:
- Tier 1 Stable: RESP protocol, commands, RDB/WAL formats, CLI flags, ACL syntax
- Tier 2 Versioned: on-disk formats with MOON_FORMAT_VERSION
- Tier 3 Internal: ShardMessage, ResponseSlot, DashTable, CompactValue
- Change process for new commands, fuzz targets, format modifications
- Crate public API inventory (fuzz/test/bench consumers)
- SemVer policy with data-store semantics

CLAUDE.md updates:
- Parser defensiveness rule (Frame::Null on failure, never panic)
- #[allow(clippy::unwrap_used)] annotation convention
- File split convention (directory modules)
- Fuzzing and loom test requirements for new code
- Module structure rules (crate:: imports, tests in mod.rs)
- CI section updated with safety audit + fuzz jobs
39 packages updated via cargo update:
- tokio 1.50.0 → 1.51.1
- libc 0.2.183 → 0.2.184
- redis 1.1.0 → 1.2.0 (dev-dep)
- aws-lc-sys 0.39.0 → 0.39.1
- arc-swap 1.9.0 → 1.9.1
- zerocopy 0.8.47 → 0.8.48
- icu_* 2.1.x → 2.2.0
- and 32 other transitive dependencies

Verified: clippy clean (both features), 1883/1883 tests pass.
Rust 1.94.0 → 1.94.1 (security + bugfix patch):
- rust-toolchain.toml, CLAUDE.md, all CI workflows updated
- OrbStack provisioning commands updated

Deps: 39+ packages updated via cargo update (tokio 1.51.1,
libc 0.2.184, redis 1.2.0, aws-lc-sys 0.39.1, zerocopy 0.8.48,
icu 2.2.0, zerovec 0.11.6, etc.)

Verified on moon-dev VM (Rust 1.94.1):
- cargo clippy -D warnings: clean (both features)
- 1883/1883 unit tests pass
@TinDang97 TinDang97 force-pushed the v0.1.3-production-readiness branch from aae1918 to 002d68e Compare April 9, 2026 05:51
- PR: 3 critical targets only (resp_parse, resp_parse_differential,
  wal_v3_record) × 5 min instead of 6 targets × 15 min
- Multi-process fuzzing (-fork=2) for 2× throughput
- Nightly corpus seeds PR runs via artifact download
- Shared cache key between PR and nightly jobs
- Nightly unchanged: all 6 targets × 6h with corpus archival

Lower-risk targets (inline_parse, gossip_deser, acl_rule) run nightly only.
@pilotspacex-byte pilotspacex-byte merged commit 0ed106a into main Apr 9, 2026
12 checks passed
@pilotspacex-byte pilotspacex-byte deleted the v0.1.3-production-readiness branch April 9, 2026 06:24
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