CSE Roadmap

Common tier · about 5 hours · 12 parts

Part 2 of 12 · 2 min read

Why a harness bounds what the model can touch

The model proposes; the code around it decides what is even allowed to happen.

Think of a workshop with safety rails fitted around the power tools. The person using the tools decides what to build, but the rails decide what they physically can and cannot do with them, regardless of what they intend.

In plain words: a coding agent is a model wrapped in a harness, and the harness — not the model's good intentions — is what actually enforces which files can be touched, how big an edit can be, and how it gets tested.

A worked example. The harness only accepts an edit that matches exactly one place in a file, refusing both zero matches (nothing to change) and several matches (ambiguous about which one). It also refuses an edit that touches a protected path like a test file, or one that would change more than 40 lines in one go — forcing a large change to be split into reviewable pieces.

The key lines. From code/mini-coding/workspace.py:

# from code/mini-coding/workspace.py
def edit(self, path, old, new):
    if self.is_protected(path):
        raise GuardError(f"{path} is protected")
    text = self.read(path)
    n = text.count(old)
    if n != 1:
        raise GuardError(f"expected exactly one match for the old text, found {n}")
    if max(old.count("\n"), new.count("\n")) + 1 > self.max_edit_lines:
        raise GuardError("edit too large; split it")

Read it as: every one of these checks runs before a single character of the file changes. The model can propose anything. But the harness is what turns a proposal into an actual edit, or refuses it outright.

Harness

The code around a model that provides tools, enforces limits, runs checks and decides what is accepted — the model proposes, the harness enforces.

Example: the one-match-only rule above, which refuses an edit the moment it's ambiguous, before the model's intent even enters into it.