Three stages, each bounded by the next.

Built so that no single stage can originate a loan the others would refuse. Training runs in Python, inference runs in JavaScript, and the two are pinned to each other by assertion.

01

Structural

Logistic regression over eight cashflow features: coverage, trend, volatility, drawdown, concentration, scale, obligor age and momentum. Seven carry weight. Drawdown fits to exactly zero here, which we report rather than quietly drop, because a feature the model ignores is a fact about the model. Gradient boosting was trained alongside and lost out-of-time, so the linear model ships.
02

Qualitative overlay

A language model reads unstructured context and returns an adjustment with written reasoning, clamped offchain to ±30% of the base probability. The contract enforces its own separate ceiling. If the model fails, underwriting proceeds structurally and the skip is recorded.
03

Calibration

A Venn-Abers probability interval, valid under exchangeability alone with no assumption that the model is well specified. The upper edge drives the risk ceiling, so uncertainty tightens underwriting rather than being discarded.

Measured, not asserted

Evaluated walk-forward by decision time. Random k-fold on time-series data leaks the future into the past and produces flattering, meaningless numbers.

Walk-forward score, logistic0.1965
Walk-forward score, gradient boosting0.2061
A constant predictor would score0.2142
Held-out AUC0.711
Mean calibration interval width0.046

Lower is better on the first three. Beating the constant predictor is the bar that matters; a model that cannot is worse than guessing the average.

Stated plainly. The model is v0, trained on a synthetic bootstrap dataset. 0.197 against a 0.311 base rate is real signal, and it is modest.

It has never seen a real default. This is not a claim about real-world accuracy, and the contribution here is the mechanism rather than the model.

Why the parity tests exist

Training happens in Python and inference in JavaScript. Nothing at runtime would catch a divergence, because a drifted feature still produces a plausible number, which then gets signed, bonded and acted on.

734 assertions at 1e-9 tolerance

Every feature and every calibration output is compared between the two implementations, including degenerate inputs such as empty and flat revenue series.

The artifact is version-checked

Loading a model whose feature order disagrees with the code throws immediately. That catches the worst case, which is coefficients silently applied to the wrong features.