Skip to main content

Module layers

Module layers 

Source
Expand description

Descriptor source layers: where a descriptor’s TOML text came from.

Discovery order is precedence order — embedded built-ins, then user-global (~/.config/eval-magic/harnesses/*.toml), then project-local (.eval-magic/harnesses/*.toml), then a one-off --harness-file. Later layers override earlier ones field-by-field (see merge_descriptor_value). Every source carries its layer and display path so registry entries can report provenance (harness list/show) and error messages can name the contributing file.

Structs§

DescriptorSource
One descriptor source: its layer, a display path for error messages and provenance, and the raw TOML text.
HarnessFileError
A --harness-file path that could not be read. Unlike discovered layer files (skipped with a warning), the explicitly named file is a hard error.

Enums§

Layer
The layer a descriptor source belongs to, in precedence order (later layers override earlier ones field-by-field).

Functions§

check_user_layer_restrictions
Reject descriptor content user-supplied files may not declare: the write guard fails open (an unrenderable or mistyped guard block silently allows everything), so guard data stays restricted to the embedded built-ins until user guards get an explicit trust story. The check runs on each file’s own content, so a user overlay of a guarded built-in still inherits the embedded guard cleanly.
config_root_from
Resolve the user-global config root from explicit/env inputs: $EVAL_MAGIC_CONFIG_DIR verbatim (empty disables the layer), else $XDG_CONFIG_HOME/eval-magic, else <home>/.config/eval-magic.
default_config_root
config_root_from over the live environment.
discover_sources
Discover every descriptor source in precedence order: embedded → user-global → project-local → --harness-file. Missing layer directories are fine (empty layer); unreadable files inside a layer directory are skipped and reported in the returned warnings. Only the explicit --harness-file fails hard.
embedded_sources
The bundled built-in descriptors as the registry’s base layer.