Skip to content

Coding harness

The coding harness is what turns a propose agency-profile session into actual code changes. The agents-package surface is the harness protocol and AgencyInvokeTool. The application that drives it is Smithers (@open-matrix/smithers).

Where the pieces live

ConcernPackage
Harness data shapes@open-matrix/agents/src/harness/HarnessRun.ts
Harness protocol (harness.start/stop/steer/status/history)@open-matrix/agents/src/harness/HarnessProtocol.ts
AgencyInvokeTool (spawns sessions for a profile)@open-matrix/agents/src/harness/AgencyInvokeTool.ts
Constraint convergence over an issue@open-matrix/smithers (SmithersSupervisor)
Coding session runtime@open-matrix/smithers/src/coding-agent/CodingAgent.ts
Inference for the coding agent@open-matrix/inference-catalog (today)

Smithers's role

Smithers (matrix.json declares mount: 'smithers', accept set includes smithers.start, smithers.steer, smithers.status, etc.) is the constraint-convergence orchestrator. Its loop:

  1. Pick a target (a GitHub issue).
  2. Walk the constraint graph for that target.
  3. Spawn agency-profile sessions through AgencyInvokeTool (typically propose for code edits, evaluate for verification).
  4. Watch activity frames; record iteration outcomes via HarnessRun.recordHarnessIteration.
  5. Decide convergence: ratchet on green checks, escalate on red.

SmithersSupervisor is itself a Matrix actor with static accepts for management ops. The constraint logic lives in ConstraintGraph / ConstraintActor / ConstraintGroupActor. This is not a Stanford-style meta-harness — it's a concrete domain harness over GitHub issues.

AgencyInvokeTool

From harness/AgencyInvokeTool.ts:1-7 exports:

ts
export { agencyInvoke, startHarnessProfileSessions } from './harness/AgencyInvokeTool.js';
export { HARNESS_ACCEPTS, HARNESS_EVENTS } from './harness/HarnessProtocol.js';
export { attachHarnessSession, completeHarnessRun, createHarnessRun, recordHarnessIteration } from './harness/HarnessRun.js';

agencyInvoke(input) accepts an AgencyInvokeInput (target ref, profile key, optional message) and returns an AgencyInvokeResult with the session id and stream pointers. startHarnessProfileSessions is the convenience that opens a fan-out of sessions across multiple profiles.

What's wired today

  • The data shapes (HarnessRun, HarnessIteration, HarnessActiveSession) and protocol accepts (harness.start/stop/steer/status/history).
  • agencyInvoke to spawn sessions through system.agents.
  • Smithers's constraint convergence flow.
  • Container-managed worker spawning via ContainerManager (cousin of Smithers).

What's NOT wired

  • A general-purpose "coding harness" CLI that drives an arbitrary repo through propose/evaluate without going through Smithers's constraint model.
  • Cross-harness frontier sharing (see frontier promotion).
  • The EVOLUTION-ARCHITECTURE-v3.md proposer-as-Claude-Code design — that's the Stanford-style meta-harness, target state.

See also

Source: projects/matrix-3/packages/agents/src/harness/HarnessProtocol.ts, projects/matrix-3/packages/agents/src/harness/HarnessRun.ts, projects/matrix-3/packages/smithers/matrix.json. Stanford-harness target architecture: WORKSTREAMS/stanford-harness/EVOLUTION-ARCHITECTURE-v3.md.