Type-checked code is not wired code.

Type-checked code is not wired code.

Everyone is celebrating AI for writing more code.

I just used AI to delete code from my own project. 370 lines, gone in one PR.

Stuff that compiled. Stuff that passed clippy. Stuff that had types and tests. None of it was actually called from anywhere. Aspirational scaffolding — the half-finished work that nobody noticed because the surrounding code shipped.

This is the part of a codebase no one sees. Linters can't catch it. Type checkers approve it. Test suites pass with it AND without it, because nothing exercises it. It only surfaces when you ask the right question: "For each typed thing in this codebase — is it wired into the public surface, or just sitting there?"

Static analysis can answer that. The reason no one runs it: the answer is too noisy on real codebases. Generated code, escape hatches, framework-coupled symbols all look like orphans. You drown in false positives.

I built an audit pipeline that filters the noise.

Article content

Two oracles working together. The mechanical one excises the symbol and asks: does anything still call it? The interpretive one reads git history and asks: was the symbol ever wired in, or was it born orphan and forgotten?

  1. Born orphan → aspirational scaffolding, delete.
  2. Was wired, became orphan → legitimate dead code, delete.
  3. Excision-resistant despite zero callers → framework coupling, keep.

Four prompts (rank, discover, validate, emit), modeled on Anthropic's red-team agent scaffold from April. One supervisor. N parallel discoverers in isolated git worktrees.

Fresh-session validators that can't see each other's findings. Every step gates on a deterministic oracle.

First run on my own repo: 370 LOC deleted across three decisions. All born-orphan. All from PRs that landed the surrounding work but forgot the unwired piece.

Open-sourcing the methodology isn't the contribution. The contribution is the takeaway: Stop trusting type-checked code as evidence of wired code. They are not the same thing.

📌 TL;DR

  • AI is good at writing code. It's also good at finding code that should be deleted.
  • Four-prompt agent pipeline (rank → discover → validate → emit), built on Anthropic's red-team scaffold (published this April with Claude Mythos).
  • Pointed it at my own open-source Rust repo (rivet, ~50K LOC).
  • Found 370 lines of typed-but-unwired code that linters and type-checkers approved.
  • Trick: pair a mechanical oracle (excise + retest) with an interpretive oracle (git history — born orphan vs became orphan).
  • Methodology is open-source under scripts/mythos/. Try it on your own repo.

Method writeup: https://pulseengine.eu/blog/mythos-slop-hunt/

Repo: https://github.com/pulseengine/rivet

#AgentEngineering #CodeQuality #RustLang #LLM #AIEngineering

You had the honor to get your code reviewed by mythical Mythos? How did you get there? Is any OSS SW eligible?

Like
Reply

Let me get this straight... AI🧠 first creates the code for you, and then helps you delete💣 it? 🤯Just joking...

Like
Reply

To view or add a comment, sign in

More articles by Ralf Anton Beier

Others also viewed

Explore content categories