• v0.4.0 4ea7463089

    feat(observe)!: unify journal and trace into single observation pipeline

    swaits released this 2026-04-28 15:24:14 -06:00 | 19 commits to main since this release

    The codegen now emits one __chart_observe! invocation per observable
    atom. The macro fans out at compile time to whichever sinks are enabled:
    the in-memory journal (feature = "journal"), defmt (trace-defmt),
    log (trace-log), and/or tracing (trace-tracing). Trace and
    journal share the same vocabulary by construction — they cannot
    diverge. With no sink feature on, every site expands to () (zero
    overhead). Multiple trace backends now compose; previously they were
    mutually exclusive.

    Trace lines use a logfmt-style format with a [statechart:Name] prefix
    and key=value pairs, machine-parseable and greppable. Twenty verbs
    cover every observable atom — entries/exits with begin/end pairs,
    actions with kind, durings, transitions with the reason that triggered
    them, event lifecycle (received/delivered/dropped/queued/failed),
    timers, and termination.

    BREAKING CHANGES (chart syntax unchanged; observability surface only):

    • TraceEvent::TransitionFired now carries reason: TransitionReason
      showing whether the transition was driven by an event, a timer, or
      internal logic.
    • New TraceEvent variants for phase pairing: EnterBegan, ExitBegan,
      TransitionComplete, EventReceived.
    • Trace prefix changed from [Name] to [statechart:Name].
    • The chart-level trace; keyword is parsed for backwards compatibility
      but no longer gates emission.
    • __chart_trace! / __chart_journal! macros removed (doc-hidden).

    Verification: 159 integration tests pass, 0 missed mutants, miri 68
    tests clean, Creusot 14/14 VCs discharged. Zero overhead confirmed via
    cargo expand — every observation site expands to {} with no sinks
    enabled.

    Downloads