WhatsApp/waraft
60.9
Adequate · 23 September 2026
10.6k
lines of production code
Erlang
primary language
5
measurements over time
What this system is
WARaft is an Erlang library implementing the Raft consensus algorithm, providing core capabilities such as leader election, replicated logs, and strong read consistency. It supports pluggable distribution layers and configurable storage backends, allowing developers to customize transport and log mechanisms. The system includes a key-value store example and comprehensive test suites to verify cluster behavior, including restarts, catchup, and security constraints.
Features
Initial release of WARaft with build configuration and documentation
This entry introduces the WARaft project, an Erlang implementation of the Raft consensus algorithm. The change adds the \rebar.config\ build file, specifying a minimum Erlang/OTP 28.0 requirement and including test dependencies like \assert\ and \meck\. It also establishes the initial \README.md\, which documents the library's features (including leader election, replicated logs, and pluggable components), provides a quick-start guide for running a single-node cluster, and outlines the Apache 2.0 license.
(repo-wide) · high confidence
Introduce pluggable distribution and application-scoped configuration for RAFT
The RAFT subsystem now supports pluggable distribution layers and application-scoped configuration. A new \wa\_raft\_distribution\ module provides a behavior with a default Erlang distribution implementation, allowing custom transport backends. Additionally, \wa\_raft\_env\ introduces a configuration API that searches application environments in a specific order, enabling table-level overrides and runtime election weight adjustments. This is accompanied by new application and supervisor modules (\wa\_raft\_app\, \wa\_raft\_app\_sup\) to manage shared services like transport and snapshot catchup, replacing the previous monolithic startup model.
src · high confidence
Behavioural changes
Standardized RAFT logging and RPC naming conventions
The RAFT subsystem now uses a dedicated logging domain (whatsapp, wa\_raft) via the standard Erlang logger, replacing ad-hoc logging macros. RPC communication has been standardized to use named procedures (e.g., append\_entries, request\_vote) with explicit sender names and nodes, replacing the previous generic RPC format that relied on numeric IDs. This change improves log clarity and ensures consistent identification of RAFT participants across the cluster.
include · high confidence
Updated kvstore example to use wa\_raft\_acceptor API and configurable storage
The kvstore example application has been refactored to align with the current wa\_raft API. Client operations (read, write, delete) now explicitly use the wa\_raft\_acceptor module instead of direct gen\_server calls, providing clearer error handling via specific acceptor error types. The application's configuration in kvstore.app.src has been expanded to allow users to specify custom modules for the raft log, storage, distribution, and transport layers, as well as a default path for the raft database. Additionally, the supervisor logic was simplified to pass partition-specific arguments directly to the wa\_raft supervisor, and module documentation was standardized to use -moduledoc attributes.
examples/kvstore · high confidence
Test coverage
Added comprehensive test suite for wa\_raft components
Added new Common Test suites and helper modules to verify the correctness of the wa\_raft Raft implementation. The new tests cover unit and integration scenarios for the acceptor (commit and strong read operations, queue-full error handling), log (open, append, check, trim, rotate, config), queue (commit, read, apply, queue-full states), storage (snapshot creation, config preservation, durable position), and server (election, replication, commit, read leases, config changes, witness behavior). Additionally, end-to-end sanity tests validate cluster behavior including basic operations, restarts, catchup, and reelection, while transport tests ensure file path resolution rejects traversal and absolute paths for security.
test · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 58 → 61 (+2.6)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 92 → 95 (+2.8)
- Architecture 100 → 100 (+0.0)
- Maturity 50 → 39 (-11.3)
- Readiness 47 → 64 (+17.4)
- Security 80 → 100 (+20.3)
Resolved (12)
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- No automated tests
- No exposed public API
- No tests found
- Test reliability not included
- TooManyMethods: wa_raft_log (src/wa_raft_log.erl)
- TooManyMethods: wa_raft_server (src/wa_raft_server.erl)
- TooManyMethods: wa_raft_transport (src/wa_raft_transport.erl)
- complexity unreadable for .erl, .hrl — churn × complexity hotspots could not be measured
New (19)
- Coverage not measured — no coverage collector is wired up
- Dependency hygiene PARTLY measured — rebar3 pinning read, dependency currency not (no rebar.lock-pinned Hex declaration to grade)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (5 lines × 7) (src/wa_raft_acceptor.erl)
- Duplicated block (8 lines × 2) (src/wa_raft_log.erl)
- Duplicated block (8 lines × 2) (src/wa_raft_snapshot_catchup.erl)
- Duplicated block (8 lines × 4) (src/wa_raft_acceptor.erl)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Hotspot: src/wa_raft_server.erl (src/wa_raft_server.erl)
- TodoComment (src/wa_raft_server.erl)
- TodoComment (src/wa_raft_server.erl)
- TodoComment (test/wa_raft_server_SUITE.erl)
- TodoComment (test/wa_raft_server_SUITE.erl)
- Workflow token permissions not restricted
- wa_raft_server.leader_adjust_config (cognitive 30) (src/wa_raft_server.erl)
- wa_raft_server.leader_adjust_config (cyclomatic 36) (src/wa_raft_server.erl)
Changes since last survey
- 15 commits — 15 feature/other, 0 fixes
By area
- (root) — 4 commits
- include/wa_raft.hrl — 3 commits
- src/wa_raft_server.erl — 3 commits
- src/wa_raft.erl — 1 commit
- src/wa_raft_dist_transport.erl — 1 commit
- src/wa_raft_label.erl — 1 commit
- src/wa_raft_log.erl — 1 commit
- src/wa_raft_log_ets.erl — 1 commit
Notable commits
- change: Cap witness log replication at the max match index
- change: Clean up label type documentation
- change: Compute witness replication cap over full members only
- change: Fix README typo
- change: Include non-member participants in log trim index
- change: Make tests publishable to WhatsApp/waraft
- change: Make the durably-applied trim limit a storage provider callback
- change: Normalize Erlang module headers
- change: Precheck follower capacity before creating a snapshot
- change: Raise overloaded snapshot catchup backoff to 10s
- change: Re-sync with internal repository (#12)
- change: Refresh README for current architecture
- change: Simplify ETS reads
- change: Split last_quorum_ts into leader-quorum and commit-index timestamps
- change: Track transport/file progress with atomics instead of ETS read-modify-write
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
WhatsApp/waraft was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit a9a1d1cc7f613543d152d1a0f114a2bfdc835bcf — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.