Pre-release Harn is pre-1.0 — the language, standard library, and CLI may change between releases. See the release notes

Why qualify learned workflows?

A learned workflow lets an agent reuse a reviewed executable for a familiar request. A decision model checks whether the request fits; a language model binds arguments to the tool's schema. A second decision checks those parameter values against the request before Harn runs preflight and the ordinary tool path.

For example, a coding agent might learn how to add one resource to a particular application. Later requests can reuse that program instead of generating its implementation again. Requests outside its declared capability continue through the agent's existing caller.

What qualification establishes#

Selector agreement alone doesn't establish that a workflow works. Qualification uses fresh executions in isolated workspaces, independent expected labels, and a grader that checks the resulting behavior. The assessed candidate can still be declined during argument binding or an optional read-only preflight. A committed call without successful execution counts as an error. Missing disposition records remain unmeasured. Reused execution receipts are refused.

A study must declare its acceptance boundary before collecting evidence. Assessment accuracy, explicit fallback coverage, and committed execution risk answer different questions. A failed assessment-based study stays failed when a later study adds deterministic preflight checks.

A valid schema and a successful tool receipt do not establish that the binder copied the intended name or assigned values to the intended roles. The binding check supplies a separate native judgment before commitment. Qualification still needs an independent grader of the requested result, because the judgment can also be wrong. Higher thresholds trade coverage for fewer accepted errors.

learned_qualify uses the existing selective-risk report to choose among thresholds declared before measuring the corpus. Empty evidence, missing negative cases, and insufficient accepted executions leave the workflow unqualified. Statistical guarantees require the sampling assumptions in std/eval/selective_risk. A synthetic corpus supports a bounded experiment; it doesn't establish production accuracy.

The published-runtime experiment collected 150 fresh cases. The combined dispatch contract committed 57 times, and independent execution checks passed for all 57. It committed none of the 30 incompatible requests. Coverage was 47.5 percent of compatible requests; the remaining requests used ordinary fallback. These related synthetic cases cover one application and one reviewed generator. The earlier strict-accounting study remains refused because one ancillary provider charge was unknown. The later study declared how to retain unknown ancillary costs before collecting fresh cases; it did not reinterpret the earlier result.

What can invalidate the result#

Qualification binds the decision definition, tool descriptors and package, project preconditions, verifier, argument binder, runtime, grader, and declared population. A host supplies these measured inputs through the typed contracts. Changing them requires new evidence. A source revision alone doesn't identify the running runtime; use its linked content fingerprint.

The middleware checks identity before selection and again before dispatch. When a capability declares a preflight tool, Harn runs it under an enforced read-only policy before committing to the mutation. Preflight and mutation can share their preparation function; the mutation rechecks it because project state may change between calls. An execution guard repeats the check after approval and interception, before the executor receives the call. A waiting approval can't preserve a stale result. Rewritten arguments must still match the values that passed the binding check. Unavailable measurements cause fallback. It also requires the original user request to remain current, so a continuation or steer can't silently reuse an earlier selection.

Execution keeps its existing owner#

Learning adds no tool authority. Schema validation, approvals, cancellation, mutation policy, and tool audit remain in the normal dispatcher. A successful local completion requires a mutation receipt with fresh verified paths. Unverified execution returns control to the original caller with the actual tool history, including any mutation that already happened.

Decision and binding calls retain their physical provider accounting. Selecting a tool or producing a local completion doesn't fabricate a provider call. The transcript records selection, execution mode, evaluation receipts, fallback, and verification so replay and evaluation can inspect the path that ran.