TOE Engineering Presentation Series/TOE: System Architecture

Everything Runs Through Marketplace

Borrower and lender are just different API views of the same backend.

Two API namespaces, one backend
// Borrower — /bxp prefix, cookie auth
ENDPOINTS = {
  fileData: '/bxp/get-file',
  income:   '/bxp/income',
  decision: '/bxp/decision-result',
}
// Lender — /api prefix, session auth
endpoints = {
  file:           (id) => `/api/file/${id}`,
  income:         (id) => `/api/file/${id}/income`,
  decisionResult: (id) => `/api/file/${id}/decision-result`,
}

Every System Reads the Same File

One File = one loan application. Every entity branches from it.

⚠️
Security Boundary
Lender-only fields like excluded and verified must never reach borrowers. The /bxp proxy strips them automatically.
Borrower UI - Application
Zod schemas that mirror these entity shapes on the FE
App schemasrc/application/application.schema.ts
Field schemassrc/fields/schemas.ts

Deletes Are Soft by Default

Flagged, not removed. One exception: vendor-sourced credit tradelines.

No Submit Button — Everything Reacts

Every data change triggers re-evaluation automatically.

Both Paths Converge Here
after_flush detects a dirty File → Decision Engine re-evaluates all policies → satisfy codes update → screens react automatically.
automaticno user action needed
after_flushlc/sas.py :230
Workflowlc/engines/workflow/api.py

Everything Funnels Through the Workflow Layer

One orchestrator coordinates decision, reactor, and pricing.

Same Data, Same Names, Same Rules

Contracts keep the repos in sync.

DATA CONTRACTS
INTEGRATION CONTRACTS
Decision Result
Both Borrower UI and Cortex consume the same endpoint — Borrower UI reads pass/fail, Cortex reads the full tree
polling
Borrowerlc/app/borrower/views/decision_result.py
Cortexcortex/src/lib/decision.query.ts
Auth Patterns
Borrower UI uses httpOnly cookies, Cortex inherits marketplace session, Auth UI sets cookies
per-frontend
Viewslc/app/borrower/auth/views.py
Utilslc/app/borrower/auth/utils.py

How to Ship Without Breaking the Chain

Rules for cross-repo work.

Keyboard Shortcuts

→ / Space
Next slide / reveal fragment
Previous slide / hide fragment
Home / End
First / last slide
F
Toggle fullscreen
?
Toggle this help
Esc
Close help
Comments