Skip to content
CAI
Software that uses CAICheck a score

erikerlandson/coulomb

59.7

Adequate · 7 November 2026

5.8k

lines of production code

Scala

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add Refined integration for Coulomb quantities

This change introduces a new integration module that allows Coulomb quantities to be built using \eu.timepit.refined\ types. Users can now create quantities with refined predicates (such as \Positive\ or \NonNegative\) using syntax like \withRP\ and \refineVU\. The integration supports algebraic operations (addition, multiplication) on refined values, handling validation failures via \Either\[String, Refined\[...\]\]\ when operations violate predicates. It also provides unit and value conversions for refined types, enabling seamless use of refined values in unit conversions and arithmetic.

refined · high confidence

Add testkit for property-based testing

A new testkit module has been added to provide Scalacheck Arbitrary and Cogen instances for Quantity and DeltaQuantity types, enabling users to easily write property-based tests for their code using Coulomb.

testkit · high confidence

Expanded unit library with new physical domains and Java Time integration

The library now includes comprehensive definitions for several new unit systems and domains. Users can work with accepted non-SI metric units (such as hectare, liter, and tonne) via the new \accepted\ object, and US customary units (including yard, pound, gallon, and BTU) via the \us\ object. New files define fundamental physical constants (like the speed of light and Planck's constant) in \constants\, information units (bit, byte, and binary prefixes) in \info\, and temperature scales (Celsius, Fahrenheit) in \temperature\. Additionally, the \javatime\ package provides seamless conversion between coulomb \Quantity\ types and Java's \java.time.Duration\ and \Instant\ classes, allowing users to interoperate with standard Java date/time APIs.

units/src/main · high confidence

Introduce runtime unit parsing and Pureconfig integration

This change adds a new runtime unit parsing capability and a Pureconfig integration for Coulomb. The parser module introduces a DSL-based \RuntimeUnitParser\ that can parse string expressions (e.g., "kilometer") into \RuntimeUnit\ objects and render them back, supporting operations like multiplication, division, and powers. This parser is integrated into the Pureconfig module, providing \ConfigReader\ and \ConfigWriter\ instances for \RuntimeUnit\ and \RuntimeQuantity\ via both DSL (string-based) and JSON (structured) formats. Additionally, a \PureconfigRuntime\ is provided to wire together the unit parser, coefficient runtime, and path mappers, enabling seamless configuration loading of quantities with runtime-determined units.

parser, pureconfig, runtime · high confidence

Introduction of DeltaQuantity for offset-based units

The library now supports quantities with an offset, such as temperature (Celsius/Fahrenheit) and epoch time, via the new DeltaQuantity type. This allows users to create, display, and convert offset-based values using methods like withDeltaUnit, toUnit, and toValue, and to perform arithmetic operations like subtraction between delta-quantities or addition of standard quantities to delta-quantities, ensuring correct handling of unit conversions that involve non-zero origins.

core/src/main/scala/coulomb · high confidence

New Cats integration and benchmark suite for Coulomb

This change introduces a new Cats integration module that provides cats.kernel typeclasses (Eq, Order, and Hash) for both Quantity and DeltaQuantity, allowing Coulomb values to be used seamlessly with Cats-based libraries. It also adds a new benchmark suite to evaluate performance improvements from inlining optimizations in the implicit type system, comparing regular versus optimized algebra implementations for unit addition and summation operations.

benchmarks, core/src/main/scala/coulomb/integrations, core/src/main/scala/coulomb/io · high confidence

Removals

Removal of core unit-analysis and quantity-operation infrastructure

The \coulomb\ module has removed its foundational infrastructure for compile-time unit analysis and quantity operations. This includes the deletion of the \Rational\ class used for unit coefficients, the \Quantity\ opaque type and its extension methods (such as \withUnit\, \show\, and arithmetic operators like \+\ and \\*\), and the entire \conversion\, \define\, \infra\, \ops\, and \policy\ packages. Consequently, the library no longer provides the mechanisms for defining base/derived units, performing type-safe arithmetic, or converting between units at compile time.

coulomb · high confidence

Behavioural changes

Migration to sbt and Scala 3 with updated formatting

The project has migrated its build system from Mill to sbt (evidenced by the removal of \build.sc\ and the \mill\ wrapper script) and adopted Scala 3 as the target language. A new \.scalafmt.conf\ file enforces code formatting rules for Scala 3, and the \README.md\ has been updated to reflect the new project identity, including updated badges and documentation links.

(repo-wide) · high confidence

New compile-time unit analysis and expression infrastructure

The \coulomb.infra\ package introduces a new set of Scala 3 macro-based utilities for compile-time unit analysis. This includes \meta.scala\ for canonical and simplified unit signature computation, coefficient extraction, and offset handling; \show.scala\ for rendering unit types into human-readable strings; \simplified.scala\ for transparently simplifying unit types; \typeexpr.scala\ for converting type-level expressions to runtime values (Int, Double, Rational, etc.); and \utils.scala\ for helper extensions. These changes enable more precise and efficient compile-time unit checking and conversion.

core/src/main/scala/coulomb/infra · high confidence

New unit definition hierarchy with named classes

The library introduces a new set of abstract base classes for defining units: \NamedUnit\, \BaseUnit\, \DerivedUnit\, \DeltaUnit\, and \ShowUnitAlias\. This structure allows users to define units with explicit names and abbreviations, supporting derived units (based on other units) and delta units (for offsets like temperature). The implementation uses named inner classes (\NC\) to avoid anonymous class code generation, improving performance and clarity in unit declarations.

core/src/main/scala/coulomb/define · high confidence

Refactored unit conversion system with dedicated DeltaQuantity support

The conversion logic in the core library has been restructured into a new, simplified implicit type system. This change introduces dedicated typeclasses and macros for handling unit conversions, including specific support for DeltaQuantity (temperature and time deltas) via new \DeltaUnitConversion\, \Coefficient\, \Offset\, and \ValueConversion\ components. Users will benefit from a more robust and explicit conversion mechanism that correctly handles offset-based units alongside standard multiplicative conversions, with all conversion logic now centralized in the \coulomb.conversion\ package.

core/src/main/scala/coulomb/conversion · high confidence

Test coverage

Added comprehensive test suites for core quantity operations; Added test infrastructure and unit definitions for Coulomb; Added unit tests for physical constants, SI units, temperature, and time conversions.

Dependencies

Update Scala 3 to 3.3.8 and upgrade core dependencies

The build configuration now targets Scala 3.3.8 as the cross-compiled version, aligning with the current LTS release. Several library dependencies have been updated to their latest versions: algebra and algebra-laws to 2.10.0, pureconfig-core to 0.17.10, refined to 0.11.1, cats-parse to 1.0.0, scala-java-time to 2.5.0, and scalacheck to 1.17.1. Additionally, the test framework munit is set to 1.0.0, and the base version for MIMA compatibility checks has been bumped to 0.9.

(dependencies) · high confidence

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

How this codebase got here

Score

  • CAI 57 → 60 (+3.1)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 75 → 75 (+0.0)
  • Architecture 81 → 81 (+0.0)
  • Maturity 48 → 54 (+6.6)
  • Readiness 58 → 58 (+0.0)
  • Security 65 → 65 (+0.0)

Resolved (33)

  • Concentrated knowledge decay
  • Orphaned file (benchmarks/src/main/scala/coulomb/benchmarks/bench.scala)
  • Orphaned file (core/src/main/scala/coulomb/conversion/coefficient.scala)
  • Orphaned file (core/src/main/scala/coulomb/conversion/coefficients.scala)
  • Orphaned file (core/src/main/scala/coulomb/conversion/deltaunit.scala)
  • Orphaned file (core/src/main/scala/coulomb/conversion/offset.scala)
  • Orphaned file (core/src/main/scala/coulomb/conversion/unit.scala)
  • Orphaned file (core/src/main/scala/coulomb/conversion/value.scala)
  • Orphaned file (core/src/main/scala/coulomb/define/define.scala)
  • Orphaned file (core/src/main/scala/coulomb/deltaquantity.scala)
  • Orphaned file (core/src/main/scala/coulomb/infra/meta.scala)
  • Orphaned file (core/src/main/scala/coulomb/infra/show.scala)
  • Orphaned file (core/src/main/scala/coulomb/infra/typeexpr.scala)
  • Orphaned file (core/src/main/scala/coulomb/quantity.scala)
  • Orphaned file (core/src/main/scala/coulomb/syntax.scala)
  • Orphaned file (parser/src/main/scala/coulomb/dslparser.scala)
  • Orphaned file (parser/src/main/scala/coulomb/parser/dsl.scala)
  • Orphaned file (parser/src/main/scala/coulomb/parser/infra/meta.scala)
  • Orphaned file (pureconfig/src/main/scala/coulomb/integrations/pureconfig/io.scala)
  • Orphaned file (pureconfig/src/main/scala/coulomb/integrations/pureconfig/runtime.scala)
  • …and 13 more

Changes since last survey

  • 3 commits — 1 feature/other, 2 fixes

By area

  • (root) — 2 commits
  • docs/README.md — 1 commit

Notable commits

  • fix: Another CoC fix (#743)
  • fix: Fix CoC name (#742)
  • change: Update CODE_OF_CONDUCT.md to Typelevel CoC (#741)

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

Survey your own repository

erikerlandson/coulomb 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 7 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 2a91dd60c852c84b4ecb2a04fa6879b76a06820d — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-5f8314471808.