DuskSnapshotEnricher typedef
DuskSnapshotEnricher =
String? Function(Element element, RefRegistry refs)
Snapshot enricher contract (oracle finding #3 lock-ins, plan §Risks Accepted).
Returns a YAML line to append under the snapshot ref (indented under the ref's bullet), OR null to skip.
CONTRACT (must hold for every enricher implementation):
- Synchronous (no Future return). Never retain the Element across calls.
- Stateless WRT call ordering — the dispatcher iterates the list in insertion order; later-registered enrichers see the same Element.
- First-write-wins on output keys (the dispatcher concatenates lines in insertion order; if two enrichers emit overlapping keys, the FIRST wins per oracle contract).
- May return null when the Element is not relevant to this enricher (e.g. MagicFormEnricher returns null for elements outside a MagicForm).
Magic registers MagicFormEnricher.call + MagicNavigationEnricher.call.
Wind diagnostics flow through fluttersdk_wind_diagnostics_contracts.WindDebugRegistry
rather than this typedef (see ext_snapshot.dart's wind walk).
Implementation
typedef DuskSnapshotEnricher = String? Function(
Element element, RefRegistry refs);