Bloccs.Web.Coverage (bloccs_web v0.1.0)

Copy Markdown View Source

Structural coverage for the dashboard, computed from the runtime Bloccs.Introspect.Network (so it needs no parsed manifest). Mirrors Bloccs.Coverage's obligation model — every in-port, out-port, and edge — and compares it against a reached set derived from Bloccs.Trace events (recorded live or loaded from a .bloccs-trace file).

Summary

Functions

Per-node glyph state for the overlay: reached → :ok, otherwise :idle.

Every coverage obligation in a running network.

The set of {from_node, to_node} pairs for reached edges (for the overlay).

The set of node ids touched by any reached port obligation.

Compare a network's obligations against a reached obligation set.

Types

obligation()

@type obligation() ::
  {:port_in, atom(), atom()}
  | {:port_out, atom(), atom()}
  | {:edge, {atom(), atom()}, {atom(), atom()}}

report()

@type report() :: %{
  obligations: [obligation()],
  reached: [obligation()],
  unreached: [obligation()],
  total: non_neg_integer(),
  reached_count: non_neg_integer(),
  percent: integer()
}

Functions

node_states(network, report)

@spec node_states(Bloccs.Introspect.Network.t(), report()) :: %{
  required(atom()) => :ok | :idle
}

Per-node glyph state for the overlay: reached → :ok, otherwise :idle.

obligations(network)

@spec obligations(Bloccs.Introspect.Network.t()) :: [obligation()]

Every coverage obligation in a running network.

reached_edges(map)

@spec reached_edges(report()) :: MapSet.t({atom(), atom()})

The set of {from_node, to_node} pairs for reached edges (for the overlay).

reached_nodes(map)

@spec reached_nodes(report()) :: MapSet.t(atom())

The set of node ids touched by any reached port obligation.

report(network, reached)

@spec report(Bloccs.Introspect.Network.t(), [obligation()]) :: report()

Compare a network's obligations against a reached obligation set.