Topic: Harness engineering — steering agents toward project conventions, and refining that over time

This page is a curated overlay, not an ontology node. It gathers pages from across the wiki around one theme and links out to them; it stores no edges and changes no synthesis. See CONVENTIONS §The topic layer.

The question this topic answers: how do you make an agent deliver according to a project’s conventions — and improve that alignment as the project (and the model) evolve? Martin Fowler’s Harness Engineering gives the sharpest available frame, and it maps almost one-to-one onto pages this wiki already holds. This page threads them together.

A terminology warning first

Fowler uses “harness” for everything a team builds around the model to steer it — explicitly not the CLI. His builder harness (vendor-baked system prompt, retrieval, orchestration) overlaps this wiki’s harness-node primitives; his user harness (the controls a team constructs) is what this wiki splits across the pattern, artifact, and harness-config layers.

So Fowler’s harness ≠ this wiki’s harness node. This wiki pins harness to the agent program (claude-code, pi, …); Fowler’s harness is a broader control system. When reading across the two, translate: Fowler-harness ≈ (this wiki’s harness primitives) + (the patterns and artifacts a team applies on top). This page uses Fowler’s vocabulary for the controls — guides, sensors, steering loop — while keeping “harness” (unqualified) meaning the wiki’s agent-program node.

The control system: guides + sensors, closed by a steering loop

Fowler frames the whole apparatus as a cybernetic governor — a regulator with two arms:

  • Guides (feedforward controls) — steer the agent before it acts, to raise first-attempt quality. The wiki’s prescribed / externalized-knowledge pages.
  • Sensors (feedback controls) — let the agent (or a reviewer) self-correct after it acts. The wiki’s verification / review pages.
  • The steering loop — “whenever an issue happens multiple times, the controls should be improved.” The wiki’s knowledge-compounding pages, pointed at the controls themselves.

“A well-built outer harness … increases the probability that the agent gets it right in the first place, and provides a feedback loop that self-corrects.” Neither arm is sufficient alone.

Guides (feedforward) — what the wiki already has

Externalized, project-specific knowledge the agent reads before acting — the standing answer to “we don’t do it that way here,” which the model has no intuition for:

Sensors (feedback) — what the wiki already has

Checks applied after the agent acts, catching what the guides didn’t prevent:

Fowler’s own split cuts across these sensors by cost and reliability:

The practical rule Fowler implies: prefer a computational control when one exists (cheap, deterministic, un-gameable), and reserve inferential controls for the semantic judgments no linter can make. A small verifier is exactly how you promote an advisory guide into a sensor without bloating the rules file.

Adjacent but distinct: pattern-edit-guardrails is a preventive control — it blocks a destructive or out-of-scope action rather than detecting a defect after the fact. It belongs to the harness’s safety envelope (permissions/hooks) more than to either guide or sensor; include it when reasoning about the full control set.

The steering loop (refinement over time) — what the wiki already has

The loop that improves the controls when a failure recurs — the answer to “refine this over time”:

This is why a lifecycle can be a loop rather than a line — see stage-learn, plausibly the first genuinely new SDLC stage of the agent era.

Keep quality left

Fowler’s “keep quality left” restates, for agents, the classic shift-left: push checks as early as possible, because a defect is cheapest where it is introduced. In the wiki this is pattern-shift-left, with pattern-test-driven-development as its earliest gate and pattern-plan-verification-loop as a pre-code sensor on the plan. Under autonomy the argument only sharpens: a stray agent edit caught by a pre-commit hook never reaches review.

Regulation dimensions (what is being governed)

Fowler taxonomizes control systems by what they regulate — a lens the wiki lacks and could adopt:

A gap this frame exposes: harnessability

Two Fowler concepts have no home in the wiki yet and are worth flagging:

  • Harnessability — how amenable a codebase is to harness controls, given its structure.
  • Ambient affordances — “structural properties of the environment itself that make it legible, navigable, and tractable to agents.”

These sit upstream of every guide and sensor: a legible codebase needs fewer of both. The nearest existing pages are pattern-deep-modules and mp-domain-modeling (a legible domain/ubiquitous language), but neither captures “shape the environment so the agent needs less harness.” A candidate future pattern-ambient-affordances (or a note on pattern-deep-modules) would close it.

How the pieces map

Fowler termThis wiki
Harness (whole control system)harness-node primitives + the pattern/artifact layers on top — not the harness node alone
Builder harnessthe claude-code-style harness primitives (system prompt, retrieval, sub-agents)
User harnessthe guides + sensors a team applies (pattern-context-engineering, the review patterns, …)
Guide (feedforward)pattern-project-constitution, pattern-context-engineering, artifact-standards, artifact-adr, pattern-source-grounding
Sensor (feedback)pattern-plan-verification-loop, pattern-adversarial-review, pattern-evidence-before-claims
Computational controllinters/tests/types — gstack-health, addy-ci-cd, pattern-test-driven-development
Inferential controlLLM-as-judge — pattern-adversarial-review, pattern-cross-model-review
Steering looppattern-knowledge-compounding, warren
Keep quality leftpattern-shift-left
Harnessability / ambient affordances(gap) — nearest: pattern-deep-modules

How they adapt as models improve

The frame also settles the “fewer conventions now needed” debate by splitting the guide layer:

  • Derivable guides shrink. Style, idiom, “write tests,” framework best-practice — the model’s priors increasingly cover these, so spelling them out becomes dead weight that dilutes attention. Delete them; lean on priors + a computational sensor to catch the rare miss.
  • Non-derivable guides persist and accumulate. “We use X not the obvious Y because Z,” domain language, past-incident lessons — never inferable from training data. This is the irreducible kernel the steering loop banks.
  • The centre of gravity moves from guide to sensor. A stronger model responds better to a crisp sensor on its output than to a long guide on its input: verify, don’t instruct.
  • Guardrails don’t shrink with model IQ. pattern-edit-guardrails exists for blast-radius under autonomy, not to patch ignorance — run more parallel agents and you need more of it.

Net: the authored guide layer thins toward the project-specific kernel; sensors and the steering loop grow in relative weight.

See Also