Records an execution trace of a running network by attaching to bloccs telemetry, and derives structural-coverage obligations from it.
A recording observes two events, scoped to one network:
[:bloccs, :node, :start]— a message reached a node's in-port ({:port_in, node, in_port}).[:bloccs, :emit]— a node emitted on an out-port ({:port_out, node, out_port}) and traversed each downstream edge ({:edge, {from_node, from_port}, {to_node, to_port}}).
Those obligation shapes match Bloccs.Coverage, so a trace's reached/1 set
feeds Bloccs.Coverage.report/2 directly.
Recording
rec = Bloccs.Trace.record(:events)
# ... feed messages through the network ...
events = Bloccs.Trace.stop(rec)
reached = Bloccs.Trace.reached(events)Persistence
dump/3 writes a .bloccs-trace file (JSON: {network, events}); load/1
reads one back into the same event list. The format is deliberately legible —
a trace is part of the IR you can inspect.
Summary
Functions
Write events to a .bloccs-trace file (JSON) for network network_id.
Load a .bloccs-trace file back into an event list.
Derive the set of reached Bloccs.Coverage obligations from events.
Start recording the trace for network_id. Returns a recording handle.
Stop recording; detach the handler and return the events in order.
Types
Functions
Write events to a .bloccs-trace file (JSON) for network network_id.
Load a .bloccs-trace file back into an event list.
Node/port names are decoded with String.to_existing_atom/1 — a trace is an
input file, and minting new atoms from one would let a corrupt (or hostile)
trace grow the atom table without bound. Names that don't correspond to any
known atom can't match a coverage obligation anyway, so events carrying them
are dropped. (Load the trace after parsing the network manifest, which is
what mints the legitimate names — mix bloccs.coverage already does.)
@spec reached([event()]) :: [Bloccs.Coverage.obligation()]
Derive the set of reached Bloccs.Coverage obligations from events.
Start recording the trace for network_id. Returns a recording handle.
Stop recording; detach the handler and return the events in order.