Skip to Main Content

ERPCraft A free, open-source, clean-room ERP in Rust — AI-native from day one, with a double-entry ledger the database itself refuses to let you break. ERPCraft is an enterprise resource planning system for the world its builder actually lives in: small manufacturers who run their businesses on spreadsheets because the incumbent ERPs are closed, expensive, and held together by consultants — and who are now being asked to trust AI agents with real books. So ERPCraft is built around one idea: an AI agent should drive the exact same commands a human does, propose before it posts, and work on top of a ledger whose correctness does not depend on any caller behaving — its invariants are enforced by the database itself on every connection the application opens, and that enforcement has been probe-tested from outside, including with raw SQL. The vision is the full ERP: general ledger, order-to-cash, purchasing, inventory, manufacturing planning, and reporting, owned by the people who run it. This repository is the working core of that vision, built and verified in the open: - A double-entry ledger enforced by the database itself. Every posting must balance (debits = credits) — the rule lives in SQLite triggers, not application code. Entries can only be created as drafts and post through the one balance-checked transition; direct posted inserts are refused, amounts are integer cents at rest (a fractional "cent" cannot be stored, let alone posted), and on application connections the append-only guards also fire on the implicit deletes of INSERT OR REPLACE, so history cannot be rewritten through that path either. The journal is append-only; corrections are reversing entries that reference the original. Money is integer cents, never floating point. An external review probed exactly these boundaries with executable tests; every hole it found is fixed and now covered by regression tests in the suite. - Order-to-cash with a GL posting engine. Quotes to sales orders to invoices to payments to returns, where the transitions themselves generate the revenue, COGS, payment, and reversal postings. Correctness is pinned by a hand-computed "oracle day": 14 transactions whose ending trial balance ($129,975.00 per side) is the acceptance suite. - A variant configurator modeled on SAP LO-VC object dependencies — precondition, selection condition, and constraint — as a typed AST, evaluated deterministically in the core. Selected components roll into line price and standard cost. AI works only at the edges: it authors dependency rules behind a propose to confirm gate and explains refusals in plain language. Ask for a galvanized finish on an aluminum bracket and the system refuses, naming the rule: "Galvanized finish is available only on steel brackets." - Procure-to-pay with a three-way match. The buying mirror of order-to-cash: suppliers to requisitions (approved before they convert) to purchase orders to goods receipts (Dr inventory / Cr GR-IR clearing) to supplier invoices (GR-IR clears at the PO price; the difference posts to purchase price variance) to payments. The three-way match is computed live from the three documents on every read: invoice more than was received, or at any price but the PO price (zero price tolerance, deliberately — any difference is a variance), and the invoice lands on hold — recorded, visible, and unpayable until the variance is resolved or a named person overrides it with a recorded reason (the variance facts stay on the invoice either way). The supplier's own invoice number is a duplicate key: the same number against the same PO can never be recorded — and so never paid — twice. - Controls foundations. Fiscal periods gate the single posting path — close a period and every door refuses postings dated into it, rolling the whole document transition back. A users/roles registry backs a segregation-of-duties rule: payments above a configured threshold require a named actor and a different approver with an approver/admin role, recorded on the payment and its journal entry. The rule gates the capability, not just the document methods: the generic cash-out journal builders enforce it too. - One dispatch table, four doors. 85 commands served identically to an operator CLI, an MCP server on stdio, an HTTP API, and the natural-language agent — JSON out, plain-language refusals, exit codes 0/1/2. Anything a human can do, an agent can drive; there is no second, weaker API. (The HTTP door binds 127.0.0.1 and is a trusted local operator door, like the CLI; the propose to confirm gate is the agent surface's contract, and the segregation-of-duties rule applies at every door.) - A natural-language agent behind a propose to confirm gate. Plain English ("Invoice Acme for the 40 units we shipped Tuesday") becomes proposed dispatch calls. The confirmation is rendered from actual ledger data — never from model prose — and nothing posts until a human confirms. The agent also answers questions, can propose releasing a plan, receives goods against purchase orders, and pays supplier invoices — including the held ones, where a payment can only be proposed when the prompt itself carries the match-override reason and the approver's name — enforced in code, not just documented: override attribution the model supplies that does not appear in the human's own words is discarded. Confirmations are one-shot (a confirmed action cannot be replayed) and revalidated at confirm time, and every confirmation is rendered from the actual document it will post — quantity, price, configuration. - AI-native MRP on the Warp Speed pattern. Materials planning that is dynamic (every run recomputes from current orders, stock, BOMs, and configurations — plans are never stored, so a changed order re-plans instantly), explainable (every planned order carries its netting math and demand reasons; a shortage is simply a planned order whose start date has already passed), and agent-native ("Can we build 200 BRK-100 by Nov 15?" is answered from a live run; releasing a planned order goes through the same confirm gate and creates the document — planning never posts to the GL). - A full audit trail. Every journal entry explains itself: who posted it, which document it belongs to, why it posted, the complete provenance chain (quote to order to invoice to payments to returns) with reversal links in both directions — and, for agent postings, the verbatim human prompt that proposed it. The demo company is Cascade Precision Parts, a fictional small Oregon manufacturer making metal brackets.

Team

More from Meta Global AI Developer Hackathon

Cardo turns the world around you into Kurdish flashcards. Kurdish is spoken by tens of millions of people, but it has very few learning tools, and most…

Kurdolingo project preview

oqed is an LLM-guided superoptimizer for x86-64. You point it at a C or C++ project and it does the rest: - builds the project and runs its workload…

oqed project preview

Playtest Agent plays a game from screenshots, looks for bugs, then replays each report and has a judge check it. I make games alone. Solo developers and…

Adrian project preview

Open-source npm malware detection on Meta's models: a live monitor that flags new malware about a day before the public lists, a Muse agent that investigates…

Gatekeeper project preview

Video2URDF turns one short phone video of a real articulated object (a laptop lid, a drawer, a desk lamp, a microwave door) into a measured URDF/MJCF a robot…

Video2URDF project preview

Glimmer Scope opens up Muse Glimmer 30B so you can see and steer the concepts it thinks with. I trained sparse autoencoders on nine layers of Glimmer's…

Kroonen AI project preview