Understand¶
This section is for readers who want to know how Underwrite works before they write code. Architecture, lifecycle, runtime guarantees, compliance, and security.
Architecture¶
The full architecture overview — domain services, event runtime, control plane, operational layer, and the injection points where cross-cutting concerns enter the dispatch path.
Indian lending lifecycle¶
The full underwriting journey in twelve stages, with the service, event, and compliance responsibility at each transition.
Compliance¶
How RBI rate caps, all-in-cost APR, KFS cooling-off, DPDPA consent lifecycle, and DSR fulfillment are encoded as runtime defaults — not application-level conventions.
Security¶
Ed25519 signatures, replay window, PII-redacted audit, deterministic event records — the security posture of the runtime.
Runtime¶
The underwrite.runtime.Runtime orchestrator — service registration, dependency injection, identity creation, authz wiring, and lifecycle.
Events¶
The Message envelope, the canonical signing bytes, the Type enum of 132 event types, and the event lifecycle from create to replay.
Failure handling¶
DLQ, idempotency, sagas with compensating rollback, circuit breaking, supervisor auto-restart, and the rules of thumb for each.
System design¶
End-to-end runtime behavior — bus dispatch, store writes, saga execution, traced and instrumented.
Directory structure¶
The full underwrite/ package layout — every module's purpose and what it depends on.
Design decisions¶
The ADRs and design notes behind nano-service isolation, typed events, Ed25519 signatures, and saga orchestration.
Domain model¶
Core entities — borrower, loan, mandate, KYC, KFS — and the invariants the runtime enforces.