{
  "type": "excalidraw",
  "version": 2,
  "source": "claude",
  "elements": [
    {
      "type": "text",
      "id": "title",
      "x": 160,
      "y": 20,
      "width": 600,
      "height": 70,
      "text": "Turn Budget Protocol",
      "fontSize": 28,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "left",
      "verticalAlign": "top"
    },
    {
      "type": "text",
      "id": "subtitle",
      "x": 160,
      "y": 88,
      "width": 600,
      "height": 35,
      "text": "Token budget enforcement across memory layers",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "left",
      "verticalAlign": "top"
    },
    {
      "type": "rectangle",
      "id": "start-box",
      "x": 280,
      "y": 140,
      "width": 360,
      "height": 60,
      "strokeColor": "#1864ab",
      "backgroundColor": "#a5d8ff",
      "fillStyle": "hachure",
      "strokeWidth": 2,
      "roundness": { "type": 3 },
      "boundElements": [{ "type": "text", "id": "start-text" }]
    },
    {
      "type": "text",
      "id": "start-text",
      "x": 280,
      "y": 140,
      "width": 360,
      "height": 60,
      "text": "Session Start — Load L0 + L1 + L2",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "middle",
      "containerId": "start-box"
    },
    {
      "type": "arrow",
      "id": "a1",
      "x": 460,
      "y": 200,
      "width": 0,
      "height": 30,
      "strokeColor": "#495057",
      "strokeWidth": 2,
      "points": [[0,0],[0,30]]
    },
    {
      "type": "rectangle",
      "id": "budget-box",
      "x": 220,
      "y": 230,
      "width": 480,
      "height": 60,
      "strokeColor": "#e67700",
      "backgroundColor": "#fff3bf",
      "fillStyle": "hachure",
      "strokeWidth": 2,
      "roundness": { "type": 3 },
      "boundElements": [{ "type": "text", "id": "budget-text" }]
    },
    {
      "type": "text",
      "id": "budget-text",
      "x": 220,
      "y": 230,
      "width": 480,
      "height": 60,
      "text": "Budget check: L0+L1+L2 always fits · reserve headroom for tools",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "middle",
      "containerId": "budget-box"
    },
    {
      "type": "arrow",
      "id": "a2",
      "x": 460,
      "y": 290,
      "width": 0,
      "height": 30,
      "strokeColor": "#495057",
      "strokeWidth": 2,
      "points": [[0,0],[0,30]]
    },
    {
      "type": "rectangle",
      "id": "tool-box",
      "x": 280,
      "y": 320,
      "width": 360,
      "height": 60,
      "strokeColor": "#2f9e44",
      "backgroundColor": "#b2f2bb",
      "fillStyle": "hachure",
      "strokeWidth": 2,
      "roundness": { "type": 3 },
      "boundElements": [{ "type": "text", "id": "tool-text" }]
    },
    {
      "type": "text",
      "id": "tool-text",
      "x": 280,
      "y": 320,
      "width": 360,
      "height": 60,
      "text": "First Tool Call — route via L2 catalog",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "middle",
      "containerId": "tool-box"
    },
    {
      "type": "arrow",
      "id": "a3-miss",
      "x": 460,
      "y": 380,
      "width": 0,
      "height": 30,
      "strokeColor": "#495057",
      "strokeWidth": 2,
      "points": [[0,0],[0,30]]
    },
    {
      "type": "text",
      "id": "miss-note",
      "x": 660,
      "y": 388,
      "width": 160,
      "height": 35,
      "text": "on cache miss only",
      "fontSize": 12,
      "fontFamily": 1,
      "strokeColor": "#c92a2a",
      "textAlign": "left",
      "verticalAlign": "top"
    },
    {
      "type": "rectangle",
      "id": "l3-box",
      "x": 280,
      "y": 410,
      "width": 360,
      "height": 60,
      "strokeColor": "#0c8599",
      "backgroundColor": "#99e9f2",
      "fillStyle": "hachure",
      "strokeWidth": 2,
      "roundness": { "type": 3 },
      "boundElements": [{ "type": "text", "id": "l3-text" }]
    },
    {
      "type": "text",
      "id": "l3-text",
      "x": 280,
      "y": 410,
      "width": 360,
      "height": 60,
      "text": "L3 Query (selective) — budget minus L0-L2",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "middle",
      "containerId": "l3-box"
    },
    {
      "type": "arrow",
      "id": "a4",
      "x": 460,
      "y": 470,
      "width": 0,
      "height": 30,
      "strokeColor": "#495057",
      "strokeWidth": 2,
      "points": [[0,0],[0,30]]
    },
    {
      "type": "rectangle",
      "id": "overflow-box",
      "x": 160,
      "y": 500,
      "width": 600,
      "height": 80,
      "strokeColor": "#c92a2a",
      "backgroundColor": "#ffc9c9",
      "fillStyle": "hachure",
      "strokeWidth": 2,
      "roundness": { "type": 3 },
      "boundElements": [{ "type": "text", "id": "overflow-text" }]
    },
    {
      "type": "text",
      "id": "overflow-text",
      "x": 160,
      "y": 500,
      "width": 600,
      "height": 80,
      "text": "Over Budget? Graceful Degradation:\n1. Drop cold L3 results  2. Summarize L4 excerpts  3. Never drop L0/L1/L2",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "middle",
      "containerId": "overflow-box"
    },
    {
      "type": "text",
      "id": "rule-note",
      "x": 80,
      "y": 600,
      "width": 760,
      "height": 35,
      "text": "Rule: hot cache (L2) is never evicted · cold L3 results are first to be dropped when budget is tight",
      "fontSize": 13,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "top"
    }
  ],
  "appState": { "viewBackgroundColor": "#ffffff" }
}
