Harnesses
Definition
A Harness is a project-level, versioned Python bundle used to produce behavior for benchmark cases. It implements generate_result(request) at its configured entrypoint and returns the result expected by the case contract. The workspace provides a multi-file editor, one editable Draft, immutable saved Versions, Lemon Code proposals, secret grants, debug runs, runtime preparation, export, and benchmark activation.
A Harness can represent prompt logic, retrieval, tools, orchestration, or other candidate behavior supported by the managed runtime. It is the executable candidate boundary, not a general model registry entry.
Fields, states, or lifecycle rules
- A newly created Harness begins with one blank editable Draft.
- Draft source and runtime changes autosave after a short delay. A concurrent edit is reported so you can reload the current Draft and review the conflicting change.
- The Draft contains source files, an entrypoint, Python version, dependency specifications, sandbox profile, and target-platform/runtime facts.
- Draft validation errors block publication. Warnings remain visible for operator review.
- Publish creates an immutable saved Version from the exact Draft bundle and runtime configuration. Publication also requests use of that Version for the selected Benchmark; confirm its In use state.
- A previously saved Version can be selected with Use this Version for the current benchmark.
- Existing Runs keep their referenced Harness version even after later Draft or Saved changes.
- Archived Harnesses remain visible but cannot be edited, debugged, activated, or granted new secrets.
- Credentials belong in workspace secrets and are explicitly granted to the Harness. Secret values do not belong in source, case content, or Run Metadata.
- Lemon Code proposals appear as file diffs. Accept or reject the proposed hunks before they modify the canonical Draft.
- Runtime delivery can include the rendered case view, static
case_material_refs, and an optional supportedworld_instance_ref. - Debug runs execute only a saved Version against a
harness_contract.v1request. They are authoring checks, not benchmark evaluation results.
Draft, saved version, and activation
Use Draft for active editing. Publish when a candidate is coherent enough to identify, compare, or evaluate. If a benchmark needs a different saved Version, select it explicitly. Do not describe a Run as evaluating “the current Harness” because the Draft and benchmark activation may have changed after the Run began.
Use Publish or Use this Version in the Harness editor to select a saved Version for the current Benchmark. At evaluation launch, choose the saved candidates, machine, and Trials. Each Run retains the Version it executed while your team continues developing the draft.
Runtime, debug, and output mapping
Publishing preserves bundle and dependency hashes and can prepare the immutable runtime image. A failed or missing runtime can be prepared or retried from the saved Version. Use Debug to send a single contract-shaped request before spending a benchmark Run.
Output mapping is a separate boundary. A Harness return must match the benchmark's declared result contract. For imported candidate responses, Benchmark Evaluations maps uploaded rows to the frozen Cases in the selected Benchmark Version. Inspect the mapped responses and their rubric judgments in Results; Case reference responses remain separate examples of intended behavior.
Lemon Goal Sessions can generate or receive candidate Harness Versions. Those candidates become meaningful in a Session only when their identity and canonical evaluation receipt are observable.
Worked example
Example: exact candidate identity
An engineer edits retrieval filtering in a Harness Draft and publishes Version 12 for the selected benchmark. A managed Run records that exact Version. The engineer then continues editing the Draft toward Version 13. The existing Run still refers to Version 12, so its case responses and rubric results remain attributable even though the editor shows newer work.
