Developer Documentation
Implementation-level reference for contributors and integrators.
Architecture
Client
│ RPC / SSE
▼
Runtime ── Middleware ── @backend Routes
│
▼
Storage Proxy (ptr) ── MVCC ── PostgreSQLRequest Flow
Client Call
│
▼
RPC Stub (__kontract_rpc)
│
▼
Route Map (@backend meta)
│
▼
Middleware Filter (prefixurl / egroup / endpoints)
│
▼
Handler Execution
│
▼
Storage Proxy → MVCC → PostgreSQL
│
▼
SSE Event EmitCore Concepts
- Minimal privilege: storage access is gated by ptr resolution and MVCC rules
- Explicit boundary:
@backendis the compiler entry point for remote calls - Consistent events: SSE payloads use a unified
ChangeEventshape - Deterministic middleware: filtered and inlined into a single handler at compile time