pub struct HatConfig {Show 14 fields
pub name: String,
pub description: Option<String>,
pub triggers: Vec<String>,
pub publishes: Vec<String>,
pub instructions: String,
pub extra_instructions: Vec<String>,
pub backend: Option<HatBackend>,
pub backend_args: Option<Vec<String>>,
pub default_publishes: Option<String>,
pub max_activations: Option<u32>,
pub disallowed_tools: Vec<String>,
pub timeout: Option<u32>,
pub concurrency: u32,
pub aggregate: Option<AggregateConfig>,
}Expand description
Configuration for a single hat.
Fields§
§name: StringHuman-readable name for the hat.
description: Option<String>Short description of the hat’s purpose (required). Used in the HATS table to help Ralph understand when to delegate to this hat.
triggers: Vec<String>Events that trigger this hat to be worn. Per spec: “Hats define triggers — which events cause Ralph to wear this hat.”
publishes: Vec<String>Topics this hat publishes.
instructions: StringInstructions prepended to prompts.
extra_instructions: Vec<String>Additional instruction fragments appended to instructions.
Use with YAML anchors to share common instruction blocks across hats:
_confidence_protocol: &confidence_protocol |
### Confidence-Based Decision Protocol
...
hats:
architect:
instructions: |
## ARCHITECT MODE
...
extra_instructions:
- *confidence_protocolbackend: Option<HatBackend>Backend to use for this hat (inherits from cli.backend if not specified).
backend_args: Option<Vec<String>>Custom args to append to the backend CLI when this hat is active.
Accepts both backend_args: and shorthand args:.
default_publishes: Option<String>Default event to publish if hat forgets to write an event.
max_activations: Option<u32>Maximum number of times this hat may be activated in a single loop run.
When the limit is exceeded, the orchestrator publishes <hat_id>.exhausted
instead of activating the hat again.
disallowed_tools: Vec<String>Tools the hat is not allowed to use.
Injected as a TOOL RESTRICTIONS section in the prompt (soft enforcement).
After each iteration, a file-modification audit checks compliance when
Edit or Write are disallowed (hard enforcement via scope_violation event).
timeout: Option<u32>Execution timeout in seconds for this hat.
For wave workers, this controls how long each parallel worker can run. Defaults to the adapter-level timeout (typically 300s) if not set.
concurrency: u32Maximum concurrent wave instances for this hat.
When > 1, the loop runner spawns multiple backend instances in parallel for wave events targeting this hat. Default is 1 (sequential execution).
aggregate: Option<AggregateConfig>Aggregation configuration for this hat.
When set, this hat acts as an aggregator — it buffers wave results and
activates only when all correlated results have arrived (or timeout).
Cannot be set on a hat with concurrency > 1.