frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Belay – formal verification for SQLite migrations and queries in Lean 4

https://github.com/vihren-dev/belay
3•neprotivo•3h ago
Hi, I'm Tzanko and I'm the author of Belay.

Belay is a Lean 4 library for doing formal verification of SQLite queries and migrations. It implements a semantic model of a subset of SQLite, validated by differential tests that compare the output against native SQLite.

With Belay I wanted to see how difficult it is to use formal verification for everyday development tasks. It turns out it can be made not much harder than writing an integration test: you state the claim, the agent writes the proof, and Lean's kernel checks it, so the only thing you have to read is the claim (longer write-up on the motivation and agent workflow: https://vihren.dev/blog/20261112-belay/).

While a migration is being written, your agent can run #sql_check, which searches small databases for counterexamples to a claim, and is as easy to run as a linter.

Once the migration is settled, the agent writes a proof of the claims you need, for example that the migration preserves the results of existing queries and succeeds on valid data.

Currently Belay supports a subset of SQLite 3.51.0, cross-checked against native SQLite on 5,768 differential test cases, most of which come from SQLite's own test suite. Unsupported SQL is rejected with a reason and never approximated. Not every rule of the model has had a human audit yet. The model covers single-connection operational semantics only: it says nothing about query plans, locks, concurrency or crash behavior.

I think this approach can make formal verification as routine as testing, though two things stand in the way. The first is coverage: the model has to cover the full semantics of SQLite and all of its recent versions, and the same work has to be done for other engines such as PostgreSQL and ClickHouse. The second is proof cost: the proofs of common claims are still long for the agent to write, and they have to become short. I'm looking for design partners who want this for their workloads on SQLite or other open-source databases, because a real workload is the best guide to what to cover first. The models that come out of that work become part of Belay as open source. Reach out at contact@vihren.dev.

If you know a tricky SQLite edge case where the model might diverge from native SQLite, or a gnarly migration bug you've hit in production, I'd love to test it and hear your thoughts.

Show HN: Alloy CSS, dialogs, menus and tabs that work with JavaScript off

https://alloyhtml.com/example.html
59•prafandy•1h ago•11 comments

Show HN: VennDB: append-only in-memory Rust DB for rows queried using bit flags

https://github.com/plabayo/venndb
26•gdcbe•1d ago•1 comments

Show HN: Moonswing – a Linux desktop environment built with Flutter

https://github.com/miracle-wm-org/moonswing
4•mkosarek•41m ago•1 comments

Show HN: Atli – MCP server that lets AI agents buy and install travel eSIMs

https://heyatli.com/mcp
4•peterhoang•1h ago•0 comments

Show HN: Agav – an open-source terminal agent designed to waste fewer tokens

https://github.com/prapaa-ai/agav
16•GeradeMoleculee•2h ago•7 comments

Show HN: An open virtual office to cowork with humans while your agents work

https://flat.social/virtual-office-platform
11•pawelwentpawel•3h ago•3 comments

Show HN: Belay – formal verification for SQLite migrations and queries in Lean 4

https://github.com/vihren-dev/belay
3•neprotivo•3h ago•0 comments

Show HN: Orchard – Turn a Linux server into your own cloud

https://orchard.hackclub.com
4•leafd•3h ago•1 comments

Show HN: Show HN: PWT Today – A Daily Pokémon World Tournament Browser Run

https://pwt-today.com/
2•bigpapikite•3h ago•0 comments

Show HN: Sutra-OS – A self-hosted ontology platform

https://github.com/0nelight/sutra-os
64•0nelight•17h ago•34 comments

Show HN: Pulsar – cross-harness agent to agent communication and messaging

https://github.com/yocontra/pulsar
19•contrahax•13h ago•3 comments

Show HN: Shoptimist – Amazon but Curated

https://shoptimist.co/
5•MisterJoe•4h ago•2 comments

Show HN: Open-source, real-time object tracking for live video feeds

https://github.com/aryamandarda/tamserve
34•aryaman_darda•19h ago•2 comments

Show HN: Zigzag, a native Mac browser for people leaving Arc

https://github.com/ZigaoWang/zigzag
90•ZigaoWang•3d ago•61 comments

Show HN: MeshLive – Offline Video calls and livestreams over Bluetooth mesh

https://meshlive.github.io/
2•gptgautam1•7h ago•0 comments

Show HN: Fakemetrics.com – "build in public" like a superstar

https://fakemetrics.com/
49•tigranbs•22h ago•21 comments

Show HN: Toolbelt – Free developer utilities that run in the browser

https://gettoolbelt.dev/
5•gprakasha234•13h ago•0 comments

Show HN: ThingStudio, Node-RED style programming for microcontrollers

https://thingstudio.net/
39•mkarliner•6d ago•8 comments

Show HN: Free weekly backups for Supabase Free projects (pg_dump to R2)

https://github.com/liulewis/supabase-free-backup-lite
10•agricalc•15h ago•0 comments

Show HN: Birds as Code

https://erl-j.github.io/fun-zone/birds.html
18•abdljasser2•22h ago•10 comments

Show HN: A terminal-native idle factory game, written in Rust with ratatui

https://gitlab.com/snipedbywifi/terminactory
172•snipedbywifi•3d ago•44 comments

Show HN: The Last Complication, a Zachtronics-style watchmaking puzzle game

https://lastcomplication.com/
86•tdeangelis•1d ago•18 comments

Show HN: Carton Clock – A working pendulum clock made from empty drink cartons

https://www.niklasroy.com/carton-clock/
87•r0r0•4d ago•2 comments

Show HN: Deslop skill based on corpus-linguistics and psycholinguistics research

https://github.com/etodanik/deslop
15•dannypovolotski•1d ago•4 comments

Show HN: NOS x86-64 hypervisor, written in Rust

https://nos-os.tech/en/demo
4•irqlevel•18h ago•0 comments

Show HN: db-branch – database branches in seconds for AI agents and CI, via ZFS

https://github.com/db-branch/db-branch
45•nu_nu11•2d ago•16 comments

Show HN: My $300 embroidery machine needed a subscription, so I built my own app

https://github.com/simpsoka/zigzag
742•simpsoka•4d ago•258 comments

Show HN: Coding agents with native environments, identity and access

https://kosem.ai/blog/coding-agents-workstation-moment
4•yevpats•14h ago•0 comments

Show HN: Astrum – a terminal multiplexer with integrated AI assistant

https://robert-mcdermott.github.io/astrum/
4•mcdermott•14h ago•1 comments

Show HN: Omnistew – 3D multiplayer RTS written in Rust, playable in a browser

https://omnistew.io/
3•omnistew•15h ago•1 comments