Skip to content
CAI
Software that uses CAICheck a score

msz/hammox

72.6

Strong · 3 October 2026

1.6k

lines of production code

Elixir

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Hammox is an Elixir library that enhances unit testing by wrapping mock functions with runtime type checking based on Elixir behaviors. It validates arguments and return values against specified typespecs, raising errors on mismatches to ensure mocks adhere to their defined interfaces. The system integrates with existing Mox workflows and includes performance optimizations, telemetry support, and comprehensive test coverage for various type scenarios.

Features

Introduce Hammox library with type-protected mock functions

The library now provides \protect/2\ and \protect/3\ functions that wrap mock functions with runtime type checking based on Elixir behaviours. When a protected function is called, it validates arguments and return values against the specified typespecs, raising a \Hammox.TypeMatchError\ on mismatch. This adds a layer of contract testing to unit tests, ensuring mocks behave according to their defined interfaces, while retaining full compatibility with existing Mox-based mocking workflows.

lib · high confidence

Behavioural changes

Hammox library restructured with new caching, telemetry, and type engine modules

The Hammox library has been refactored to improve performance and observability. A new \Hammox.Cache\ module replaces the previous Genserver-based caching with \:persistent\_term\ for faster lookups, while \Hammox.Telemetry\ introduces an opt-in telemetry system (disabled by default) that wraps \:telemetry.span\ to allow users to monitor Hammox's internal operations. The core type-matching logic has been extracted into \Hammox.TypeEngine\ to simplify the main codebase, and \Hammox.TypeMatchError\ now provides more human-readable error messages for type mismatches. Additionally, \Hammox.Protect\ offers a convenient \use\ macro for test modules to automatically protect functions against their specified behaviors.

lib/hammox · high confidence

Test coverage

Added test support modules for Hammox.Protect; Added tests for Hammox.Protect and telemetry behavior; Comprehensive test suite for Hammox type protection and type checking; Expanded test support fixtures for typespec validation.

Dependencies

Hammox 1.0.0 release with updated dependencies and CI tooling

This update bumps the project to version 1.0.0 and raises the minimum Elixir requirement to 1.15. It upgrades development dependencies, including ex\_doc to 0.40.3, credo to 1.7.19, and mox to 1.2.0, while adding ordinal 0.2.0 and telemetry 1.4.2 to the dependency list. The release also introduces a \mix ci\ alias to standardize formatting, dependency checks, compilation, linting, and testing, and configures package metadata for Hex publishing.

(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

Score

  • CAI 72 → 73 (+0.6)
  • Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.

Lenses

  • Code Health 98 → 98 (+0.0)
  • Architecture 100 → 100 (+0.0)
  • Maturity 55 → 55 (+0.0)
  • Readiness 77 → 78 (+1.7)
  • Security 96 → 97 (+0.8)

Resolved (1)

  • Documentation: no licence statement (README.md)

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

Survey your own repository

msz/hammox 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 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit dd8d3cbceda579823590538a89cd0052c9bb797e — the exact code this score is about.
  • Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-8fe32cd45d00.