Skip to content

Phase 1: Accounting Model and Core Engine

Goal: a correct, concurrent, idempotent posting engine on PostgreSQL, proven by property, concurrency and failure tests, with no public API yet.

Why no API yet: an API frozen before the accounting model is understood turns modelling mistakes into compatibility promises.

Milestone at the end of this phase: M1 Engine correct (tag v0.1.0-engine)

Step Topic
1.01 Accounting Foundations and Worked Examples
1.02 Architecture Decision Records and Repository Restructure
1.03 Invariant Catalogue, Threat Model v0, Regulatory Applicability
1.04 Money, Currency and Identifier Types
1.05 Chart of Accounts and the Account Model
1.06 Journal Entries and Posting Rules (Pure Core)
1.07 In-Memory Reference Ledger (the Oracle)
1.08 PostgreSQL Schema v1, Constraints and Roles
1.09 Atomic Posting with SQLx
1.10 Concurrency Control and Concurrent Spending
1.11 Idempotency and Exactly-Once Effect
1.12 Reversals and Adjustments
1.13 Balance Verification and Integrity Checking
1.14 Holds and Two-Phase Operations
1.15 Failure Injection and Crash Recovery for the Core
1.16 Phase 1 Consolidation, Baseline Benchmark and Exit Review

Steps run in order. Each one closes only when its Exit Gate is met and the evidence is committed under docs/evidence/. Target dates are in the schedule.