Building a Correct-by-Design Lakehouse. Data Contracts, Versioning, and Transactional Pipelines for Humans and Agents
Weiming Sheng, Jinlang Wang, Manuel Barros, Aldrin Montana, Jacopo Tagliabue, Luca Bigon
TL;DR
Bauplan addresses correctness in lakehouses faced with untrusted data actors by proposing a code-first design that fuses typed data contracts, Git-like data versioning, and transactional pipeline runs. It integrates static and runtime checks, point-in-time reproducibility, and atomic multi-table publication to prevent schema, collaboration, and correctness failures. A lightweight Alloy model grounds the correctness arguments and reveals counterexamples that guide API and protocol design. This approach offers a practical path toward correct-by-design lakehouses with improved verification, reproducibility, and safe collaboration for both humans and automated coding agents.
Abstract
Lakehouses are the default cloud platform for analytics and AI, but they become unsafe when untrusted actors concurrently operate on production data: upstream-downstream mismatches surface only at runtime, and multi-table pipelines can leak partial effects. Inspired by software engineering, we design Bauplan, a code-first lakehouse that aims to make (most) illegal states unrepresentable using familiar abstractions. Bauplan acts along three axes: typed table contracts to make pipeline boundaries checkable, Git-like data versioning for review and reproducibility, and transactional runs that guarantee pipeline-level atomicity. We report early results from a lightweight formal transaction model and discuss future work motivated by counterexamples.
