digraph flow {
  rankdir="TB";
  newrank=true;
  compound=true;
  nodesep=0.35;
  ranksep=0.55;
  graph [fontname="Helvetica", fontsize=11, labelloc="t"];
  node  [fontname="Helvetica", fontsize=10];
  edge  [fontname="Helvetica", fontsize=9];
  label="wiki_add — simplified trace (2026-07-09, core 5.117 / backend 5.30)
trace 39f11a6d · total 78.4 ms · key cost: HTTP POST to backend (in RulesEngine.get_applicable_rules) = 22.3 ms (28%)\nenqueue-only; 69 ms = check_write_policy; drainer half absent (dead)";
  subgraph "cluster_core" {
    label="Core process (yadgar-core)";
    style=filled;
    bgcolor="#eef4fb";
    color="#4a72a8";
    fontcolor="#26456b";
    fontname="Helvetica-Bold";
    "entry" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="wiki_add() entry\nMCP dispatch → tool.wiki_add\n@3.0ms\n3 ms"];
    "s0" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="allowlist check\nallowlist.is_allowlisted\n@3.1ms\n3.55 ms"];
    "s1" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="HTTP POST to backend (in get_rules_for_scope)\nPOST\n@7.8ms\n22.05 ms"];
    "s2" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="HTTP POST to backend (in RulesEngine.get_applicable_rules)\nPOST\n@31.0ms\n21.21 ms"];
    "s3" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="HTTP POST to backend (in RulesEngine.get_applicable_rules)\nPOST\n@53.3ms\n22.3 ms"];
    "done" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="result returned\n@78.4ms\n1.79 ms"];
  }
  "entry" -> "s0" [color="#333333", style="solid", label="1"];
  "s0" -> "s1" [color="#333333", style="solid", label="2"];
  "s1" -> "s2" [color="#333333", style="solid", label="3"];
  "s2" -> "s3" [color="#333333", style="solid", label="4"];
  "s3" -> "done" [color="#333333", style="solid", label="5"];
}
