<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="eli.ai" agent="eli.ai diagram exporter" version="1">
  <diagram id="warrant-primary-runtime-flow-eb6432fd" name="Warrant — primary runtime flow">
    <mxGraphModel dx="1600" dy="1200" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1600" pageHeight="1200" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <object id="1" label="Warrant — primary runtime flow" schemaVersion="1" diagramId="warrant-primary-runtime-flow-eb6432fd" canonicalAppearanceKey="tsx:src/app/(docs)/docs/modules/warrant/page.tsx:warrantRuntimeFlowChart#1" sourceSha256="eb6432fde77d55f982c084e22ea0fb29b05ef24382ab24d98c65b036bfaa6d0b" metadataPayloadSha256="ccaf6fc341f8c4abac579f2ac598923d3912bff32602a0ca2231a003b2e9e453" generationKey="062d0a4f7ddf4b0ce2ea298b7ff767d5ff9c7aeee22de4689cf49faf7ab46d7c" concepts="[&quot;Warrant runtime flow&quot;,&quot;Modules&quot;,&quot;Warrant&quot;]" keywords="[&quot;POST :id/approve (API)&quot;,&quot;audit_log (store)&quot;,&quot;change-requests.ts (service)&quot;,&quot;concept_change_requests (store)&quot;,&quot;manual.ts + curation.ts (service)&quot;,&quot;entity_revisions (store)&quot;,&quot;append change_request.approve&quot;,&quot;Reviewer (SDK or curl)&quot;,&quot;entities (store)&quot;,&quot;append a revision with activity change_request:id&quot;,&quot;approveChangeRequest with an optional note&quot;,&quot;load the request, must be open&quot;,&quot;claim the row, status open to approved&quot;,&quot;apply the payload by kind&quot;,&quot;stamp appliedAt only after the apply commits&quot;,&quot;closed request plus appliedEntityId&quot;,&quot;guard kb:write and the governance:write capability&quot;,&quot;/api/v1/change-requests&quot;,&quot;reviewer gate — owner or steward only, when either is set&quot;,&quot;write the fields, promote authority to at least curated&quot;]" application="{&quot;name&quot;:&quot;eli-ai&quot;,&quot;version&quot;:&quot;0.1.0&quot;}" packages="{&quot;mermaid&quot;:&quot;11.16.0&quot;,&quot;mermaidCli&quot;:&quot;11.16.0&quot;,&quot;playwright&quot;:&quot;1.62.1&quot;,&quot;playwrightCore&quot;:&quot;1.62.1&quot;,&quot;puppeteer&quot;:&quot;25.6.0&quot;,&quot;puppeteerCore&quot;:&quot;25.6.0&quot;}" environment="{&quot;architecture&quot;:&quot;x64&quot;,&quot;containerImage&quot;:&quot;playwright:v1.62.1-noble@sha256:c091b21d9fae78c76e85cd4356431e9b018402f172a214fc7d7a5e9a7e29d8ac+node:26.3.1-bookworm-slim@sha256:209558c3e5e40e8adff68959d3c2ba7cd73723e716d89196878a0c362fa1e109&quot;,&quot;node&quot;:&quot;v26.3.1&quot;,&quot;platform&quot;:&quot;linux&quot;,&quot;yarn&quot;:&quot;4.17.1&quot;}" renderer="{&quot;browser&quot;:{&quot;executableSha256&quot;:&quot;0b20b130e7edd9dd51873be867761295fe0cfad490c2b9a64f95bd3cfc08fa71&quot;,&quot;name&quot;:&quot;chromium&quot;,&quot;revision&quot;:&quot;1234&quot;,&quot;version&quot;:&quot;151.0.7922.34&quot;},&quot;font&quot;:{&quot;family&quot;:&quot;Eli Diagram Inter Variable&quot;,&quot;fileSha256&quot;:&quot;3100e775e8616cd2611beecfa23a4263d7037586789b43f035236a2e6fbd4c62&quot;,&quot;licenseSha256&quot;:&quot;3b0a5fca3d17942cde889069889dedbbbd075e9b599968c82a95f4d944e9b345&quot;},&quot;mermaidConfigSha256&quot;:&quot;68c10966fe84406ee626034d58bfabd555df9f65f691204b7c46db24038da101&quot;,&quot;themeCssSha256&quot;:&quot;c80287a78d80ad63d27bd5ca348b2ef9a7e2f44da289e436be6484ea28a1b033&quot;}" adapterVersions="{&quot;diagramGenerator&quot;:&quot;2&quot;,&quot;drawioFlowchart&quot;:&quot;1&quot;,&quot;drawioGantt&quot;:&quot;1&quot;,&quot;drawioSequence&quot;:&quot;1&quot;,&quot;drawioState&quot;:&quot;1&quot;}" mermaidType="sequence" generatedAt="2026-08-17T18:41:53.943Z" mermaidSource="sequenceDiagram&#10;  autonumber&#10;  participant REVIEWER as Reviewer (SDK or curl)&#10;  participant ROUTE as POST /api/v1/change-requests/:id/approve (API)&#10;  participant ENGINE as change-requests.ts (service)&#10;  participant CR as concept_change_requests (store)&#10;  participant APPLY as manual.ts + curation.ts (service)&#10;  participant ENT as entities (store)&#10;  participant REV as entity_revisions (store)&#10;  participant AUDIT as audit_log (store)&#10;&#10;  REVIEWER-&gt;&gt;ROUTE: approveChangeRequest with an optional note&#10;  ROUTE-&gt;&gt;ENGINE: guard kb:write and the governance:write capability&#10;  ENGINE-&gt;&gt;CR: load the request, must be open&#10;  ENGINE-&gt;&gt;ENT: reviewer gate — owner or steward only, when either is set&#10;  ENGINE-&gt;&gt;CR: claim the row, status open to approved&#10;  ENGINE-&gt;&gt;APPLY: apply the payload by kind&#10;  APPLY-&gt;&gt;ENT: write the fields, promote authority to at least curated&#10;  APPLY-&gt;&gt;REV: append a revision with activity change_request:id&#10;  APPLY-&gt;&gt;AUDIT: append change_request.approve&#10;  ENGINE-&gt;&gt;CR: stamp appliedAt only after the apply commits&#10;  ENGINE--&gt;&gt;ROUTE: closed request plus appliedEntityId&#10;  ROUTE--&gt;&gt;REVIEWER: 200 with both">
          <mxCell parent="0"/>
        </object>
        <object id="n:AUDIT" label="audit_log (store)" mermaidId="AUDIT" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="2526" y="0" width="150" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:REV" label="entity_revisions (store)" mermaidId="REV" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="2285" y="0" width="191" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:ENT" label="entities (store)" mermaidId="ENT" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="2085" y="0" width="150" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:APPLY" label="manual.ts + curation.ts (service)" mermaidId="APPLY" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="1561" y="0" width="264" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:CR" label="concept_change_requests (store)" mermaidId="CR" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="1238" y="0" width="273" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:ENGINE" label="change-requests.ts (service)" mermaidId="ENGINE" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="844" y="0" width="239" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:ROUTE" label="POST /api/v1/change-requests/:id/approve (API)" mermaidId="ROUTE" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="317" y="0" width="385" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:REVIEWER" label="Reviewer (SDK or curl)" mermaidId="REVIEWER" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="0" y="0" width="191" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="e:lifeline:AUDIT" label="" mermaidId="lifeline:AUDIT" mermaidKind="lifeline">
          <mxCell parent="1" source="n:AUDIT" target="n:AUDIT" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="2601" y="65" as="sourcePoint"/>
              <mxPoint x="2601" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:REV" label="" mermaidId="lifeline:REV" mermaidKind="lifeline">
          <mxCell parent="1" source="n:REV" target="n:REV" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="2380.5" y="65" as="sourcePoint"/>
              <mxPoint x="2380.5" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:ENT" label="" mermaidId="lifeline:ENT" mermaidKind="lifeline">
          <mxCell parent="1" source="n:ENT" target="n:ENT" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="2160" y="65" as="sourcePoint"/>
              <mxPoint x="2160" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:APPLY" label="" mermaidId="lifeline:APPLY" mermaidKind="lifeline">
          <mxCell parent="1" source="n:APPLY" target="n:APPLY" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1693" y="65" as="sourcePoint"/>
              <mxPoint x="1693" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:CR" label="" mermaidId="lifeline:CR" mermaidKind="lifeline">
          <mxCell parent="1" source="n:CR" target="n:CR" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1374.5" y="65" as="sourcePoint"/>
              <mxPoint x="1374.5" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:ENGINE" label="" mermaidId="lifeline:ENGINE" mermaidKind="lifeline">
          <mxCell parent="1" source="n:ENGINE" target="n:ENGINE" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="963.5" y="65" as="sourcePoint"/>
              <mxPoint x="963.5" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:ROUTE" label="" mermaidId="lifeline:ROUTE" mermaidKind="lifeline">
          <mxCell parent="1" source="n:ROUTE" target="n:ROUTE" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="509.5" y="65" as="sourcePoint"/>
              <mxPoint x="509.5" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:REVIEWER" label="" mermaidId="lifeline:REVIEWER" mermaidKind="lifeline">
          <mxCell parent="1" source="n:REVIEWER" target="n:REVIEWER" edge="1" style="dashed=1;dashPattern=4 4;edgeStyle=none;endArrow=none;endFill=0;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#999;strokeWidth=0.5;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="95.5" y="65" as="sourcePoint"/>
              <mxPoint x="95.5" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i1" label="approveChangeRequest with an optional note" mermaidId="i1" mermaidKind="message">
          <mxCell parent="1" source="n:REVIEWER" target="n:ROUTE" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="102.5" y="115" as="sourcePoint"/>
              <mxPoint x="505.5" y="115" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i2" label="guard kb:write and the governance:write capability" mermaidId="i2" mermaidKind="message">
          <mxCell parent="1" source="n:ROUTE" target="n:ENGINE" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="516.5" y="165" as="sourcePoint"/>
              <mxPoint x="959.5" y="165" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i3" label="load the request, must be open" mermaidId="i3" mermaidKind="message">
          <mxCell parent="1" source="n:ENGINE" target="n:CR" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="970.5" y="215" as="sourcePoint"/>
              <mxPoint x="1370.5" y="215" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i4" label="reviewer gate — owner or steward only, when either is set" mermaidId="i4" mermaidKind="message">
          <mxCell parent="1" source="n:ENGINE" target="n:ENT" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="970.5" y="265" as="sourcePoint"/>
              <mxPoint x="2156" y="265" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i5" label="claim the row, status open to approved" mermaidId="i5" mermaidKind="message">
          <mxCell parent="1" source="n:ENGINE" target="n:CR" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="970.5" y="315" as="sourcePoint"/>
              <mxPoint x="1370.5" y="315" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i6" label="apply the payload by kind" mermaidId="i6" mermaidKind="message">
          <mxCell parent="1" source="n:ENGINE" target="n:APPLY" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="970.5" y="365" as="sourcePoint"/>
              <mxPoint x="1689" y="365" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i7" label="write the fields, promote authority to at least curated" mermaidId="i7" mermaidKind="message">
          <mxCell parent="1" source="n:APPLY" target="n:ENT" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1700" y="415" as="sourcePoint"/>
              <mxPoint x="2156" y="415" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i8" label="append a revision with activity change_request:id" mermaidId="i8" mermaidKind="message">
          <mxCell parent="1" source="n:APPLY" target="n:REV" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1700" y="465" as="sourcePoint"/>
              <mxPoint x="2376.5" y="465" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i9" label="append change_request.approve" mermaidId="i9" mermaidKind="message">
          <mxCell parent="1" source="n:APPLY" target="n:AUDIT" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="1700" y="515" as="sourcePoint"/>
              <mxPoint x="2597" y="515" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i10" label="stamp appliedAt only after the apply commits" mermaidId="i10" mermaidKind="message">
          <mxCell parent="1" source="n:ENGINE" target="n:CR" edge="1" style="edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="970.5" y="565" as="sourcePoint"/>
              <mxPoint x="1370.5" y="565" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i11" label="closed request plus appliedEntityId" mermaidId="i11" mermaidKind="message">
          <mxCell parent="1" source="n:ENGINE" target="n:ROUTE" edge="1" style="dashed=1;dashPattern=3  3;edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="968.5" y="615" as="sourcePoint"/>
              <mxPoint x="513.5" y="615" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i12" label="200 with both" mermaidId="i12" mermaidKind="message">
          <mxCell parent="1" source="n:ROUTE" target="n:REVIEWER" edge="1" style="dashed=1;dashPattern=3  3;edgeStyle=none;endArrow=block;endFill=1;html=1;jettySize=auto;orthogonalLoop=1;rounded=0;strokeColor=#333333;strokeWidth=2;">
            <mxGeometry relative="1" as="geometry">
              <mxPoint x="514.5" y="665" as="sourcePoint"/>
              <mxPoint x="99.5" y="665" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
