Skip to content

Backend System Map

LeafEnterprise backend systems are documented as owned libraries and API contracts. The docs are designed to be indexed by agents and read by humans.

Authority Spine

flowchart LR
  Sources[AWS SQL / Azure SQL / ADLS / Graph / Salesforce / Domo evidence] --> Scope[Governed scope]
  Scope --> Calculations[Deterministic savings and audit calculations]
  Calculations --> API[LeafEnterprise API contracts]
  API --> Dashboard[Scoped client dashboard payloads]
  API --> Deliverables[Workbook / PDF / narrative / optimization]
  API --> Agents[MCP services and enterprise agents]

LeafEnterprise is the backend authority in this chain. Dashboard and Domo-facing consumers receive scoped outputs from the backend; they do not authorize calculations or evidence sufficiency.

Operating Lifecycle

flowchart LR
  ITR[Salesforce ITR Workbench] --> Plan[Run Plan Resolution]
  Plan --> Scope{One exact governed scope?}
  Scope -- no --> Block[Blocked: resolve in savings]
  Scope -- yes --> Queue[Queue To Savings]
  Queue --> Savings[Savings Audit Report Context]
  Savings --> AI[AI Optimization]
  AI --> Workbook[Final Workbook Artifact]
  Savings --> Workbook

Evidence Retrieval Lifecycle

flowchart LR
  SF[Salesforce ITR Mirror] --> Bundle[Evidence Bundle]
  Bundle --> Materialize[File Materialization]
  Materialize --> Chunks[Extracted Text Chunks]
  Chunks --> Search[Azure AI Search / Foundry IQ Documents]
  Search --> Agents[Agent Workbench Tools]

Agent Execution Lifecycle

flowchart LR
  Task[Agent Task] --> Policy[Policy Evaluation]
  Policy --> Review{Allowed?}
  Review -- no --> Blocked[Blocked / Operator Review]
  Review -- yes --> Run[OpenAI Agents SDK Run]
  Review -- dispatch --> Bus[Service Bus agent-tasks]
  Bus --> AKS[AKS Worker]
  Run --> Trace[Trace Ledger]
  AKS --> Trace
  Trace --> Artifacts[Artifact Ledger]

Contract Guarantee Lifecycle

flowchart LR
  Scope[PBM / TPA / Group / Dates] --> Registry[Governed Pricing Registry]
  Scope --> Graph[Graph / OneDrive Candidates]
  Registry --> Exact{Exact evidence?}
  Graph --> Promote{One deterministic packet?}
  Promote -- yes --> Exact
  Exact -- yes --> Render[Render Contract Inputs]
  Exact -- no --> Gap[Blocked Guarantee Evidence Gap]
  Gap --> Domo[Domo Candidate Evidence Only]

Semantic Index Anchors

System Human docs Machine/API docs
Savings/Audit backend-libraries/savings-audit-determinism.md, backend-libraries/savings-audit-math.md api/routes/report-deliverables.md, api/routes/optimization-ai.md
Salesforce ITR backend-libraries/salesforce-itr-evidence.md api/routes/itr-workbench.md
Contract guarantees backend-libraries/contract-guarantees.md api/routes/report-deliverables.md, api/routes/product-ops.md
Agents agent-runtime/, agent-runtime/mcp-service-contracts.md api/routes/agent-workbench.md
Azure / Foundry azure-foundry/ machine/api-reference.json

Source-Of-Truth Rule

These docs should be updated whenever backend route families, queue-action contracts, evidence semantics, agent tool boundaries, or provisioning assumptions change. Future agents should retrieve these docs before using LeafEnterprise APIs or provisioning MCP tools.