H.Harness behaviour (H v0.3.0)

Copy Markdown View Source

Behaviour for pluggable agent harness profiles (H.Harness.Coding, etc.).

A harness defines the profile descriptor, tool modules, and workspace context bootstrapping (such as AGENTS.md discovery through H.ExecutionEnv). Follow Author a harness profile on hiness.dev to register a custom profile.

Summary

Functions

Resolves a harness module from a string ID (defaulting nil to H.Harness.Coding).

Types

descriptor()

@type descriptor() :: %{id: String.t(), name: String.t(), description: String.t()}

Callbacks

bootstrap_agent(t, overrides, opts)

@callback bootstrap_agent(H.ExecutionEnv.t(), overrides :: map(), opts :: keyword()) ::
  {:ok, map()} | {:error, term()}

descriptor()

@callback descriptor() :: descriptor()

id()

@callback id() :: String.t()

tools(opts)

@callback tools(opts :: keyword()) :: [module()]

Functions

resolve(harness_id_or_nil, opts \\ [])

@spec resolve(nil | String.t(), keyword()) ::
  {:ok, module()} | {:error, :unknown_harness}

Resolves a harness module from a string ID (defaulting nil to H.Harness.Coding).

Supports custom registrations via opts[:harnesses] as either a %{id => module} map or a list of H.Harness modules. Never creates atoms from input.