<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="eli.ai" agent="eli.ai diagram exporter" version="1">
  <diagram id="lineage-primary-runtime-flow-dca4f3d8" name="Lineage — 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="Lineage — primary runtime flow" schemaVersion="1" diagramId="lineage-primary-runtime-flow-dca4f3d8" canonicalAppearanceKey="tsx:src/app/(docs)/docs/modules/lineage/page.tsx:lineageRuntimeFlowChart#1" sourceSha256="dca4f3d8c20f01ed3cdcc565ef9afe5a2b689d3e98b5484ff5534f213e8eb216" metadataPayloadSha256="140400113ca35e5bba76046ac49060da97aba7b15dbb5123732bb368f7ff7b1d" generationKey="2cdcb58817b282af5a68080f70ba4f9073693675f66a21603c29579e7fdff846" concepts="[&quot;Lineage runtime flow&quot;,&quot;Modules&quot;,&quot;Lineage&quot;]" keywords="[&quot;GET :id/lineage (API)&quot;,&quot;API consumer (SDK or curl)&quot;,&quot;documents + connector_sources (store)&quot;,&quot;document_revisions + audit_log (store)&quot;,&quot;newest 50 document.* audit events&quot;,&quot;vault readDocument (service)&quot;,&quot;chunks + mentions + relations (store)&quot;,&quot;messages + semantic cache (store)&quot;,&quot;getDocumentLineage for one document id&quot;,&quot;documentLineage in one workspace transaction&quot;,&quot;the assembled DocumentLineage&quot;,&quot;document row left-joined to its connector source&quot;,&quot;newest 50 revision summaries with the uncapped total&quot;,&quot;citedByAnswers count and newest 50 dependent cache entries&quot;,&quot;lineage/index.ts&quot;,&quot;/api/v1/documents&quot;,&quot;service&quot;,&quot;newest 10 sync_runs when the origin is a connector&quot;,&quot;the document is live and visible to this key&quot;,&quot;ACL-checked read — unknown, deleted, restricted are the same 404&quot;,&quot;chunk count, top 50 canonical concepts, grounded relation count&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:34:59.423Z" mermaidSource="sequenceDiagram&#10;  autonumber&#10;  participant CALLER as API consumer (SDK or curl)&#10;  participant ROUTE as GET /api/v1/documents/:id/lineage (API)&#10;  participant VAULT as vault readDocument (service)&#10;  participant ASSEMBLER as lineage/index.ts (service)&#10;  participant CORE as documents + connector_sources (store)&#10;  participant TRAIL as document_revisions + audit_log (store)&#10;  participant DERIVED as chunks + mentions + relations (store)&#10;  participant IMPACT as messages + semantic cache (store)&#10;&#10;  CALLER-&gt;&gt;ROUTE: getDocumentLineage for one document id&#10;  ROUTE-&gt;&gt;VAULT: ACL-checked read — unknown, deleted, restricted are the same 404&#10;  VAULT--&gt;&gt;ROUTE: the document is live and visible to this key&#10;  ROUTE-&gt;&gt;ASSEMBLER: documentLineage in one workspace transaction&#10;  ASSEMBLER-&gt;&gt;CORE: document row left-joined to its connector source&#10;  ASSEMBLER-&gt;&gt;CORE: newest 10 sync_runs when the origin is a connector&#10;  ASSEMBLER-&gt;&gt;TRAIL: newest 50 revision summaries with the uncapped total&#10;  ASSEMBLER-&gt;&gt;TRAIL: newest 50 document.* audit events&#10;  ASSEMBLER-&gt;&gt;DERIVED: chunk count, top 50 canonical concepts, grounded relation count&#10;  ASSEMBLER-&gt;&gt;IMPACT: citedByAnswers count and newest 50 dependent cache entries&#10;  ASSEMBLER--&gt;&gt;ROUTE: the assembled DocumentLineage&#10;  ROUTE--&gt;&gt;CALLER: 200 deterministic trail payload">
          <mxCell parent="0"/>
        </object>
        <object id="n:IMPACT" label="messages + semantic cache (store)" mermaidId="IMPACT" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="2756.5" y="0" width="290" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:DERIVED" label="chunks + mentions + relations (store)" mermaidId="DERIVED" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="2404.5" y="0" width="302" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:TRAIL" label="document_revisions + audit_log (store)" mermaidId="TRAIL" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="2040.5" y="0" width="314" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:CORE" label="documents + connector_sources (store)" mermaidId="CORE" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="1668.5" y="0" width="322" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:ASSEMBLER" label="lineage/index.ts (service)" mermaidId="ASSEMBLER" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="1264" y="0" width="211" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:VAULT" label="vault readDocument (service)" mermaidId="VAULT" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="970" y="0" width="244" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:ROUTE" label="GET /api/v1/documents/:id/lineage (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="341.5" y="0" width="323" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:CALLER" label="API consumer (SDK or curl)" mermaidId="CALLER" 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="228" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="e:lifeline:IMPACT" label="" mermaidId="lifeline:IMPACT" mermaidKind="lifeline">
          <mxCell parent="1" source="n:IMPACT" target="n:IMPACT" 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="2901.5" y="65" as="sourcePoint"/>
              <mxPoint x="2901.5" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:DERIVED" label="" mermaidId="lifeline:DERIVED" mermaidKind="lifeline">
          <mxCell parent="1" source="n:DERIVED" target="n:DERIVED" 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="2555.5" y="65" as="sourcePoint"/>
              <mxPoint x="2555.5" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:TRAIL" label="" mermaidId="lifeline:TRAIL" mermaidKind="lifeline">
          <mxCell parent="1" source="n:TRAIL" target="n:TRAIL" 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="2197.5" y="65" as="sourcePoint"/>
              <mxPoint x="2197.5" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:CORE" label="" mermaidId="lifeline:CORE" mermaidKind="lifeline">
          <mxCell parent="1" source="n:CORE" target="n:CORE" 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="1829.5" y="65" as="sourcePoint"/>
              <mxPoint x="1829.5" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:ASSEMBLER" label="" mermaidId="lifeline:ASSEMBLER" mermaidKind="lifeline">
          <mxCell parent="1" source="n:ASSEMBLER" target="n:ASSEMBLER" 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="1369.5" y="65" as="sourcePoint"/>
              <mxPoint x="1369.5" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:VAULT" label="" mermaidId="lifeline:VAULT" mermaidKind="lifeline">
          <mxCell parent="1" source="n:VAULT" target="n:VAULT" 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="1092" y="65" as="sourcePoint"/>
              <mxPoint x="1092" 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="503" y="65" as="sourcePoint"/>
              <mxPoint x="503" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:CALLER" label="" mermaidId="lifeline:CALLER" mermaidKind="lifeline">
          <mxCell parent="1" source="n:CALLER" target="n:CALLER" 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="114" y="65" as="sourcePoint"/>
              <mxPoint x="114" y="685" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i1" label="getDocumentLineage for one document id" mermaidId="i1" mermaidKind="message">
          <mxCell parent="1" source="n:CALLER" 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="121" y="115" as="sourcePoint"/>
              <mxPoint x="499" y="115" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i2" label="ACL-checked read — unknown, deleted, restricted are the same 404" mermaidId="i2" mermaidKind="message">
          <mxCell parent="1" source="n:ROUTE" target="n:VAULT" 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="510" y="165" as="sourcePoint"/>
              <mxPoint x="1088" y="165" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i3" label="the document is live and visible to this key" mermaidId="i3" mermaidKind="message">
          <mxCell parent="1" source="n:VAULT" 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="1097" y="215" as="sourcePoint"/>
              <mxPoint x="507" y="215" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i4" label="documentLineage in one workspace transaction" mermaidId="i4" mermaidKind="message">
          <mxCell parent="1" source="n:ROUTE" target="n:ASSEMBLER" 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="510" y="265" as="sourcePoint"/>
              <mxPoint x="1365.5" y="265" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i5" label="document row left-joined to its connector source" mermaidId="i5" mermaidKind="message">
          <mxCell parent="1" source="n:ASSEMBLER" target="n:CORE" 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="1376.5" y="315" as="sourcePoint"/>
              <mxPoint x="1825.5" y="315" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i6" label="newest 10 sync_runs when the origin is a connector" mermaidId="i6" mermaidKind="message">
          <mxCell parent="1" source="n:ASSEMBLER" target="n:CORE" 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="1376.5" y="365" as="sourcePoint"/>
              <mxPoint x="1825.5" y="365" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i7" label="newest 50 revision summaries with the uncapped total" mermaidId="i7" mermaidKind="message">
          <mxCell parent="1" source="n:ASSEMBLER" target="n:TRAIL" 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="1376.5" y="415" as="sourcePoint"/>
              <mxPoint x="2193.5" y="415" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i8" label="newest 50 document.* audit events" mermaidId="i8" mermaidKind="message">
          <mxCell parent="1" source="n:ASSEMBLER" target="n:TRAIL" 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="1376.5" y="465" as="sourcePoint"/>
              <mxPoint x="2193.5" y="465" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i9" label="chunk count, top 50 canonical concepts, grounded relation count" mermaidId="i9" mermaidKind="message">
          <mxCell parent="1" source="n:ASSEMBLER" target="n:DERIVED" 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="1376.5" y="515" as="sourcePoint"/>
              <mxPoint x="2551.5" y="515" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i10" label="citedByAnswers count and newest 50 dependent cache entries" mermaidId="i10" mermaidKind="message">
          <mxCell parent="1" source="n:ASSEMBLER" target="n:IMPACT" 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="1376.5" y="565" as="sourcePoint"/>
              <mxPoint x="2897.5" y="565" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i11" label="the assembled DocumentLineage" mermaidId="i11" mermaidKind="message">
          <mxCell parent="1" source="n:ASSEMBLER" 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="1374.5" y="615" as="sourcePoint"/>
              <mxPoint x="507" y="615" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i12" label="200 deterministic trail payload" mermaidId="i12" mermaidKind="message">
          <mxCell parent="1" source="n:ROUTE" target="n:CALLER" 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="508" y="665" as="sourcePoint"/>
              <mxPoint x="118" y="665" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
