Abstract:
Autonomous coding agents do not write perfect code on the first attempt; their real capability lies in closed-loop self-correction. However, self-correction requires high-signal, deterministic feedback. Exposing an agent to raw human-oriented terminal logs—overflowing with ANSI formatting, thousands of irrelevant lines, and unstructured error traces—causes hallucination and thrashing. This article analyzes the principles of Sensor Engineering and Agent-Computer Interface (ACI) design (pioneered by SWE-agent, arXiv:2405.15793), contrasts open-ended agent loops with structured pipeline repair (Agentless, arXiv:2407.01489), and details how to build sub-5-second verification sensors.
For fifty years, developer tooling was optimized for human eyes: colored terminal output, interactive pagers, visual spinners, and multi-page stack traces. When fed to an LLM, these interfaces degrade reasoning:
┌─────────────────────────────────────────────────────────────────────────────┐
│ HUMAN UI VS. AGENT ACI COMPARISON │
├──────────────────────────────────────┬──────────────────────────────────────┤
│ Human Developer Interface │ Agent-Computer Interface (ACI) │
├──────────────────────────────────────┼──────────────────────────────────────┤
│ • ANSI color escape codes (\033[31m) │ • Clean, unformatted ASCII or JSON │
│ • Interactive prompts (y/N) │ • Strictly non-interactive execution │
│ • 2,000-line verbose stack traces │ • Filtered top-3 actionable frames │
│ • Full file dumps in less/vim │ • Windowed line ranges [L120-L150] │
│ • Ambiguous natural language errors │ • Explicit file, line, col, and rule │
└──────────────────────────────────────┴──────────────────────────────────────┘
In SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering (Yang et al., Princeton, arXiv:2405.15793), the authors demonstrated that designing custom command interfaces specifically for LLMs increased software issue resolution from under 4% to over 12% on SWE-bench without altering the underlying model weights.
When a compiler or test runner fails, the sensor must translate the raw output into a structured diagnostic object before injecting it back into the model context:
npm test
> app@1.0.0 test
> jest
FAIL src/auth/jwt.spec.ts (14.2s)
● JWT Verification › should reject expired token
expect(received).toBe(expected) // Object.is equality
Expected: 401
Received: 500
34 | const res = await request(app).get("/protected").set("Authorization", expiredToken);
35 | expect(res.status).toBe(401);
| ^
at Object.<anonymous> (src/auth/jwt.spec.ts:35:24)
... 45 lines of internal jest and node_modules stack frames ...
{
"sensor": "unit_test_failure",
"target_file": "src/auth/jwt.ts",
"test_file": "src/auth/jwt.spec.ts",
"failed_assertion": {
"line": 35,
"expected": 401,
"actual": 500,
"message": "Expected 401 Unauthorized for expired token, but endpoint returned 500 Internal Server Error."
},
"relevant_code_slice": {
"file": "src/auth/jwt.ts",
"lines": "84-96",
"code": "84: const payload = jwt.verify(token, secret);\n85: if (!payload) throw new Error('Invalid');"
},
"suggested_action": "Verify exception handling in src/auth/jwt.ts around line 84: TokenExpiredError throws an unhandled exception resulting in a 500 response instead of returning a 401."
}
By removing 90% of the token clutter and highlighting the exact line of code and root cause, the probability of the agent fixing the bug on the next turn increases dramatically.
Autonomous self-correction requires rapid iteration loops. If an agent must wait 3 minutes for a test suite to run after every minor edit, token budgets and wall-clock times explode.
Production harnesses implement a Cascading Sensor Hierarchy:
CASCADING SENSOR HIERARCHY
Agent Patch
│
▼
┌───────────┐ Fail (<50ms)
│ L1 Sensor ├──────────────────► Fast AST / Syntax Check (Ruff, Oxlint)
└─────┬─────┘
│ Pass
▼
┌───────────┐ Fail (<1.5s)
│ L2 Sensor ├──────────────────► Incremental Type Check (tsc, mypy, cargo check)
└─────┬─────┘
│ Pass
▼
┌───────────┐ Fail (<4s)
│ L3 Sensor ├──────────────────► Test Impact Analysis (TIA - Only affected tests)
└─────┬─────┘
│ Pass
▼
┌───────────┐ Fail (Pre-Merge CI)
│ L4 Sensor ├──────────────────► Full Repository Integration Suite
└───────────┘
Instead of executing pytest or npm test across the entire repository (which could run for 10+ minutes), the harness analyzes the Git diff against the project's dependency graph:
* If the agent modified user_service.py, the sensor inspects the import graph and executes only test_user_service.py and test_auth_flow.py.
* Latency reduction: 95% reduction in test cycle time, enabling 10+ autonomous correction cycles per minute.
A major empirical insight from UIUC researchers in Agentless: Demystifying LLM-based Software Engineering (Xia et al., arXiv:2407.01489) was that open-ended, autonomous agent loops often over-complicate tasks:
Open-Ended Agent Loop (SWE-agent / AutoGen)
[Think] ──► [Tool Call] ──► [Observation] ──► [Think] ──► [Tool Call] ──► ... (Unbounded, High Drift)
Structured Pipeline Architecture (Agentless)
Phase 1: Localization ──► Phase 2: Patch Generation ──► Phase 3: Sensor Verification
(Strict State Gates, Deterministic Step Control, Drastically Lower Token Cost)
A mature harness often combines both: using an autonomous loop for discovery, but locking into a rigid pipeline once candidate files and reproduction tests are identified.
We haven't launched yet. But leave your email to get notified about exciting things that we will launch.