Skip to main content

Module registry

Module registry 

Source
Expand description

The harness descriptor registry — the resolution authority for harness identifiers.

Descriptor sources load into label-keyed entries, and every way the rest of the crate names a harness funnels through them: Harness::resolve turns a string into a validated handle (resolving --harness after parsing, and behind the artifact Deserialize), Harness::known enumerates the entries, and adapter_for serves each handle’s HarnessAdapter.

Structs§

HarnessInfo
One registered harness as harness list/show/lint see it: identity, contributing sources in layer order, the merged descriptor value, and the resolved descriptor.
UnknownHarnessError
A harness name that no registry entry matches. Names every registered harness so the rejection is actionable wherever it surfaces (artifact deserialization, direct resolution).

Enums§

RegistryBuildError
A descriptor source set that cannot form a registry. Only embedded and --harness-file sources can produce this — discovered layer files fail soft (skipped with a warning in [BuiltRegistry::warnings]) so a broken user descriptor never bricks the CLI.
RegistryInitError
The registry could not be initialized from the layered sources.

Constants§

DEFAULT_HARNESS_NAME
The registry-level default harness — what --harness falls back to when absent. A registry concept rather than a descriptor field, so layered user-supplied descriptor files (#136) can never fight over an exactly-one-default invariant.

Functions§

adapter_for
Resolve the adapter for a Harness. This is the single dispatch point on the harness identifier for all harness-specific behavior; every other module goes through the returned trait object.
all_config_dir_names
The union of every harness’s project-local config dir names (sorted, deduplicated): the dirs harness-agnostic code must treat as protected — staging’s sibling-asset filter, the guard’s Bash tamper rule, and detect-stray-writes’ staging-dir lookbehind.
all_tool_vocabulary
The union of every harness’s tool vocabulary (each list sorted, deduplicated). Computed once behind a LazyLock — the guard arbiter consults it on every hooked tool call.
default_harness_name
The effective default harness name: the --harness-file descriptor’s label when one is loaded, else DEFAULT_HARNESS_NAME.
harness_info
Every registered harness in registry order, with provenance and the resolved descriptor — the data source for the harness subcommands.
has_embedded_layer
True when harness has an embedded built-in descriptor among its sources — i.e. it is not defined by user-supplied descriptor files alone. Preflight uses this to hard-reject --guard on user-only harnesses (the write guard stays restricted to built-ins because it fails open).
init_registry
Initialize the registry from every descriptor layer: embedded built-ins → user-global (<config-root>/harnesses/*.toml) → project-local (<cwd>/.eval-magic/harnesses/*.toml) → the optional one-off --harness-file. Called once by the CLI entry point, before anything resolves a harness.