Skip to main content
Four stages turn one finished campaign into banked cards. kapso.learn(solution) runs all four; each is also a command you can run on its own.

The frame does the mechanics, agents do the judgment

Every stage has the same shape, and it is the reason the output can be trusted: a frame stages the work, launches one agent session, and then mechanically verifies what came back. The frame never orchestrates the agents and never judges the content. The agents never write the numbers that get aggregated. When verification fails, the frame allows a bounded number of repair rounds — each crew’s repair_rounds setting, shipped as 1 for mining, 3 for the update crew and 5 for the graders — and then fails loud.

Import

A campaign bundle enters the trajectory store under a stable identity:
Bundles are stored unpacked, one object per file, never as a tarball. Atomicity comes from writing the manifest last: a bundle whose trajectory.yaml is present is a bundle that arrived completely. Reads go through exactly three doors — manifest, resolve and open_ref — and there is no other door. That is what lets a card cite a line in a campaign log and have the citation still resolve months later.

Mine

Mining reads a bundle into derived views. The raw bundle is never modified; mined/ sits beside it. Per-iteration directories carry the same treatment for each experiment. The frame’s verification is not a formality. It checks the schema, coverage arithmetic against stable identities, ref resolution with a quote re-grep — every quoted line must still be found at the reference it cites — index consistency, and raw immutability against the manifest hashes.

Grade

The bank is graded against a trajectory before it learns from that trajectory. Two modes:
See Grading for what a report contains and how scores are bounded.

Update

The update crew folds the batch into the bank. The proposal medium is the working tree: the crew edits card files directly, and the frame validates the final diff. The transaction is rejected whole on any violation. Checks cover the surface, the diff invariants, evidence admission, coverage arithmetic and score bounds. Up to learning.update_crew.repair_rounds repair bounces (shipped: 3), then failure. A green transaction commits as one reviewed commit, tagged lr_<id>, and pushed to the bank home.
Omit --batch-manifest for docket-only consolidation.

Running the whole chain

For one arriving campaign:
ingest is the operating-regime chain: mine, then exam, then lesson. From Python, learn() does the same for a SolutionResult:

Grading

What the graders check

Development regime

Developing and promoting a learner version
Related pages: Grading · Development regime · Overview 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.