<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="eli.ai" agent="eli.ai diagram exporter" version="1">
  <diagram id="crucible-primary-runtime-flow-d2c7d473" name="Crucible — 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="Crucible — primary runtime flow" schemaVersion="1" diagramId="crucible-primary-runtime-flow-d2c7d473" canonicalAppearanceKey="tsx:src/app/(docs)/docs/modules/crucible/page.tsx:primaryRuntimeFlowChart#1" sourceSha256="d2c7d473fa1b3035d9b50cbe4cc138849483b8945966f2aa2c6ced2a92e48c10" metadataPayloadSha256="29bf6f6cdaac4b751275adb567c4c407b477129d87148d6e535c2f003ddcf73d" generationKey="3eb6dcde9e23efe1f9f345081c2cbce39f111e487fe394e71ccd04b22f240eef" concepts="[&quot;Primary runtime flow&quot;,&quot;Modules&quot;,&quot;Crucible&quot;]" keywords="[&quot;GET {id}/metrics (API)&quot;,&quot;GET (API)&quot;,&quot;POST (API)&quot;,&quot;eval_runs + eval_results + run_metrics (store)&quot;,&quot;qrels + audit_log (store)&quot;,&quot;append judgment + qrel.author audit event&quot;,&quot;getEvalRunMetrics runId&quot;,&quot;aggregate one run&quot;,&quot;load run, per-result rows, overall run_metrics row&quot;,&quot;Quality client (kb:read / kb:write)&quot;,&quot;Eval aggregation helper (service)&quot;,&quot;Paired-significance module (service)&quot;,&quot;retrieval + RAGAS + abstention inputs&quot;,&quot;compareEvalRuns a, b, metric&quot;,&quot;pair per-item means by golden item id&quot;,&quot;seeded bootstrap + sign-flip permutation&quot;,&quot;delta, confidence interval, p-value&quot;,&quot;two-gate significant verdict&quot;,&quot;authorQrel queryId, chunkId, grade&quot;,&quot;metrics summary with error classes and risk coverage&quot;,&quot;/api/v1/evals/runs&quot;,&quot;/api/v1/qrels&quot;,&quot;/api/v1/evals/runs/compare&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:32:20.358Z" mermaidSource="sequenceDiagram&#10;  autonumber&#10;  participant Consumer as Quality client (kb:read / kb:write)&#10;  participant MRoute as GET /api/v1/evals/runs/{id}/metrics (API)&#10;  participant CRoute as GET /api/v1/evals/runs/compare (API)&#10;  participant QRoute as POST /api/v1/qrels (API)&#10;  participant Agg as Eval aggregation helper (service)&#10;  participant Sig as Paired-significance module (service)&#10;  participant Results as eval_runs + eval_results + run_metrics (store)&#10;  participant Qrels as qrels + audit_log (store)&#10;&#10;  Consumer-&gt;&gt;MRoute: getEvalRunMetrics runId&#10;  MRoute-&gt;&gt;Agg: aggregate one run&#10;  Agg-&gt;&gt;Results: load run, per-result rows, overall run_metrics row&#10;  Results--&gt;&gt;Agg: retrieval + RAGAS + abstention inputs&#10;  Agg--&gt;&gt;Consumer: metrics summary with error classes and risk coverage&#10;  Consumer-&gt;&gt;CRoute: compareEvalRuns a, b, metric&#10;  CRoute-&gt;&gt;Agg: pair per-item means by golden item id&#10;  Agg-&gt;&gt;Sig: seeded bootstrap + sign-flip permutation&#10;  Sig--&gt;&gt;Agg: delta, confidence interval, p-value&#10;  Agg--&gt;&gt;Consumer: two-gate significant verdict&#10;  Consumer-&gt;&gt;QRoute: authorQrel queryId, chunkId, grade&#10;  QRoute-&gt;&gt;Qrels: append judgment + qrel.author audit event&#10;  Qrels--&gt;&gt;Consumer: 201 new row, or 200 existing row on the dedupe key">
          <mxCell parent="0"/>
        </object>
        <object id="n:Qrels" label="qrels + audit_log (store)" mermaidId="Qrels" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="2481.5" y="0" width="199" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Results" label="eval_runs + eval_results + run_metrics (store)" mermaidId="Results" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="2067.5" y="0" width="364" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Sig" label="Paired-significance module (service)" mermaidId="Sig" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="1718.5" y="0" width="299" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Agg" label="Eval aggregation helper (service)" mermaidId="Agg" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="1300" y="0" width="270" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:QRoute" label="POST /api/v1/qrels (API)" mermaidId="QRoute" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="1048" y="0" width="202" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:CRoute" label="GET /api/v1/evals/runs/compare (API)" mermaidId="CRoute" mermaidShape="participant">
          <mxCell parent="1" vertex="1" style="fillColor=#eaeaea;fontColor=#333333;html=1;participant=umlActor;shape=umlLifeline;strokeColor=#666;whiteSpace=wrap;">
            <mxGeometry x="694" y="0" width="304" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:MRoute" label="GET /api/v1/evals/runs/{id}/metrics (API)" mermaidId="MRoute" 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="327" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="n:Consumer" label="Quality client (kb:read / kb:write)" mermaidId="Consumer" 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="267" height="65" as="geometry"/>
          </mxCell>
        </object>
        <object id="e:lifeline:Qrels" label="" mermaidId="lifeline:Qrels" mermaidKind="lifeline">
          <mxCell parent="1" source="n:Qrels" target="n:Qrels" 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="2581" y="65" as="sourcePoint"/>
              <mxPoint x="2581" y="735" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:Results" label="" mermaidId="lifeline:Results" mermaidKind="lifeline">
          <mxCell parent="1" source="n:Results" target="n:Results" 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="2249.5" y="65" as="sourcePoint"/>
              <mxPoint x="2249.5" y="735" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:Sig" label="" mermaidId="lifeline:Sig" mermaidKind="lifeline">
          <mxCell parent="1" source="n:Sig" target="n:Sig" 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="1868" y="65" as="sourcePoint"/>
              <mxPoint x="1868" y="735" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:Agg" label="" mermaidId="lifeline:Agg" mermaidKind="lifeline">
          <mxCell parent="1" source="n:Agg" target="n:Agg" 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="1435" y="65" as="sourcePoint"/>
              <mxPoint x="1435" y="735" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:QRoute" label="" mermaidId="lifeline:QRoute" mermaidKind="lifeline">
          <mxCell parent="1" source="n:QRoute" target="n:QRoute" 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="1149" y="65" as="sourcePoint"/>
              <mxPoint x="1149" y="735" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:CRoute" label="" mermaidId="lifeline:CRoute" mermaidKind="lifeline">
          <mxCell parent="1" source="n:CRoute" target="n:CRoute" 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="846" y="65" as="sourcePoint"/>
              <mxPoint x="846" y="735" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:MRoute" label="" mermaidId="lifeline:MRoute" mermaidKind="lifeline">
          <mxCell parent="1" source="n:MRoute" target="n:MRoute" 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="480.5" y="65" as="sourcePoint"/>
              <mxPoint x="480.5" y="735" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:lifeline:Consumer" label="" mermaidId="lifeline:Consumer" mermaidKind="lifeline">
          <mxCell parent="1" source="n:Consumer" target="n:Consumer" 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="133.5" y="65" as="sourcePoint"/>
              <mxPoint x="133.5" y="735" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i1" label="getEvalRunMetrics runId" mermaidId="i1" mermaidKind="message">
          <mxCell parent="1" source="n:Consumer" target="n:MRoute" 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="140.5" y="115" as="sourcePoint"/>
              <mxPoint x="476.5" y="115" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i2" label="aggregate one run" mermaidId="i2" mermaidKind="message">
          <mxCell parent="1" source="n:MRoute" target="n:Agg" 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="487.5" y="165" as="sourcePoint"/>
              <mxPoint x="1431" y="165" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i3" label="load run, per-result rows, overall run_metrics row" mermaidId="i3" mermaidKind="message">
          <mxCell parent="1" source="n:Agg" target="n:Results" 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="1442" y="215" as="sourcePoint"/>
              <mxPoint x="2245.5" y="215" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i4" label="retrieval + RAGAS + abstention inputs" mermaidId="i4" mermaidKind="message">
          <mxCell parent="1" source="n:Results" target="n:Agg" 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="2254.5" y="265" as="sourcePoint"/>
              <mxPoint x="1439" y="265" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i5" label="metrics summary with error classes and risk coverage" mermaidId="i5" mermaidKind="message">
          <mxCell parent="1" source="n:Agg" target="n:Consumer" 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="1440" y="315" as="sourcePoint"/>
              <mxPoint x="137.5" y="315" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i6" label="compareEvalRuns a, b, metric" mermaidId="i6" mermaidKind="message">
          <mxCell parent="1" source="n:Consumer" target="n:CRoute" 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="140.5" y="365" as="sourcePoint"/>
              <mxPoint x="842" y="365" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i7" label="pair per-item means by golden item id" mermaidId="i7" mermaidKind="message">
          <mxCell parent="1" source="n:CRoute" target="n:Agg" 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="853" y="415" as="sourcePoint"/>
              <mxPoint x="1431" y="415" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i8" label="seeded bootstrap + sign-flip permutation" mermaidId="i8" mermaidKind="message">
          <mxCell parent="1" source="n:Agg" target="n:Sig" 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="1442" y="465" as="sourcePoint"/>
              <mxPoint x="1864" y="465" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i9" label="delta, confidence interval, p-value" mermaidId="i9" mermaidKind="message">
          <mxCell parent="1" source="n:Sig" target="n:Agg" 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="1873" y="515" as="sourcePoint"/>
              <mxPoint x="1439" y="515" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i10" label="two-gate significant verdict" mermaidId="i10" mermaidKind="message">
          <mxCell parent="1" source="n:Agg" target="n:Consumer" 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="1440" y="565" as="sourcePoint"/>
              <mxPoint x="137.5" y="565" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i11" label="authorQrel queryId, chunkId, grade" mermaidId="i11" mermaidKind="message">
          <mxCell parent="1" source="n:Consumer" target="n:QRoute" 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="140.5" y="615" as="sourcePoint"/>
              <mxPoint x="1145" y="615" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i12" label="append judgment + qrel.author audit event" mermaidId="i12" mermaidKind="message">
          <mxCell parent="1" source="n:QRoute" target="n:Qrels" 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="1156" y="665" as="sourcePoint"/>
              <mxPoint x="2577" y="665" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e:i13" label="201 new row, or 200 existing row on the dedupe key" mermaidId="i13" mermaidKind="message">
          <mxCell parent="1" source="n:Qrels" target="n:Consumer" 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="2586" y="715" as="sourcePoint"/>
              <mxPoint x="137.5" y="715" as="targetPoint"/>
            </mxGeometry>
          </mxCell>
        </object>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
