Skip to content
CAI
Software that uses CAICheck a score

slepher/astranaut

65.4

Adequate · 17 September 2026

21.6k

lines of production code

Erlang

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

Astranaut is an Erlang library that provides a macro system and compile-time parse transforms for code generation and transformation. It supports configurable quote contexts, local macro isolation, and Haskell-style monadic 'do' syntax through specialized AST manipulation. The system includes tooling for performance benchmarking, syntax schema validation, and comprehensive test coverage using Common Test and EUnit.

Features

Added macro compilation benchmarks for performance validation

The benchmark directory now includes a suite of tools to measure macro expansion and compilation performance. This adds a generated workload (\macro\_2000.erl\) with deep nested structures to test AST depth handling, a desensitized real-world workload (\real\_benchmark.erl\) extracted from production code to measure realistic expansion costs, and a runner script (\macro\_compile\_bench.escript\) that reports parse-transform and compilation times. Supporting files include a minimal macro provider (\do\_macro.erl\) and header definitions (\realbench\_min.hrl\) to isolate the benchmark from external dependencies.

benchmark · high confidence

Introduce new parse\_transform modules for compile metadata, options, and monadic 'do' syntax

This change adds several new Erlang modules to the \src\ directory that extend the Astranaut macro and transformation system. \astranaut\_compile\_meta\_transformer\ and \astranaut\_compile\_opts\ are new parse\_transforms that inject exported functions to expose transformed forms, compile errors, warnings, and the original compile options of a module, enabling better introspection and debugging of the transformation pipeline. \astranaut\_do\ introduces a new \do\ syntax construct that transforms list comprehensions into monadic bind chains, supporting Haskell-style monadic code within Erlang. These modules work in conjunction with the existing macro infrastructure (\astranaut\macro\\*\) to provide a more robust and feature-rich compile-time transformation environment.

src · high confidence

New development and validation tooling scripts

Added several new scripts to the project: \check\_syntax\_schema.escript\ audits \erl\_syntax\ compatibility across OTP versions 21–29 by comparing a local schema against fetched source code; \generate\_syntax\_schema.escript\ compiles the \src/syntax.term\ schema into a direct-dispatch Erlang module (\astranaut\_syntax\_schema.erl\); \cover\_report.escript\ generates a JSON coverage report from rebar3 eunit and common test data; \fetch\_absforms.sh\ and \fetch\_absforms.ps1\ download Erlang/OTP absform documentation for versions 21–29; and \rebar3\_sandbox.ps1\ configures the Erlang inet resolver for sandboxed environments.

scripts · high confidence

Behavioural changes

Astranaut 0.13: Configurable quote context, macro isolation, and OTP 21+ requirement

Astranaut now requires Erlang/OTP 21 or higher, dropping support for OTP 19 and 20. Quote variables are encoded using a configurable context (defaulting to the current source module) instead of the module name, with options to explicitly set the context or disable it entirely; this is a breaking change requiring a clean rebuild of all modules using Astranaut macros. Local macro support is now an optional, lazily registered capability, meaning modules without \-local\_macro\ declarations no longer load the local macro subsystem. The library also introduces a shared diagnostic formatter protocol, explicit ownership for macro diagnostics, and improved handling of macro exceptions. Additionally, the build configuration has been updated to include cover analysis, specific Erlang first files, and plugins for Docker CI and release tree generation.

(repo-wide) · high confidence

Centralized include files for compile-time transformations and OTP version checks

The project now provides a set of centralized header files in the include directory to manage compile-time behaviors and dependencies. These files introduce parse\_transforms for specific features: \compile\_meta.hrl\ and \compile\_opts.hrl\ enable the \astranaut\_compile\_meta\_transformer\ and \astranaut\_compile\_opts\ respectively; \do.hrl\ enables the \astranaut\_do\ transform; \rebinding.hrl\ enables the \astranaut\_rebinding\ transform; and \struct.hrl\ enables the \astranaut\_struct\_transformer\ while importing necessary macros. Additionally, \otp\_vsn.hrl\ centralizes OTP version checking by defining macros like \ASTRANAUT\_OTP\_VSN\ and \ASTRANAUT\_OTP\_VSN\_GE\, and \astranaut\_struct\name.hrl\ defines internal constants such as \\\struct\\_\ and various return/error atoms used by the library's internal components.

include · high confidence

Test coverage

Added sample Plus module for EUnit testing; Migrate test suite to EUnit and expand coverage; Migrate unit tests to Common Test (EUnit).

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 65.

Lenses

  • Code Health 92
  • Architecture 98
  • Maturity 67
  • Readiness 63
  • Security 57
  • Event Sourcing 100

Changes since last survey

  • 300 commits — 273 feature/other, 27 fixes

By area

  • (root) — 69 commits
  • src/astranaut.erl — 35 commits
  • openspec/changes — 33 commits
  • test/astranaut_macro_SUITE_data — 25 commits
  • src/astranaut_quote.erl — 21 commits
  • src/astranaut_macro.erl — 16 commits
  • docs/plan — 12 commits
  • src/astranaut_uniplate.erl — 12 commits
  • src/astranaut_syntax.erl — 9 commits
  • .github/workflows — 7 commits
  • src/astranaut.app.src — 6 commits
  • src/astranaut_lib.erl — 5 commits
  • test/astranaut_rebinding_SUITE_data — 5 commits
  • src/monad — 4 commits
  • src/astranaut_disable_tco.erl — 3 commits
  • src/astranaut_monad.erl — 3 commits
  • .codex/skills — 2 commits
  • scripts/generate_syntax_schema.escript — 2 commits
  • src/astranaut_compile_meta_transformer.erl — 2 commits
  • src/astranaut_traverse.erl — 2 commits

Notable commits

  • fix: Fix AST option handling and expand coverage
  • fix: Fix CI: clean all apps including deps before ct
  • fix: Fix OTP 23 transform position detection
  • fix: Fix compatibility and release metadata
  • fix: Fix guard macro expansion and add realistic benchmark
  • fix: Fix macro use validation errors
  • fix: Fix quote input validation
  • fix: Fix record_field revert crash on OTP 27 syntax_tools
  • fix: Fix shell CI case selection and expand coverage
  • fix: Fix syntax projection and OTP 29 validation
  • fix: Fix transform validation scope
  • fix: Fix traversal contracts and validation formatting
  • fix: Pass raw syntax nodes through unchanged in revert
  • fix: Remove fmt from CI, move erlfmt plugin to global config, fix maybe parse on OTP 25-26
  • fix: Simplify syntax APIs and fix legacy OTP validation
  • fix: fix all bugs after modify
  • fix: fix bad ref of erl_af_
  • fix: fix bug of options in quote_code
  • fix: fix bug of options in quote_code
  • fix: fix bug of transform_m
  • …and 280 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

slepher/astranaut 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 23a69d3d7737a599c9f7bab21bce03d4eb9012c5 — the exact code this score is about.
  • Scored under rubric-2026.09.12 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-f94092f054c1.