Pipeline diagrams generated at compile time are great for understanding structure. But structure tells you what could happen — not what did happen. That's where runtime observation comes in.
REslava.Result has a three-layer story:
✏️ Write — add [ResultFlow] to any fluent Result method. The source generator emits a Mermaid diagram constant at compile time. You can paste it into GitHub, Notion, VS Code, or mermaid.live and see the entire pipeline shape before you ever run it.
▶️ Run — make your class partial. The same generator now emits a FlowProxy alongside the diagram. Call svc.Flow.Process(...) instead of svc.Process(...) and every node in the pipeline is traced automatically: output value, error type, elapsed milliseconds. The RingBufferObserver holds the last N traces in memory with zero allocation.
🐛 Debug — call svc.Flow.Debug.Process(...) for a single-trace debug run. The generator writes reslava-debug-{Method}.json to your bin/ folder automatically. The VS Code extension watches */reslava-.json — the Debug Panel opens by itself, no manual trigger, no port to configure, no HTTP server.
Inside the Debug Panel:
- The pipeline diagram is rendered live
- Each trace is listed: pass/fail icon, method name, node count, elapsed ms total
- Step through nodes one at a time — the current step is highlighted in the diagram
- Animated replay — plays through all nodes automatically
- Multi-file picker — switch between trace files without closing the panel
The FlowProxy is generated — you write no observer wiring, no DI registration, no startup hooks. Make the class partial, rebuild, and you have full observability.
// You write
public partial class OrderService
{
[ResultFlow]
public Result Process(int userId, int productId) =>
FindUser(userId)
.Ensure(IsActive, new ForbiddenError("inactive"))
.Bind(u => FindProduct(productId))
.Ensure(InStock, new NotFoundError("out of stock"))
.Bind(PlaceOrder);
}
// You call (for debug):
svc.Flow.Debug.Process(userId, productId);
// → reslava-debug-Process.json written automatically
// → VSIX file watcher fires
// → Debug Panel opens with the trace, ready to step through
Everything generated. Nothing hand-written.
https://reslava.github.io/nuget-package-reslava-result/resultflow/runtime/

Top comments (0)