Expand description
Preset source abstraction — extensible pluggable loaders for hat-collection presets authored in formats other than Ralph’s native YAML.
This module defines the PresetSource trait and ships two built-in
implementations:
YamlPresetSource— the canonical Ralph single-file YAML shape.TomlPresetSource— imports multi-file TOML presets authored for the@mobrienv/autoloopruntime (directory containingautoloops.toml+topology.toml+roles/*.md- optional
harness.md).
- optional
New preset shapes plug in by implementing PresetSource::detect +
PresetSource::load and registering with PresetRegistry.
All impls produce a serde_yaml::Value that can be consumed by the
existing hat-overlay merging pipeline in ralph-cli, so downstream code
does not need to know which preset format was on disk.
§Autoloop → Ralph mapping
| Autoloop | Ralph |
|---|---|
[[role]] id | hats.<id> key |
[[role]] prompt_file (read from disk) | hats.<id>.instructions |
[[role]] emits | hats.<id>.publishes |
[handoff] <event> = [role, ...] (inverted) | hats.<role>.triggers list |
topology.completion | event_loop.completion_promise |
autoloops.toml event_loop.completion_event | event_loop.completion_promise (fallback) |
autoloops.toml event_loop.required_events | event_loop.required_events |
autoloops.toml event_loop.max_iterations | event_loop.max_iterations |
handoff["loop.start"] (first target’s role id) | event_loop.starting_event = "loop.start" |
harness.md (whole file) | appended to core.guardrails |
Fields Ralph has but autoloop lacks (backend, cli, core.specs_dir, etc.)
stay unset — the overlay only populates hats/events/event_loop slots, and
the caller’s ralph.yml supplies the rest exactly as it does for builtin
presets.
Structs§
- Preset
Registry - Ordered registry of
PresetSourceimpls. - Toml
Preset Source - Yaml
Preset Source
Enums§
- Preset
Source Error - Error returned by a
PresetSource::loadimplementation.
Traits§
- Preset
Source - Pluggable loader for a preset shape.