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="memorize-cold — simplified trace (2026-07-09, core 5.117 / backend 5.30)
trace c769dc55 · total 7.2 ms · key cost: detect git branch (cached) = 0.53 ms (7%)\nR3 enqueue-only boundary — WriteGate/embed/store moved to (dead) drainer";
  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="memorize() entry\nMCP dispatch → tool.memorize\n@3.2ms\n3.18 ms"];
    "s0" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="validate memorize inputs\nvalidate.phase_validate\n@3.3ms\n0.3 ms"];
    "s1" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="validate content & provenance\nvalidate._validate_content_and_provenance\n@3.5ms\n0.09 ms"];
    "s2" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="gate & write-policy check\nvalidate._validate_gate_and_policy\n@3.7ms\n0.16 ms"];
    "s3" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="secret gate check\nsecrets.gate_or_reject\n@3.7ms\n0.21 ms"];
    "s4" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="write-policy rule check\nRulesEngine.check_write_policy\n@4.0ms\n0.09 ms"];
    "s5" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="detect git branch\nproject._detect_branch\n@4.2ms\n0.1 ms"];
    "s6" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="detect git branch (cached)\nproject._detect_branch_cached\n@4.3ms\n0.53 ms"];
    "s7" [shape="box", style="rounded,filled", fillcolor="#fce3d6", label="enqueue memorize job\nmemorize._enqueue\n@5.0ms\n0.46 ms"];
    "done" [shape="box", style="rounded,filled", fillcolor="#dbe9fb", label="result returned\n@7.2ms\n1.77 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" -> "s4" [color="#333333", style="solid", label="5"];
  "s4" -> "s5" [color="#333333", style="solid", label="6"];
  "s5" -> "s6" [color="#333333", style="solid", label="7"];
  "s6" -> "s7" [color="#333333", style="solid", label="8"];
  "s7" -> "done" [color="#333333", style="solid", label="9"];
}
