Skip to content
CAI
Software that uses CAICheck a score

whitfin/cachex

62.7

Adequate · 23 September 2026

6.5k

lines of production code

Elixir

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Cachex is an Elixir library for in-memory caching, providing a robust API for storing, retrieving, and managing data in memory. It supports distributed caching through various routing strategies and offers flexible eviction policies to manage memory usage. The system includes comprehensive tooling for code quality, performance benchmarking, and automated documentation generation.

How it got here

2016 — Cachex architecture refactoring

8 changes.

This period focused on a comprehensive refactoring of the Cachex library, reorganizing its internal architecture into modular service and action components. The work included updating dependencies, enforcing code quality standards, and adding extensive test coverage for the new structure.

2017 — Cache service modularization and validation

5 changes.

The project refactored cache management into distinct service modules, each handling specific operations like locking, warming, and expiration. This restructuring was accompanied by comprehensive test coverage and the introduction of a runtime specification validator to ensure data integrity and improve concurrency.

2018–2024 — Distributed caching and eviction policies

7 changes.

This period focused on expanding the library's capabilities for distributed caching by introducing multiple router implementations, including consistent hash rings with dynamic node monitoring. It also added flexible cache eviction policies, such as LRU and LRW strategies, alongside comprehensive test coverage and automated documentation generation.

Features

Added node monitoring with include/exclude filtering

A new monitor module has been added to handle dynamic node allocation within the Cachex ring router. It hooks into :net\_kernel to detect node up/down events and automatically adds or removes nodes from the internal ring. The implementation supports filtering via :monitor\_includes and :monitor\_excludes options, allowing users to specify which nodes should be monitored and which should be excluded from the ring.

lib/cachex/router/ring · high confidence

Added script to generate overview documentation

A new Elixir script (scripts/overview.exs) was added to automate the creation of the 'Getting Started' documentation. The script reads the project's README.md, extracts the content preceding the '\#\# Benchmarks' header, and writes it into docs/overview.md prefixed with a 'Getting Started' title. This provides an automated way to keep the overview documentation in sync with the main README.

scripts · high confidence

Introduce new service modules for cache management

The lib/cachex/services directory now contains new service modules: Courier, Incubator, Informant, Janitor, Locksmith, Overseer, and Steward. These modules handle specific cache operations such as fallback execution, warmer supervision, hook notifications, expiration cleanup, locking, state management, and provisioning. This restructuring separates concerns and improves concurrency and performance.

lib/cachex/services · high confidence

New cache eviction policies: Evented, Scheduled, and Accessed

Added three new cache limit implementations for the Cachex library: \Cachex.Limit.Evented\ for reactive, event-driven least-recently-written (LRW) eviction; \Cachex.Limit.Scheduled\ for periodic, timer-based LRW eviction; and \Cachex.Limit.Accessed\ for access-based touch tracking to support LRU policies. These modules implement the \Cachex.Hook\ behavior to enforce cache size limits and pruning, offering users flexible strategies for memory management with distinct trade-offs between memory overhead and eviction accuracy.

lib/cachex/limit · high confidence

New routing implementations for distributed caching

Cachex introduces new router implementations to handle distributed caching scenarios. The \Cachex.Router.Local\ module provides a simple routing strategy for single-node setups, while \Cachex.Router.Mod\ offers a basic modulo-based hash routing for static clusters. For more resilient distributed environments, \Cachex.Router.Ring\ implements a consistent hash ring (backed by the \ex\_hash\_ring\ library) that supports dynamic node monitoring and inclusion/exclusion patterns. Additionally, \Cachex.Router.Jump\ provides Jump Consistent Hash routing for static clusters. These changes replace previous macro-based routing paths with full behavior implementations.

lib/cachex/router · high confidence

Architecture

Add Credo and Mix formatter configuration files

The repository now includes \.credo.exs\ and \.formatter.exs\ configuration files to enforce code style and linting standards. The Credo configuration defines a set of enabled and disabled checks for static analysis, while the Mix formatter configuration specifies input paths and a 100-character line length limit. These changes support automated code quality checks in the CI pipeline.

(repo-wide) · high confidence

Refactor cache actions into dedicated modules

The \lib/cachex/actions\ directory has been restructured to include individual modules for each cache operation (e.g., \clear\, \del\, \get\, \put\). This change organizes the internal implementation of cache actions into separate files, improving code modularity and maintainability. Each action is now encapsulated in its own module, such as \Cachex.Actions.Clear\ or \Cachex.Actions.Get\, making the codebase easier to navigate and extend.

lib/cachex/actions · high confidence

Behavioural changes

Add new benchmarking suite using Benchee

A new benchmarking script has been added at benchmarks/main.exs, replacing the previous approach with the Benchee library. The script defines various cache configurations (including compressed and transactional states) and runs performance tests against a wide range of Cachex operations such as get, put, update, and size. It also supports enabling ETS compression via an environment variable.

benchmarks · high confidence

Cachex API and configuration overhaul

The Cachex library has been significantly refactored, introducing a new \Cachex.start\_link/2\ entry point that requires a unique atom name as the first argument. The configuration options have been updated, notably replacing \:ttl\ with \:expiration\ and \:disable\_ode\ with \:ode\ in cache options. The API has been streamlined by removing redundant tags from various operations, merging \count/2\ and \size/2\, and renaming \Query.create/1\ to \Query.build/1\. Additionally, the library now supports custom commands, asynchronous write operations, and ETS compression, while removing support for remote Cachex instances and Mnesia.

lib · medium confidence

Locksmith introduces a dedicated queue process for transactional execution

The Locksmith service now manages a dedicated queue process for each cache instance, as shown in the new \Cachex.Services.Locksmith.Queue\ module. This change ensures that each cache has its own queue process, preventing caches from competing for resources and allowing transactional operations to execute in a lock-free context. Users benefit from improved resource management and more predictable transactional behavior.

lib/cachex/services/locksmith · medium confidence

Refactored internal architecture with new service modules

The library's internal structure has been significantly reorganized. Core action logic has been moved into a new \Cachex.Actions\ module, while routing, options parsing, and service supervision have been extracted into dedicated modules (\Cachex.Router\, \Cachex.Options\, \Cachex.Services\). Additionally, the previous \Cachex.Macros\ and \Cachex.Worker\ modules have been removed in favor of this new modular approach.

lib/cachex · high confidence

Test coverage

Added comprehensive test coverage for cache action methods; Added comprehensive test coverage for core cache operations and services; Added runtime validation for Cachex specification records; Added test utilities and hook implementations for cache testing; Added tests for core cache services; Added tests for router implementations; Added tests for the spec validator; Refactored test suite structure and added comprehensive cache startup tests.

Dependencies

Updated project dependencies and build configuration

The project's dependencies have been updated to newer versions, including Eternal, ex\_hash\_ring, jumper, sleeplocks, and unsafe, alongside test, linting, benchmarking, and documentation libraries. The minimum supported Elixir version has been raised to 1.7, and the lockfile has been removed from the repository.

(dependencies) · 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 65 → 63 (-1.9)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (-0.1)
  • Architecture 100 → 100 (+0.0)
  • Maturity 55 → 58 (+2.3)
  • Readiness 61 → 53 (-7.7)
  • Security 71 → 71 (+0.0)

Resolved (5)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — no supported dependency manifest was read
  • No exposed public API
  • Off-boarding risk: anonymized user #1
  • Test reliability not included

New (12)

  • Dependency hygiene PARTLY measured — Mix pinning read, dependency currency not (Hex registry unreachable)
  • Documentation: no usage examples (README.md)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No dependency advisory monitoring
  • No dependency lockfile committed (mix.exs)
  • Orphaned files with no living knowledge
  • TodoComment (lib/cachex/services/locksmith.ex)
  • Workflow token permissions not restricted

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

whitfin/cachex 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 44ac7e445bba03a9953a46ff61da2f168dd8cc57 — 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.