Project 08
MarginFlow
Commerce margin · data engineering
Computes contribution margin per order across three engines that must agree — a TypeScript spec, a pure-Python port, and a DuckDB transform.
Three faithful implementations agreed perfectly on a number that was 52.5% too high. The gate proved they matched — never that they were right.
Real-world context · Guilherme Mendes / UnsplashScroll diagram horizontally →
contribution margin · cm-v1 · integer centsgross → contribution
Contribution margin, GST first. The headline read 3390c until the GST came out of it.