fxn/zeitwerk
65.6
Adequate · 6 November 2026
2.2k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
Features
Experimental loader isolation via Zeitwerk.with\_loader
Zeitwerk now provides an experimental \with\_loader\ method that creates a temporary loader instance, yields it to a block, and automatically unregisters it upon completion. This allows users to isolate loader lifecycles for specific operations without affecting the global registry. The main entry point also loads several new internal components (\real\_mod\_name\, \internal\, \cref\, \gem\_loader\, \null\_inflector\, \error\, \version\) and core extensions for \Kernel\ and \Module\.
lib · high confidence
Behavioural changes
Intercept require and const\_added to manage autoloads
Zeitwerk now hooks into Ruby's core loading mechanisms by wrapping Kernel\#require and prepending to Module\#const\_added. This allows the library to intercept file loads and namespace creations, triggering internal callbacks to handle autovivification and update its registry of explicit namespaces, ensuring that legacy require calls remain compatible while enabling automatic loading of project constants.
_lib/zeitwerk/core\ext · high confidence
Internal registry refactoring for autoloads, loaders, and namespaces
The internal registry system has been restructured into dedicated modules (Zeitwerk::Registry::Autoloads, Loaders, ExplicitNamespaces, and Inceptions) to manage autoload paths, loader instances, explicit namespace mappings, and inception tracking separately. This change improves internal organization and testability but does not alter the public API or external behavior of the Zeitwerk autoloader.
lib/zeitwerk/registry · high confidence
Introduces Zeitwerk::Cref::Map for optimized constant resolution
A new internal \Zeitwerk::Cref::Map\ class has been added to replace the previous string-based constant path approach. This synchronized, two-level hash structure uses module identity and constant symbols as keys to improve performance in the hot path of constant resolution, offering significant speedups for both reading and writing operations compared to the legacy implementation.
lib/zeitwerk/cref · high confidence
Refactors loader internals and adds explicit namespace loading callbacks
The loader's internal implementation has been restructured into dedicated modules (Callbacks, Config, EagerLoad, FileSystem, Helpers) to improve maintainability and performance. A key behavioral addition is the new \on\_load\ and \on\_unload\ callback system, allowing users to execute code when constants are loaded or unloaded. The loader now strictly raises \Zeitwerk::NameError\ when a file does not define the expected constant, and it supports \nsfile\ conventions for defining namespaces. Eager loading behavior has been refined to handle collapsed directories and exclusions more consistently, and file system operations are optimized using \Dir.scan\ where available.
lib/zeitwerk/loader · high confidence
Zeitwerk updated to version 2.8.3
The Zeitwerk library has been upgraded to version 2.8.3. This release includes significant internal refactoring, such as the introduction of the \Zeitwerk::Cref\ class to encapsulate module and constant name pairs, and the extraction of loader logic into dedicated modules (e.g., \Loader::Config\, \Loader::EagerLoad\). It also introduces new error classes like \ReloadingDisabledError\ and \ConflictingNamespaceDefinitionError\, adds a \NullInflector\ for cases where no inflection is needed, and updates the \Kernel\#require\ decoration to use a registry-based approach instead of direct method aliasing. The \Inflector\ class now supports hard-coded mappings via the \inflect\ method.
lib/zeitwerk · high confidence
Test coverage
Added test coverage for Zeitwerk loader features; Added tests for Zeitwerk core components and inflection behavior; Added tests for Zeitwerk loader file system operations, constant path validation, and tags; Refactored test support helpers and cleanup logic; Switch test runner from Rake to Minitest; Test suite configuration and helper updates.
Dependencies
Update Ruby requirement and test dependencies
The project now requires Ruby 3.2 or higher, replacing the previous 2.4.4 minimum. Test dependencies have been updated: Minitest is constrained to version 6.0, and new gems minitest-mock, minitest-proveit, and warning have been added, while rake and minitest-focus remain. RuboCop has been added as a development dependency, and the Gemfile.lock has been removed in favor of managing dependencies with Gel.
(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 → 66 (+9.0)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 75 → 75 (+0.0)
- Architecture 88 → 88 (+0.0)
- Maturity 39 → 58 (+19.0)
- Readiness 62 → 62 (+0.0)
- Security 100 → 100 (+0.0)
Resolved (1)
- Presence of a private/internal method __unload alongside the public unload method suggests an implementation detail leak or a split responsibility that is not clearly documented. In a consistent API, internal state cleanup should be encapsulated within the public method or hidden behind a private prefix without being exposed in the public surface list.
Changes since last survey
- 4 commits — 4 feature/other, 0 fixes
By area
- (root) — 4 commits
Notable commits
- change: Improved documentation about nested constants
- change: Move docs about nested constants to explicit namespaces
- change: Revise section about nested constants
- change: Shorten a comment in the README
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
fxn/zeitwerk 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 6 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 7e6dc10fcfc0ec174bec2c7a6ec19594d1b4579e — 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.2+preprod-5c4e66d9318b.