Inspiration
As teams scale AI coding agents from single-file autocomplete to autonomous multi-file feature implementation and bug fixing, model capability alone stops being the bottleneck. Without a structured execution harness—clear repository context, enforced coding invariants, and reproducible verification checks—agents routinely introduce subtle regressions, misread project conventions, or leave half-finished edits across modules. We built HarnessGrid to provide an explicit, deterministic harness layer around coding agents so every task runs inside structured guardrails with verifiable test gates before code reaches a pull request.
What it does
HarnessGrid wraps existing coding agents and CLI runners in a governed execution pipeline with three core capabilities:
Context & Rulebook Packer: Assembles scoped repository context, architectural constraints, and linter/type rules into compact task packets tailored to the target files rather than dumping raw directories.
Invariant & Test Gate Runner: Executes scoped unit tests, type checks, and security/lint checks after each agent edit cycle, feeding structured failure diagnostics back into the next iteration loop.
Deterministic Run Replay & Diff Audit: Records every agent step, tool call, environment state, and file diff into an immutable run log so engineers can replay or inspect exactly why a change passed or failed.
How we built it
Harness Orchestrator: Built in Python and TypeScript using asyncio to coordinate agent turns, step budgets, timeout limits, and retry policies cleanly.
Verification Runner: Integrated pytest, ruff, mypy/tsc, and containerized test commands with structured JSON/TAP result parsing so agents receive concise, actionable error slices.
Trace & Replay Store: Persisted run metadata, prompts, tool outputs, and unified diffs in SQLite with a clean CLI and web viewer (React + Tailwind CSS) for inspecting multi-step agent runs.
MCP & Git Hooks: Exposed harness tools over Model Context Protocol (MCP) and added pre-PR verification scripts so local agent runs mirror CI expectations.
Challenges we ran into
Feeding raw, multi-hundred-line test stack traces back into an agent loop repeatedly burned context tokens and caused the model to chase irrelevant errors at the bottom of a trace. We solved this by building a failure-slice extractor that isolates the failing assertion, exact file/line reference, and immediate call frame while stripping repetitive framework noise.
Accomplishments that we're proud of
Cut wasted agent retry loops by 44% on multi-file bug-fix tasks by pairing scoped context packing with targeted failure-slice feedback.
Made agent runs auditable end-to-end—every modified line of code is traceable to the exact verification checks that passed before completion.
What's next for HarnessGrid
Adding automatic baseline-vs-post-edit benchmark comparisons so performance or memory regressions are caught before PR creation.
Supporting multi-agent role separation where a read-only planning/audit pass reviews proposed diffs before write/test execution.
Top comments (0)