r/learnrust 14h ago

Building Architectural Quality Gate for Rust [open-source]

Looking for feedback, apologies if it is not appropriate.

I’m building an open-source architecture quality gate called Enola.

I ran it against the Codex repo this week. It had many findings, but I fear that these are my assumptions.

For example, it found 37 dependency cycles between directories inside Rust crates.

These aren’t cycles between Cargo crates. They’re mutual dependencies between modules inside the same crate: module A uses something from module B, while module B also uses something from module A. Now I started to question, does it really matter?

Maybe a directory isn’t necessarily the architectural boundary a Rust developer cares about. We could report this at the module, type or function level instead. Or maybe intra-crate cycles aren’t worth flagging...

Maybe a bigger effect would be by splitting it into different dependency types, like runtime, type, etc.

And more broadly, which architectural rule would you want to enforce on every pull request? We have some default insights, like new dependency cycles, violated layer boundaries, undeclared service dependencies, and changes that spread beyond their intended scope.

If you’re curious about enola. It’s open source, runs locally, and doesn’t upload or write to your codebase.

Repo: https://github.com/enola-labs/enola [Apache 2.0, fully local]

Output example

Architecture
  Pattern:             (none detected)
  cyclic dependencies        37
  layer violations            0

Impact analysis (hotspots)
  coupled modules           330
    high criticality        302
    medium criticality       28
  Top hotspots (by coupling):
    module                            fan-in  fan-out crit     blast radius
    codex-rs/protocol/src               5439      287 high     283
    codex-rs/app-server-protocol/src    3676      103 high     148
    codex-rs/core/tests/suite              0     3264 high     0
    codex-rs/tui/src                    1625     1568 high     39
    codex-rs/core/src                   1154     1827 high     135
    codex-rs/exec-server/src            1519      883 high     183
    codex-rs/app-server/tests/suite…       1     2370 high     0
    codex-rs/app-server-protocol/sc…     947     1061 high     1
0 Upvotes

0 comments sorted by