# Data on AI code and "code maintainability metrics" show negative correlation

**URL:** <https://discourse.julialang.org/t/data-on-ai-code-and-code-maintainability-metrics-show-negative-correlation/140000>\
**Category:** Community\
**Tags:** ai\
**Created:** [October 13, 2026, 12:21pm UTC](https://discourse.julialang.org/t/data-on-ai-code-and-code-maintainability-metrics-show-negative-correlation/140000 "2026-10-13T12:21:23Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![durantschoon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/durantschoon/32/224940_2.png) [@durantschoon](https://discourse.julialang.org/u/durantschoon)\
**Post date:** [November 3, 2026, 3:51pm UTC](https://discourse.julialang.org/t/data-on-ai-code-and-code-maintainability-metrics-show-negative-correlation/140000/9 "2026-11-03T15:51:10Z")

</div>

> [@langestefan](#):
>
> A more interesting question is what code quality metrics are still useful if all of the code is handled by robots?

Running into this exact problem while using coding agents on a performance-sensitive Julia package, two categories of checks turned out to matter much more for agents than they do for humans:

1. **Structural & symbol discovery (preventing the copy-paste / duplication tax):** Agents duplicate helpers and bypass multiple dispatch largely because they navigate by blind regex `grep` and only see small file slices. Giving the agent an AST knowledge graph (`graphify` over `tree-sitter-julia`) and a Universal Ctags symbol table (`ctags`) so it queries existing abstract types, structs, and methods before writing code cuts down on reinvented functions.
2. **Millisecond edit-time AST gates + semantic runtime gates:** `JET.jl` and `Aqua.jl` are essential, but agents also need fast (~10ms) structural checks they can run on every edit to catch LLM-specific Julia habits—like putting `@allocated` at top level in tests (where it measures global boxing), defining overlapping `::Real` and `where {T <: Real}` methods that overwrite each other during precompilation, or leaving struct fields untyped/abstract.

I actually just shared the rules, `ast-grep` linters, and a 10-task A/B measurement (bare repo vs. directives + AST/allocation gates) over in the Tooling category today if anyone is experimenting with deterministic guardrails for this: [Julia-agent-tools: agent directives, ast-grep rules, and a ctags optlib for Julia](https://discourse.julialang.org/t/julia-agent-tools-agent-directives-ast-grep-rules-and-a-ctags-optlib-for-julia/142735)

---

_[View the full topic](https://discourse.julialang.org/t/data-on-ai-code-and-code-maintainability-metrics-show-negative-correlation/140000)._
