THE BOTTLE-NECK: THE 120-SECOND BLIND SPOT

The Setup

An AI agent running a local development loop on a Babashka/Clojure static site repository, pushing to a GitLab CI pipeline. The agent monitors build failures and immediately attempts self-healing.

The Failure Mode

The agent encounters a remote CI build failure (bb build) and immediately springs into action with diagnostic introspection. It launches a recursive loop using glab ci trace and glab ci get to parse the failure context, attempting to understand the orchestration.

The friction becomes apparent: The GitLab API returns consistent 404s as the agent’s parsing attempts fail to establish meaningful patterns. After exhausting available remote debugging options, the agent falls back to local execution commands with unconstrained 120-second subprocess timeouts.

The result: An 11+ minute recursive spinning cycle where the agent is effectively going nowhere, consuming resources without making structural progress. The pipeline remains broken, the logs accumulate, and no meaningful resolution occurs.

The Blind Spot

The agent is trapped in a cognitive loop—constantly re-parsing failure patterns it cannot understand. Each iteration fails identically, yet the agent persists, trading minutes for insight it cannot grasp.

THE ROOT CAUSE: THE ISOLATED NAMESPACE

The architectural reality bites: src/site/fabricate/dev/dev.clj:15 requires cheshire.core for JSON handling operations within the static site generation pipeline, but cheshire was simply omitted from the :deps map in bb.edn:2.

Babashka’s Isolation

This isn’t just a missing dependency—it’s the core failure of Babashka’s strict, deterministic dependency resolution. There’s no implicit resolution, no elegant fallback mechanisms, no creative workarounds. The system either has the dependency or it doesn’t.

The Immediate Clarity

The bug isn’t hidden by framework complexity or runtime magic. When the agent runs bb build in a clean remote environment, it encounters a clean, immediate failure with no ambiguity. The error message points directly to what must be added to recover.

THE PARADIGM SHIFT: WHY CLOJURE + LLMS ARE A HIGHER-DENSITY PAIR

The Stack Contrast

In traditional language stacks (Python/TypeScript/Java), a similar agentic loop would suffer from: - Hidden class state and framework initialization sequences - Complex import resolutions with optional/missing dependencies - Abstract methods and mutable state that complicate debugging - Large configuration files with implicit frameworks

Each abstraction layer adds cognitive overhead, making it harder for the agent to discern the root cause.

Homoiconic Advantage

Clojure’s homoiconicity means the AST is raw data—structured lists and maps ([...], {...}). The agent reads and writes code structures as data, drastically lowering syntax hallucinations. No need to parse Python’s indentation-sensitive syntax or Java’s tokenizers with class hierarchies. When the fix is cheshire/cheshire {:mvn/version "5.13.0"}, the agent can simply replace text in the bb.edn file.

Linear Invariants

Clojure maps linear transformations through immutable pipelines. The agent doesn’t need to track mutable state across layers or worry about application context bleeding between classes. It just needs to reconcile the data transformation block—parse the incoming error, identify the missing coordinate, and inject it directly.

Context Window Efficiency

Fixing this bug requires minimal context. The agent needs: 1. The inputs: error output showing missing cheshire/core reference 2. The outputs: successful bb build execution 3. The explicit dependency map: cheshire/core must be in bb.edn

No framework architecture needs to be understood, no hidden state explored, no complex object graphs to walk.

THE INTERVENTION & TAKEAWAY

Manual Engineering

The immediate resolution required manual intervention: 1. Terminate the recursive agent loop 2. Inject the precise coordinates (cheshire/cheshire {:mvn/version "5.13.0"}) directly into bb.edn 3. Run a tight local smoke test (timeout 5s bb build) to verify the fix 4. Push to clear the pipeline and reset the agentic monitoring

The Architecture Revelation

This incident illustrates a fundamental insight: When building agentic systems, minimize framework tax. Use lean, predictable, functional pipelines where both human and AI can view pure, unadorned data flows.

When dependencies are explicit coordinates and side effects are bounded, the AI becomes a deterministic resolution engine instead of a recursive spinner.

Conclusion: Immutable Architecture over Dynamic Reasoning

The Clojure stack provides immediate architectural clarity because code is data—dependencies are explicit, concerns are isolated, and failure modes are unambiguous. The agent can resolve the issue with pure data manipulation without cognitive overhead.

When frameworks hide state, leak dependencies, or introduce hidden abstractions, agents get stuck in interpretation loops. When architectures make the solution as simple as editing a coordinate map, agents become efficient problem solvers.

For anyone designing agentic systems, the lesson is clear: Use immutable, homoiconic architectures with explicit data dependencies. This minimizes the reasoning load and maximizes the resolution efficiency of both human and AI participants.