Skip to main content

SomaStep

Derive Macro SomaStep 

Source
#[derive(SomaStep)]
{
    // Attributes available to this derive:
    #[soma]
}
Expand description

Derive config_hash for a Step.

Not linked: this is a proc-macro crate and cannot depend on somatize-core, so the path would not resolve.

The mirror of SomaFilter’s hash half, and it exists because hand-writing that hash goes wrong quietly. ReactStep::config_hash covered four of its nine fields for as long as it existed; the hash is part of every journal key a step writes, so two steps differing only in an uncovered field shared a key and replayed each other’s recorded answers. A field added to a struct that derives this is covered because it is a field, not because someone remembered.

Fields are hashed as canonical CBOR — never raw serializer output (a HashMap’s iteration order is random) and never a silent empty fallback (two unserializable configs would collide). A field that genuinely does not belong in the key says #[soma(skip_hash)], which is a decision in the source rather than an omission.