Skip to main content
A harness is named by a reference, checked before anything starts, and then every session of the campaign is staged from it. This page is the user’s side; Write a harness is the author’s.

Name it

Three ways, one build:
kapso-brief.md
--harness and load_harness() win over the brief’s Harness line. A directory in the brief or on the flag is read from the directory the build runs in. A reference takes one of four forms: A git reference is fetched into the store (harness.store in the config, ~/.kapso/harnesses by default) the first time it is named, and read from there after. Two harnesses ship inside the package, each with its own page: predictive-modelling (structured prediction: a test set that never trains, cross-validation discipline, leakage as the failure that voids, features before architectures, ensembling last) and competitive-programming (a scored contest under a clock: validity first, an insurance submission early, the scorer’s measurement over every claim, a submission ledger). Each was written from the benchmarks the engine was measured on and holds no task; kapso harness list shows both with what this machine lacks for them.

Check it first

The report has three kinds of line. A fail line is a harness that cannot load: the author’s problem, and check exits 1. A warn line is something the author should look at; the harness loads. A needs line is what this machine lacks, with the line that fixes it and the modules that need it:
Nothing is installed for you. A build refuses an unmet need of the modules it runs (setup, ideation, implementation, verification, feedback), before any session, naming each item and its fix; a need of another module is printed as advisory and the build goes on. deploy and learn check their own module the same way, at the call. The store’s own commands:

What the build does with it

The launch prints the harness and what it adds:
  1. The task statement. Kapso writes kapso_task.md at the campaign root: the brief whole, the budget, the evaluation and data references, the harness, the domain statement and the prepared resources. Every session is told to read it first, and its values win over any harness page.
  2. The setup session, once, before the first experiment, when the harness has a setup page or setup attachments. It runs at the campaign root with the setup module’s skills, servers and hooks, writes the domain statement to .kapso/harness_setup/statement.md and leaves what every later session should find ready under prepared/<name>/. Kapso verifies afterwards that kapso_evaluation/ and kapso_datasets/ are byte for byte what they were; a change fails the build naming the harness. When the session needs something only you can provide, the campaign pauses on the inbox as any session does. The status file shows the phase harness_setup, and a resume never runs setup twice.
  3. Every session is staged. Its prompt carries a ## Domain guidance (harness trading 0.1.0) block: guardrails.md, then the module’s page, whole, then the module’s skills, delegates and servers each with its description and how to reach it, then the paths of the task statement and the prepared resources. Beside the session, in the host’s own format: skills, the merged hooks file, the delegates, and the servers mounted with the engine’s own gates. The staging is written to .kapso/sessions/<session>/session.json, where the host’s runs land too, and the host’s event stream to stream.jsonl beside it.
  4. Verification per attempt, when the harness has verification content. Between the evaluation and the judge, Kapso writes the attempt’s diff and evaluation output under .kapso/verification/<branch>/, checks the branch out in a worktree of its own, and runs one verification session there. The session writes verdict.json: A malformed verdict fails the build naming the file. The judge’s prompt carries the verdict beside the evaluation; a judge saying valid cannot resurrect a void attempt. An attempt the budget left unjudged (no time for the judge, or its session cut at the deadline) keeps its score, is never a parent and is never delivered, and the trace says so on its judge line; see Resume and budgets.
  5. The record. The harness’s name, version, content hash and source are in .kapso/launch.json, status.json, the checkpoint and solution.json, as one and the same identity; solution.verification is the verdict on the delivered candidate.

In the campaign directory

Sessions are named by module: harness_setup; ideation/iter<n>/<member>; <branch> for an implementation; verification/<branch>; feedback/<branch>.
The staged files never reach a candidate branch: .claude/, .agents/, .codex/, kapso_task.md and prepared are ignored in the campaign’s repository, and a starting repository that tracks one of those paths is refused by name.

Resume

A resume runs with the launch’s harness, by content hash. Three refusals, each with its way out: A directory harness is hashed again at every session, so an edit under a running campaign fails the next session, naming both hashes.

Deploy and learn

kapso deploy campaign and kapso.learn(solution) take the harness from the campaign’s record and resolve its source again; the deployment module is staged into the deployment session, and the learning module into the mining and update crews’ sessions, the update crew’s workers included. A loaded harness of the same name is used instead, another version included, and both identities are printed when they differ; a different name is refused, as is a recorded source that is gone. kapso deploy --harness <ref> loads one for that call. The trajectory manifest a learn writes carries the build’s harness and, when it differs, the learning one.

Write a harness

The author’s side

Harness reference

Every form, rule, file and field
Related pages: What a harness is · The trading example · Run and watch · Review the solution · CLI reference Kapso is an open-source framework by Leeroo that builds software toward measurable goals through experiment campaigns. Source code: github.com/Leeroo-AI/kapso · Install: pip install leeroo-kapso · Every page as plain text: llms.txt.