Skip to content
CAI
Software that uses CAICheck a score

k32/Lee

61.2

Adequate · 2 October 2026

2.9k

lines of production code

Erlang

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Lee is an Erlang library that provides a type-safe, declarative framework for defining, validating, and managing application configuration. It supports multiple storage backends, including in-memory maps, persistent terms, and Mnesia, while offering extensible metatypes for integrating with CLI arguments, environment variables, and application environments. The system includes a CLI parser, documentation generation tools, and comprehensive validation logic to ensure configuration integrity.

Features

Added line count enforcement script

A new executable script named 'linelimit' has been added to the support directory. This tool counts the total lines of code in the 'src' and 'include' directories, excluding blank lines and comments, and reports the usage against a 3000-line limit, exiting with an error if the limit is exceeded.

support · high confidence

Introduce Lee configuration framework with pluggable storage backends

The \src/framework\ area now includes the core Lee configuration library, providing a declarative model for defining, validating, and patching configuration data. This release adds a unified storage abstraction (\lee\_storage\) with three concrete backends: an in-memory map storage (\lee\_map\_storage\), a persistent term storage (\lee\_persistent\_term\_storage\), and Mnesia-based storage (\lee\_mnesia\_storage\ and \lee\_dirty\_mnesia\_storage\). The framework exposes a public API (\lee\) for managing namespaces, retrieving values with default support, and applying validated patches. It also includes a documentation generator (\lee\_doc\) that outputs Texinfo format, and a metatype system (\lee\_metatype\) that allows extensible validation and configuration reading logic.

src/framework · high confidence

Lee configuration library initial release with type-safe schema and CLI support

This change introduces Lee, a library for creating type-safe, self-documenting configuration for Erlang applications. It allows users to define configuration schemas using standard Erlang types (via the typerefl library) and provides features such as CLI argument parsing, environment variable reading, and validation against the defined model. The library supports multiple storage backends (persistent term, mnesia, maps) and generates documentation in formats like HTML, manpages, and PDF. The release includes a new .editorconfig, updates the README to Asciidoc, and modifies the build configuration (rebar.config) to include dependencies like snabbkaffe and typerefl, while removing the old getopt dependency.

(repo-wide) · high confidence

New metatypes for application environment, CLI, and configuration sources

This change introduces several new metatypes in the \src/metatypes\ directory to extend configuration and interface capabilities. The \lee\_app\_env\ module adds an \app\_env\ metatype that allows configuration values to be applied directly to Erlang application environment variables via a \post\_patch\ hook. The \lee\_cli\ module introduces a model-driven CLI argument parser supporting flags, positional arguments, and scoped actions (prefixed with \@\). Configuration loading is expanded with \lee\_config\_file\ for reading Erlang term files and \lee\_consult\ for parsing \eterm\ files (proplists or maps) with key mapping. Additional metatypes include \lee\_os\_env\ for mapping OS environment variables to configuration, \lee\_logger\ for setting logger levels, \lee\_pointer\ for referencing map instances by key, and \lee\_undocumented\ to suppress documentation generation for specific nodes.

src/metatypes · high confidence

Removals

Removal of legacy Lee configuration and validation modules

The library has removed its previous configuration and validation implementation, deleting the \demo\, \lee\, \lee\_cli\, \lee\_consult\, \lee\_env\, \lee\_internal\, \lee\_map\_getter\, \lee\_model\, \lee\_storage\, \lee\_transform\, and \lee\_types\ modules. This change eliminates the old declarative metaparameter validation, CLI/environment variable reading, and type reflection logic, effectively removing the existing configuration model and term validation capabilities from the application.

src · high confidence

Removed example model definition file

The file doc/example/example\_model.erl, which contained a sample model definition for the Lee library, has been deleted. This removes the example code that demonstrated how to define configuration options, CLI parameters, and dependencies using the library's model macros.

doc/example · high confidence

Behavioural changes

Replace lee\_types.hrl with new lee.hrl record definitions

The previous include file lee\_types.hrl, which provided type definitions and a parse transform, has been removed. It is replaced by a new lee.hrl file that defines core records (mnode, type, doclet, doc\_xref) and macros for storage configuration and attribute access. This change shifts the library's internal representation from the previous type system to a new record-based model.

include · high confidence

Test coverage

Expanded test coverage for Lee configuration and CLI subsystems

Added comprehensive EUnit tests for the CLI parser (including tokenization, negation, and separator handling), configuration file reading (supporting maps and nested structures), external documentation loading, OS environment and application environment integration, persistent term storage, pointer validation, and model compilation/traversal. Included test data files for configuration examples and documentation sources to support these new test suites.

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

Score

  • CAI 63 → 61 (-1.5)
  • Rubric changed (rubric-2026.09.12 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 96 → 96 (+0.0)
  • Architecture 100 → 100 (+0.0)
  • Maturity 48 → 48 (+0.3)
  • Readiness 50 → 46 (-4.0)
  • Security 100 → 100 (+0.0)
  • Event Sourcing 100 → 100 (+0.0)

Resolved (4)

  • Coverage not measured — no coverage collector is wired up
  • Documentation: no installation or build instructions (README.adoc)
  • Documentation: no usage examples (README.adoc)
  • Hotspot: src/metatypes/lee_cli.erl (src/metatypes/lee_cli.erl)

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

Survey your own repository

k32/Lee 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 2 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 19d31d94f03e794cb7f6c1028b6b74306279e84b — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.