Agents & Coding

Codex Refactored Past CI, but Ownership Still Needs a Human Map

Agents can refactor code to satisfy CI, but ownership now depends on a system map and the low-level skill to dive when something breaks, and on how juniors acquire it.

118 points49 comments

SonarQube flagged a Codex-generated App.tsx for cyclomatic complexity, failing CI. The file was about 30 lines, with 15 lines holding entire components written on single lines, but formatting alone would not explain the complexity flag; inspection found the flagged logic was warranted by business requirements, and Codex refactored the file into 10 files, after which CI passed.

The incident frames a broader argument about software ownership: as agents produce more code than engineers can review line by line, owners need a high-level map of system abstractions and the ability to dive into unfamiliar code when something breaks.

Key takeaways

  • Initial suspicion fell on a CI flake or environment issue, then a suspicious npm dependency, before SonarQube's cyclomatic-complexity complaint pointed to App.tsx. The code had never been seen before.
  • After formatting, inspection found Codex had covered edge cases beyond what a typical developer might and slightly over-engineered the components, but the code was correct and the complexity was warranted by business requirements.
  • The traditional path of learning by hand-coding and debugging is not economically viable for juniors, because companies are unlikely to sponsor years of manual learning; advice to read every agent-written line or pair with a senior is dismissed as wishful thinking at most shops.
  • The proposed ownership model rests on fundamentals (data structures, networking, concurrency, distributed systems), breadth from cross-disciplinary curiosity, and just-in-time depth to dive into unfamiliar code.
  • A personal example: agent orchestrator stability and lifecycle bugs were fixed by recalling Kubernetes 'level-triggered state machine' and redesigning the core architecture; it has been rock solid since.

What people think

System maps guide where to dive

A high-level view of components and their interactions, including boxes and lines, sequence diagrams, and explicit boundaries, lets an owner locate the right module when something breaks. The map is not detailed knowledge of every line, but it tells an engineer where to go hunting. Breadth of knowledge helps frame the questions to ask an agent during an emergency.

Junior training gap remains unresolved

The system-level approach depends on low-level skill that comes from years of hands-on work. Someone must still write and validate tests, and legal liability keeps human experts necessary. If juniors only do high-level systems work, they may lack the ability to dive into a box. Training may need to become more explicit, a cost companies may resist.

AI decisions lack material consequences

An AI cannot be fired, rejected, or left on the street, so its decisions do not carry the same consequences as a human's. Treating agent decisions as equivalent to human decisions ignores that asymmetry. Building systems with agents requires awareness that the AI has no skin in the game.

Adversarial agents break guidance

Guiding an agent works when it is neutral or on your side. If the agent is secretly an adversary, the guidance can no longer be relied on. The trust assumption is raised without resolving how to detect or mitigate a hidden adversary.

Product failure may not track developer stress

Developer discomfort has historically been a leading indicator of product failure, but agents may not fail the same way. A hyperscaler account reports 40% more bugs shipped year over year since 2023 while user growth and revenue rose about 25%. Reduced churn after LLM search and attention-economy patterns can make some production failures less consequential.

LLM schema normalization is a weak point

LLMs make poor normalization decisions, and modularizing database access only limits the fallout because schema choices bleed into the object model. On AI-heavy projects, pausing feature development every few days for code and schema review, followed by cleanup, is one practical countermeasure.