<mxfile host="app.diagrams.net" type="device">
  <diagram name="Agent Loop" id="agent-loop">
    <mxGraphModel dx="800" dy="600" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="500" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="title" value="OfferReady — Agent Reasoning Loop (plan → act → observe)" style="text;html=1;fontSize=16;fontStyle=1;align=left;" vertex="1" parent="1">
          <mxGeometry x="30" y="20" width="560" height="30" as="geometry" />
        </mxCell>
        <mxCell id="goal" value="Goal / user request" style="ellipse;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
          <mxGeometry x="40" y="120" width="120" height="60" as="geometry" />
        </mxCell>
        <mxCell id="plan" value="1. Plan&#10;parse intent, pick a tool" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontStyle=1;" vertex="1" parent="1">
          <mxGeometry x="220" y="115" width="160" height="70" as="geometry" />
        </mxCell>
        <mxCell id="act" value="2. Act&#10;call a tool (least-privilege)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontStyle=1;" vertex="1" parent="1">
          <mxGeometry x="430" y="115" width="170" height="70" as="geometry" />
        </mxCell>
        <mxCell id="obs" value="3. Observe&#10;record result" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontStyle=1;" vertex="1" parent="1">
          <mxGeometry x="650" y="115" width="150" height="70" as="geometry" />
        </mxCell>
        <mxCell id="decide" value="Goal met&#10;or step cap?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
          <mxGeometry x="650" y="280" width="150" height="90" as="geometry" />
        </mxCell>
        <mxCell id="answer" value="Final answer" style="ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
          <mxGeometry x="220" y="290" width="120" height="60" as="geometry" />
        </mxCell>
        <mxCell id="tools" value="Tools: get_order (read), search, Analyst, Search…&#10;write tools gated + human-approved" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;dashed=1;" vertex="1" parent="1">
          <mxGeometry x="405" y="290" width="220" height="70" as="geometry" />
        </mxCell>
        <mxCell id="a1" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;" edge="1" parent="1" source="goal" target="plan"><mxGeometry relative="1" as="geometry" /></mxCell>
        <mxCell id="a2" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;" edge="1" parent="1" source="plan" target="act"><mxGeometry relative="1" as="geometry" /></mxCell>
        <mxCell id="a3" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;" edge="1" parent="1" source="act" target="obs"><mxGeometry relative="1" as="geometry" /></mxCell>
        <mxCell id="a4" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;" edge="1" parent="1" source="obs" target="decide"><mxGeometry relative="1" as="geometry" /></mxCell>
        <mxCell id="a5" value="no — loop" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;" edge="1" parent="1" source="decide" target="plan"><mxGeometry relative="1" as="geometry" /></mxCell>
        <mxCell id="a6" value="yes" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;" edge="1" parent="1" source="decide" target="answer"><mxGeometry relative="1" as="geometry" /></mxCell>
        <mxCell id="a7" style="edgeStyle=orthogonalEdgeStyle;html=1;endArrow=block;dashed=1;" edge="1" parent="1" source="act" target="tools"><mxGeometry relative="1" as="geometry" /></mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
