Skip to content
CAI
Software that uses CAICheck a score

DavidAlphaFox/ailib

41.8

Weak · 17 September 2026

6.1k

lines of production code

Erlang

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a foundational Erlang library (AILib) that provides a suite of general-purpose utilities and infrastructure components for building distributed applications. It offers core functionality including distributed ID generation, concurrency controls like worker pools and locks, and standard library helpers for data manipulation, cryptography, and web protocols. Additionally, it includes a local in-memory message queue and a programmatic API for transforming Erlang source code via Abstract Syntax Trees.

Features

Add AILib type-matching macros

The include file ailib.hrl now defines macros for handling type metadata in maps. The ?TYPE macro defines the key '\_\type\\_', while ?IS\_TYPE checks if a map contains this key, and ?MATCH\_TYPE provides a pattern for extracting maps with a specific type value.

include · high confidence

Add comprehensive ailib standard library modules

The \src/stdlib\ area now includes a suite of new utility modules providing type conversion (atoms, binaries, booleans, floats, integers, strings), functional helpers (apply, catch\_apply, has, while, pipe, foreach), data structure operations (lists, maps, proplists, priority queues), and specialized capabilities including cryptographic hashing (HMAC, hashids), ISO 8601 date/time parsing and formatting, HTML escaping, tag-based template rendering, process monitoring and load balancing, and UUID generation (v1, v3, v4, v5).

src/stdlib · high confidence

Add distributed ID generation and concurrency utilities

The src/process directory now includes new Erlang modules for core infrastructure capabilities: ailib\_snowflake provides distributed, time-ordered 64-bit unique ID generation; ailib\_locker and ailib\_locker\_sup implement a process-based locking mechanism with wait queues and supervision; ailib\_gc introduces an adaptive garbage collection scheduler to optimize performance under varying load conditions; and ailib\_rand\_chars offers a thread-safe random string generator. These additions provide foundational tools for identity management, concurrency control, and resource optimization within the application.

src/process · high confidence

Added EDoc-generated documentation for Erlang modules

The doc directory now includes generated HTML documentation for several Erlang modules, including ai\_ascii\_random, ai\_balance, ai\_crypto, ai\_hash\_id, ai\_id, ai\_iso8601, ai\_locker, ai\_mq, ai\_pool, and their associated supervisors. This provides users with reference material for the public APIs of these components.

doc · high confidence

Introduce AI pool and task execution modules

The src/pool area now includes a new set of modules for managing worker pools and executing asynchronous tasks. ai\_pool provides a generic pool implementation with checkout/checkin semantics and configurable strategies (LIFO/FIFO). ai\_balance and its supporting modules (ai\_balance\_pool, ai\_balance\_sup, ai\_balance\_worker\_sup) add a load-balancing pool variant that monitors worker health and can restart workers with a configurable delay. ai\_pooled\_task and ai\_task provide APIs for running functions asynchronously (async/await) either on pooled workers or as standalone processes, with support for local and remote nodes, error handling, and safe awaiting with defaults.

src/pool · high confidence

Introduce local in-memory message queue with channel-based pub/sub

The \src/mq\ directory now provides a new local message queue system (\ai\_mq\) built on Erlang gen\_servers. It introduces a queue abstraction (\ai\_mq\_queue\) that manages named channels (\ai\_mq\_channel\), allowing processes to subscribe to specific channels and pull messages with timestamp-based filtering. The system supports message expiration via a configurable \max\_age\ parameter and includes a local process group implementation (\pg2\_local\) for node-local process membership tracking.

src/mq · high confidence

New AI-powered Erlang source transformation capability

The \src/transform\ area now includes a new module (\ai\_pt\) and helper (\ai\_pt\_helper\) that provide a programmatic API for constructing Erlang Abstract Syntax Tree (AST) nodes and transforming source code. This introduces a new \transform/3\ function in the helper module, which parses an input AST, applies a user-supplied function to modify the context (adding functions or records), and generates the resulting AST. This enables users to programmatically inject or modify Erlang code structures, such as adding new functions, records, and exports, within the transformation pipeline.

src/transform · high confidence

New URL and Base64 utility modules

Added \ailib\_url\ and \ailib\_base64\ modules to \src/web\. The \ailib\_url\ module provides URL parsing and construction capabilities compliant with RFC 3986, including support for scheme, authority, host, port, path, query string, and fragment components. The \ailib\_base64\ module offers encoding and decoding functions with optional support for URL-safe characters and padding control.

src/web · high confidence

Behavioural changes

Migrate build system from erlang.mk to rebar3

The project's build tooling has switched from erlang.mk to rebar3. This change removes the erlang.mk framework, the legacy Makefile, and the generated dependency list (ailib.d), while introducing a rebar.config file that declares the quickrand dependency and rebar.lock for reproducible builds. The .gitignore is updated to track rebar-specific artifacts like deps and crashdumps.

(repo-wide) · high confidence

Simplified application structure and added type-based error handling

The application's startup behavior has been simplified by removing the \ailib\_app\ and \ailib\_sup\ modules, meaning the library no longer manages its own OTP supervision tree or auto-starts child processes. Instead, it introduces a new error handling mechanism via \ailib\_error\ and a type-dispatch system in \ailib.erl\ that maps Erlang values to specific modules (e.g., \ailib\_binary\, \ailib\_integer\) and raises structured errors when implementations are missing.

src · high confidence

Test coverage

Added Common Test suites for ailib\_atom and ailib\_base64 modules

New Common Test suites have been added to verify the behavior of the ailib\_atom and ailib\_base64 modules. The ailib\_atom\_SUITE tests cover prefix and suffix operations, including auto-creation of atoms and handling of existing atoms. The ailib\_base64\_SUITE tests verify that the encode and decode functions correctly match the standard base64 module's behavior.

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

Baseline

  • First survey — no prior run to compare against. CAI 42.

Lenses

  • Code Health 93
  • Architecture 96
  • Maturity 21
  • Readiness 26
  • Security 100

Changes since last survey

  • 266 commits — 239 feature/other, 27 fixes

By area

  • (root) — 52 commits
  • src/stdlib — 28 commits
  • src/ai_blob_file.erl — 22 commits
  • src/ai_idempotence_pool.erl — 13 commits
  • src/process — 13 commits
  • src/ai_string.erl — 11 commits
  • (repo) — 10 commits
  • src/ai_sql.erl — 10 commits
  • src/mq — 8 commits
  • src/ai_mutex.erl — 7 commits
  • src/ai_timer.erl — 7 commits
  • src/ai_file.erl — 6 commits
  • src/ai_http_cache.erl — 5 commits
  • src/transform — 5 commits
  • src/ai_function.erl — 4 commits
  • src/ai_http.erl — 4 commits
  • src/ai_process.erl — 4 commits
  • src/ai_semaphore.erl — 4 commits
  • src/ai_strings.erl — 4 commits
  • src/pool — 4 commits

Notable commits

  • fix: Fix bug in float
  • fix: Fix bugs in ai_mq
  • fix: fix ai_ascii_random
  • fix: fix blob close on different mode
  • fix: fix bug in cache
  • fix: fix bug on ai_http_cache when an etag is appeared we should use no_cache strategy
  • fix: fix bug on template supervisor
  • fix: fix bug when name is atom in ai_string:atom_suffix
  • fix: fix crash bug on ai_string:to_string, use unicode:characters_to_binary to replace erlang:list_to_binary when pass a list as argument
  • fix: fix erlang:atom_to_binary
  • fix: fix error on pg2_local
  • fix: fix ets name
  • fix: fix field escape error
  • fix: fix field escape error
  • fix: fix field escape error
  • fix: fix maybe in otp-27
  • fix: fix params error in file:read
  • fix: fix restart type
  • fix: fix running and waitting queue
  • fix: fix string error
  • …and 246 more

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

Survey your own repository

DavidAlphaFox/ailib 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 17 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 431f6f063f6b6e157aeaecb267db5547f36683e3 — the exact code this score is about.
  • Scored under rubric-2026.09.13 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-d1ef6c0bd534.