<mxfile host="app.diagrams.net" version="24.7.17" type="device">
  <diagram id="06-write-state-machine" name="Consequential-write approval and idempotency">
    <mxGraphModel dx="1200" dy="850" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1200" pageHeight="850" background="#F7F4EC">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="title" value="Consequential-write approval and idempotency" style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;fontSize=28;fontStyle=1;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="45" y="22" width="1110" height="45" />
        </mxCell>
        <mxCell id="subtitle" value="An unknown outcome must be reconciled before execution is repeated." style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;fontSize=16;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="45" y="70" width="1110" height="32" />
        </mxCell>
        <mxCell id="footer" value="Application-owned state machine. Approval, idempotency and business transaction state must survive crashes and recovery." style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;fontSize=13;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="45" y="787" width="1110" height="40" />
        </mxCell>
        <mxCell id="edge0" value="" style="edgeStyle=none;rounded=0;html=0;endArrow=block;endFill=1;strokeWidth=2;strokeColor=#142B49;fontColor=#142B49;fontFamily=Helvetica;fontSize=12;labelBackgroundColor=#F7F4EC;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="prop" target="pend">
          <mxGeometry as="geometry" relative="1" />
        </mxCell>
        <mxCell id="label0" value="request" style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;align=center;fontSize=11;fillColor=#F7F4EC;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="284.4" y="139" width="51.199999999999996" height="18" />
        </mxCell>
        <mxCell id="edge1" value="" style="edgeStyle=none;rounded=0;html=0;endArrow=block;endFill=1;strokeWidth=2;strokeColor=#142B49;fontColor=#142B49;fontFamily=Helvetica;fontSize=12;labelBackgroundColor=#F7F4EC;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="pend" target="approved">
          <mxGeometry as="geometry" relative="1" />
        </mxCell>
        <mxCell id="label1" value="approve" style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;align=center;fontSize=11;fillColor=#F7F4EC;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="574.4" y="139" width="51.199999999999996" height="18" />
        </mxCell>
        <mxCell id="edge2" value="" style="edgeStyle=none;rounded=0;html=0;endArrow=block;endFill=1;strokeWidth=2;strokeColor=#142B49;fontColor=#142B49;fontFamily=Helvetica;fontSize=12;labelBackgroundColor=#F7F4EC;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="approved" target="claim">
          <mxGeometry as="geometry" relative="1" />
        </mxCell>
        <mxCell id="label2" value="validate + claim" style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;align=center;fontSize=11;fillColor=#F7F4EC;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="839.2" y="139" width="101.6" height="18" />
        </mxCell>
        <mxCell id="edge3" value="" style="edgeStyle=none;rounded=0;html=0;endArrow=block;endFill=1;strokeWidth=2;strokeColor=#142B49;fontColor=#142B49;fontFamily=Helvetica;fontSize=12;labelBackgroundColor=#F7F4EC;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="claim" target="execute">
          <mxGeometry as="geometry" relative="1" />
        </mxCell>
        <mxCell id="label3" value="execute once" style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;align=center;fontSize=11;fillColor=#F7F4EC;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="995.4" y="296.5" width="79.19999999999999" height="18" />
        </mxCell>
        <mxCell id="edge4" value="" style="edgeStyle=none;rounded=0;html=0;endArrow=block;endFill=1;strokeWidth=2;strokeColor=#E4A83A;fontColor=#142B49;fontFamily=Helvetica;fontSize=12;labelBackgroundColor=#F7F4EC;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="pend" target="reject">
          <mxGeometry as="geometry" relative="1" />
        </mxCell>
        <mxCell id="label4" value="reject / expire" style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;align=center;fontSize=11;fillColor=#F7F4EC;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="407.0" y="296.5" width="96.0" height="18" />
        </mxCell>
        <mxCell id="edge5" value="" style="edgeStyle=none;rounded=0;html=0;endArrow=block;endFill=1;strokeWidth=2;strokeColor=#E4A83A;fontColor=#142B49;fontFamily=Helvetica;fontSize=12;labelBackgroundColor=#F7F4EC;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="execute" target="unknown">
          <mxGeometry as="geometry" relative="1">
            <Array as="points">
              <mxPoint x="865" y="431.0" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="label5" value="response lost" style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;align=center;fontSize=11;fillColor=#F7F4EC;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="847.6" y="409.0" width="84.8" height="18" />
        </mxCell>
        <mxCell id="edge6" value="" style="edgeStyle=none;rounded=0;html=0;endArrow=block;endFill=1;strokeWidth=2;strokeColor=#142B49;fontColor=#142B49;fontFamily=Helvetica;fontSize=12;labelBackgroundColor=#F7F4EC;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="execute" target="commit">
          <mxGeometry as="geometry" relative="1">
            <Array as="points">
              <mxPoint x="1035" y="687" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="label6" value="commit result" style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;align=center;fontSize=11;fillColor=#F7F4EC;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="992.6" y="557.5" width="84.8" height="18" />
        </mxCell>
        <mxCell id="edge7" value="" style="edgeStyle=none;rounded=0;html=0;endArrow=block;endFill=1;strokeWidth=2;strokeColor=#142B49;fontColor=#142B49;fontFamily=Helvetica;fontSize=12;labelBackgroundColor=#F7F4EC;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="unknown" target="commit">
          <mxGeometry as="geometry" relative="1" />
        </mxCell>
        <mxCell id="label7" value="effect confirmed" style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;align=center;fontSize=11;fillColor=#F7F4EC;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="694.2" y="540.5" width="101.6" height="18" />
        </mxCell>
        <mxCell id="edge8" value="" style="edgeStyle=none;rounded=0;html=0;endArrow=block;endFill=1;strokeWidth=2;strokeColor=#142B49;fontColor=#142B49;fontFamily=Helvetica;fontSize=12;labelBackgroundColor=#F7F4EC;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="unknown" target="noeffect">
          <mxGeometry as="geometry" relative="1">
            <Array as="points">
              <mxPoint x="600" y="437" />
              <mxPoint x="600" y="560" />
              <mxPoint x="165" y="560" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="label8" value="no effect proven" style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;align=center;fontSize=11;fillColor=#F7F4EC;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="331.7" y="538.0" width="101.6" height="18" />
        </mxCell>
        <mxCell id="edge9" value="" style="edgeStyle=none;rounded=0;html=0;endArrow=block;endFill=1;strokeWidth=2;strokeColor=#142B49;fontColor=#142B49;fontFamily=Helvetica;fontSize=12;labelBackgroundColor=#F7F4EC;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="noeffect" target="approved">
          <mxGeometry as="geometry" relative="1">
            <Array as="points">
              <mxPoint x="20" y="687" />
              <mxPoint x="20" y="120" />
              <mxPoint x="745" y="120" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="label9" value="revalidate approval" style="text;html=0;align=left;verticalAlign=middle;whiteSpace=wrap;strokeColor=none;fillColor=none;fontFamily=Helvetica;fontColor=#142B49;align=center;fontSize=11;fillColor=#F7F4EC;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="323.3" y="98.0" width="118.39999999999999" height="18" />
        </mxCell>
        <mxCell id="prop" value="PROPOSED&#10;Normalize + digest intent" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#F7F4EC;strokeColor=#142B49;strokeWidth=2;fontColor=#142B49;fontFamily=Helvetica;fontSize=15;align=center;verticalAlign=middle;spacing=10;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="45" y="165" width="240" height="82" />
        </mxCell>
        <mxCell id="pend" value="PENDING_APPROVAL&#10;Independent authorized human" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#F7F4EC;strokeColor=#142B49;strokeWidth=2;fontColor=#142B49;fontFamily=Helvetica;fontSize=15;align=center;verticalAlign=middle;spacing=10;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="335" y="165" width="240" height="82" />
        </mxCell>
        <mxCell id="approved" value="APPROVED&#10;Bind tenant / args / expiry" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#F7F4EC;strokeColor=#142B49;strokeWidth=2;fontColor=#142B49;fontFamily=Helvetica;fontSize=15;align=center;verticalAlign=middle;spacing=10;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="625" y="165" width="240" height="82" />
        </mxCell>
        <mxCell id="claim" value="EXECUTING&#10;Atomic claim + state checks" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#F7F4EC;strokeColor=#142B49;strokeWidth=2;fontColor=#142B49;fontFamily=Helvetica;fontSize=15;align=center;verticalAlign=middle;spacing=10;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="915" y="165" width="240" height="82" />
        </mxCell>
        <mxCell id="reject" value="REJECTED / EXPIRED&#10;Terminal · no effect" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#E4A83A;strokeColor=#142B49;strokeWidth=2;fontColor=#142B49;fontFamily=Helvetica;fontSize=15;align=center;verticalAlign=middle;spacing=10;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="335" y="390" width="240" height="90" />
        </mxCell>
        <mxCell id="commit" value="COMMITTED&#10;Durable outcome + result" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#142B49;strokeColor=#142B49;strokeWidth=2;fontColor=#F7F4EC;fontFamily=Helvetica;fontSize=15;align=center;verticalAlign=middle;spacing=10;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="625" y="640" width="240" height="95" />
        </mxCell>
        <mxCell id="execute" value="DISPATCH / EXECUTE&#10;Same key + same intent" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#F7F4EC;strokeColor=#142B49;strokeWidth=2;fontColor=#142B49;fontFamily=Helvetica;fontSize=15;align=center;verticalAlign=middle;spacing=10;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="915" y="390" width="240" height="82" />
        </mxCell>
        <mxCell id="unknown" value="UNKNOWN / RECONCILING&#10;Query authoritative outcome" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#E4A83A;strokeColor=#142B49;strokeWidth=2;fontColor=#142B49;fontFamily=Helvetica;fontSize=15;align=center;verticalAlign=middle;spacing=10;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="625" y="390" width="240" height="95" />
        </mxCell>
        <mxCell id="noeffect" value="FAILED_NO_EFFECT&#10;Retry only with proven safety" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#F7F4EC;strokeColor=#142B49;strokeWidth=2;fontColor=#142B49;fontFamily=Helvetica;fontSize=15;align=center;verticalAlign=middle;spacing=10;" vertex="1" parent="1">
          <mxGeometry as="geometry" x="45" y="640" width="240" height="95" />
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
