Skip to main content

Module descriptor

Module descriptor 

Source
Expand description

Harness descriptor files: the data half of a harness adapter.

A descriptor is a TOML file carrying every declarative value a harness adapter exposes (label, dirs, capability booleans, phrases, templates, banner prose, the write-guard data block) plus references to named capabilities — the code-backed features in super::capabilities (transcript parsers, slug generation, shadow preflight).

Loading is schema-gated: the TOML transcodes to JSON and must satisfy the bundled schema/harness-descriptor.schema.json, then the cross-field invariants in [validate_descriptor] — the load-time form of the old cross-harness adapter tests, so user-supplied descriptor files inherit the same checks.

Modules§

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

Structs§

DispatchSection
GuardSection
The write-guard data block: everything the generic guard engine ([super::guard]) needs to arm a hook and render a deny verdict. Embedded built-in descriptors only — the guard fails open, so layers::check_user_layer_restrictions bars user layers from declaring it.
HarnessDescriptor
A parsed, schema-checked, invariant-checked harness descriptor.
ModelSection
RunSection
Run-option capabilities. The Default mirrors the baseline every harness gets without opting in: no guard, bootstrap/stage-name allowed unstaged.
ShadowSection
SkillsBlockSection
StagingSection
ToolsSection
TranscriptSection

Enums§

DescriptorError
A descriptor that failed to load. Every variant carries the descriptor’s source path so the message is actionable on its own.

Constants§

EMBEDDED_DESCRIPTORS
The three built-in harness descriptors, embedded like the schemas: a (source path, TOML text) pair per harness, in registry order.

Functions§

finalize_descriptor
Deserialize and invariant-check a (possibly merged) descriptor value. provenance names every contributing file (e.g. base.toml (built-in) + overlay.toml (project)) so a post-merge violation is traceable.
load_descriptor
Parse, schema-check, and invariant-check one descriptor. source names the descriptor in error messages (its file path).
merge_descriptor_value
Merge overlay onto base, field by field: objects merge recursively per key; scalars, arrays, and nulls replace wholesale. This is the layering rule — a later descriptor file overrides individual fields of an earlier one, never whole-file shadowing.
parse_descriptor_value
Parse one descriptor file’s TOML into a JSON value and schema-check it. This is the per-file gate every layered source passes individually — the schema requires only label, so partial override files validate here too, while unknown fields and bad capability names are still rejected with the file’s own path in the message.