{
  "schemaVersion": 1,
  "generatedAt": "2026-08-17T18:34:47.800Z",
  "generationKey": "2232823d0d0ff21867b57a15826bcc94234b832fa604cee4fd20b38193a1a31e",
  "metadataPayloadSha256": "95db05f5210b6c672859af4550e078c60d69da7e005a15c873a92ecee0d28f99",
  "diagram": {
    "id": "lens-primary-runtime-flow-52b206dd",
    "title": "Lens — primary runtime flow",
    "description": "One queryWorkspace call. Retrieval and detection run in short read transactions, every model call happens outside any transaction, and each gate evaluation appends a policy_decisions row whether the mode is shadow or enforce.",
    "status": "current",
    "canonicalAppearanceKey": "tsx:src/app/(docs)/docs/modules/lens/page.tsx:primaryRuntimeFlowChart#1"
  },
  "aliases": [],
  "concepts": [
    "Primary runtime flow",
    "Modules",
    "Lens"
  ],
  "keywords": [
    "API caller (agents:run)",
    "POST (API)",
    "policy_decisions (store)",
    "clarify or abstain_with_pointers, no chat call",
    "Embedding model (model)",
    "Chat model (model)",
    "Judge model (model)",
    "Policy gates (service)",
    "query embedding",
    "append pre decision row",
    "Structured-answer orchestrator (service)",
    "Retrieval pipeline (service)",
    "understand, retrieve, fuse, rerank, assemble",
    "embed the rewritten question (vector channel)",
    "ranked, ACL-filtered chunks + stage counts",
    "pre-gate over retrieval features",
    "grounded generation over [Sn] context",
    "answer draft with claims + citations",
    "best-effort groundedness check",
    "post-gate calibrated confidence",
    "append pre + post decision rows",
    "StructuredAnswer — sources, policy, usage",
    "queryWorkspace — question, maxSources, policyMode",
    "/api/v1/query",
    "verified/total",
    "answerStructured",
    "counts"
  ],
  "mermaid": {
    "type": "sequence",
    "sourceSha256": "52b206dd71cef1c2f057573e51b15c129bda1371cb47bb4337d9c74e4f0eeeba"
  },
  "provenance": [
    {
      "appearanceKey": "tsx:src/app/(docs)/docs/modules/lens/page.tsx:primaryRuntimeFlowChart#1",
      "surface": "route",
      "sourcePath": "src/app/(docs)/docs/modules/lens/page.tsx",
      "line": 120,
      "route": "/docs/modules/lens",
      "symbol": "primaryRuntimeFlowChart",
      "caption": "One queryWorkspace call. Retrieval and detection run in short read transactions, every model call happens outside any transaction, and each gate evaluation appends a policy_decisions row whether the mode is shadow or enforce."
    }
  ],
  "embeddedMetadata": [
    {
      "sourcePath": "src/app/(docs)/docs/modules/lens/page.tsx",
      "caption": "One queryWorkspace call. Retrieval and detection run in short read transactions, every model call happens outside any transaction, and each gate evaluation appends a policy_decisions row whether the mode is shadow or enforce."
    }
  ],
  "generation": {
    "application": {
      "name": "eli-ai",
      "version": "0.1.0"
    },
    "environment": {
      "node": "v26.3.1",
      "yarn": "4.17.1",
      "platform": "linux",
      "architecture": "x64",
      "containerImage": "playwright:v1.62.1-noble@sha256:c091b21d9fae78c76e85cd4356431e9b018402f172a214fc7d7a5e9a7e29d8ac+node:26.3.1-bookworm-slim@sha256:209558c3e5e40e8adff68959d3c2ba7cd73723e716d89196878a0c362fa1e109"
    },
    "packages": {
      "mermaid": "11.16.0",
      "mermaidCli": "11.16.0",
      "playwright": "1.62.1",
      "playwrightCore": "1.62.1",
      "puppeteer": "25.6.0",
      "puppeteerCore": "25.6.0"
    },
    "renderer": {
      "mermaidConfigSha256": "68c10966fe84406ee626034d58bfabd555df9f65f691204b7c46db24038da101",
      "themeCssSha256": "c80287a78d80ad63d27bd5ca348b2ef9a7e2f44da289e436be6484ea28a1b033",
      "browser": {
        "name": "chromium",
        "revision": "1234",
        "version": "151.0.7922.34",
        "executableSha256": "0b20b130e7edd9dd51873be867761295fe0cfad490c2b9a64f95bd3cfc08fa71"
      },
      "font": {
        "family": "Eli Diagram Inter Variable",
        "fileSha256": "3100e775e8616cd2611beecfa23a4263d7037586789b43f035236a2e6fbd4c62",
        "licenseSha256": "3b0a5fca3d17942cde889069889dedbbbd075e9b599968c82a95f4d944e9b345"
      }
    },
    "adapterVersions": {
      "diagramGenerator": "2",
      "drawioFlowchart": "1",
      "drawioSequence": "1",
      "drawioState": "1",
      "drawioGantt": "1"
    }
  },
  "artifacts": {
    "mmd": "/diagrams/lens-primary-runtime-flow-52b206dd/lens-primary-runtime-flow-52b206dd.mmd",
    "svg": "/diagrams/lens-primary-runtime-flow-52b206dd/lens-primary-runtime-flow-52b206dd.svg",
    "png": "/diagrams/lens-primary-runtime-flow-52b206dd/lens-primary-runtime-flow-52b206dd.png",
    "drawio": "/diagrams/lens-primary-runtime-flow-52b206dd/lens-primary-runtime-flow-52b206dd.drawio",
    "json": "/diagrams/lens-primary-runtime-flow-52b206dd/lens-primary-runtime-flow-52b206dd.json"
  },
  "artifactSha256": {
    "mmd": "9982c053cb2ad5fba1a8e97414f43ba36b5baca8177d5237df22b95315e4b13b",
    "svg": "d246fc022092c3155631f5e150eccfc7c130a314a935458b65b89666bdcdcb6b",
    "png": "a2d0c4241977faecc777d58fd5b2868abb30f30683b4a3ebf0c443d28c9bd71b",
    "drawio": "021395ce871565099038f530a7d81d4c8d9d2eeb26ff66a00d8186a339d27f9c"
  }
}
