Map the project
Classes, namespaces, traits, container bindings, and blast radius — resolved deterministically the way Composer autoloads, for zero LLM tokens.
Magic methods, service-container wiring, and dynamic calls make PHP fast to write and hard for an AI to trace. Codna builds the dependency graph deterministically, so your AI PHP debugging starts from facts, not guesses.
The problem
A failing PHPUnit case can originate three classes away — through a trait, a `__call` magic method, or a service resolved at runtime from a Laravel or Symfony container. PSR-4 autoloading and dynamic dispatch mean the real caller is rarely in the file you opened, so engineers lose hours grepping through `vendor/` and stepping with Xdebug to find where the value actually came from. Pasting the whole project into a model is slow, lossy, and expensive. Codna resolves the call paths and container bindings first, then points the AI bug fix straight at the suspect file.
How Codna fixes it
Classes, namespaces, traits, container bindings, and blast radius — resolved deterministically the way Composer autoloads, for zero LLM tokens.
The AI coding agent gets the failing test, the call chain, and the suspect methods — about 600 tokens, roughly 162x less context than reading the repo.
Codna re-runs your own suite; the patch ships only when your tests pass, for about $0.04 per verified fix.
composer require --dev codna/cli codna fix . --issue "InvoiceService::total() returns null when a discount trait is applied"
What you get
Codna traces PSR-4 namespaces, traits, and container bindings with a deterministic engine — no embeddings, no RAG, and zero LLM tokens before the AI PHP bug fix begins.
The failing PHPUnit or Pest case is the oracle. Codna runs your suite and only proposes the patch when it goes green, so an AI PHP bug fix is proven, not guessed.
Because the AI pair programmer works from a ~600-token bundle instead of the whole repo, a verified fix costs about $0.04 — versus roughly a dollar for an agent that reads everything.
The proof
Codna maps your project deterministically — namespaces, traits, and service-container bindings — then hands an AI coding agent a ~600-token evidence bundle and verifies the patch with PHPUnit before it lands.
It's a full AI bug fix flow. Codna locates the root cause through the dependency graph, proposes the change, and proves it by running your own test suite — not a single-line suggestion.
Yes. The deterministic graph follows your autoloading, routes, and container bindings, so the AI PHP pair programmer sees the service that's actually injected at runtime, not a guess.
PHPUnit and Pest both work — Codna verifies fixes against your existing runner, so the failing test is the oracle that confirms the fix.
Yes. Codna maps trait composition and __call / __get dispatch across your classes, so the agent fixes the method that actually runs instead of the one that appears to.
Yes. You can self-host with your own model key (BYOK), egress fails closed, and your code is never used for training.
Related