The self-improving ERP engine
Every ERP processes transactions. Only ERPClaw learns from them. 18 constitutional articles. 3 evolution phases. 701 OS-specific tests. The only ERP that detects gaps and generates modules while protecting financial integrity.
18 Constitutional Articles
Inviolable rules that govern every operation. The AI cannot override them. No admin can bypass them. They are the foundation of trust.
Financial data integrity is inviolable
Double-entry accounting is always enforced
GL entries are immutable -- cancel creates reversal
All financial amounts use Decimal (TEXT storage)
IDs use UUID4 (TEXT storage)
Submit operations are atomic (single transaction)
12-step GL validation on every posting
Only owning module can write its tables
Any module can read any table
Parameterized queries only -- no string interpolation
Output is always JSON to stdout
Errors are JSON with exit code 1
WAL mode and FK enforcement always ON
Draft-to-Submit lifecycle on all documents
Naming series follow deterministic patterns
RBAC governs all data access
AES-256 encryption for sensitive fields
Backup is always recoverable
Three Evolution Phases
ERPClaw OS grew through three phases, each adding more autonomy while maintaining safety.
Phase 1: Child
255 tests- Module generation from 7 deterministic patterns
- SKILL.md validation and linting
- Sandbox testing before deployment
- Schema DDL generation and migration
- Constitutional article compliance checks
Phase 2: Teenager
226 tests- Tier classification system (Tier 0-3 autonomy)
- Schema migration engine
- Deploy pipeline with safety gates
- Install-suite for grouped installs
- Adversarial audit and compliance weather
Phase 3: Adult
220 tests- Semantic correctness engine
- Self-improvement log with change tracking
- DGM variant engine (evolutionary optimization)
- Heartbeat analysis per module
- Gap detection across business workflows
Safety Model
Self-improvement sounds risky. Here is how ERPClaw OS ensures every change is safe.
11 Protected Files
Core financial files (gl_posting.py, stock_posting.py, etc.) can NEVER be modified by the AI. Hard-coded exclusion list.
Constitutional Tests
153 automated tests verify every article is enforced. Run before every deployment.
Tier Classification
Tier 0 (manual only) through Tier 3 (autonomous). Financial modules are always Tier 0.
23 Invariant Checks
GL double-entry balance, voucher balance, immutability verification per transaction batch.
Sandbox Validation
Every generated module runs in an isolated sandbox before deployment to production.
Semantic Verification
Changes are validated against business rules, not just syntax. Catches logic errors before they reach production.
See the code behind the OS
Every constitutional article, every safety check, every generation pattern -- open source under open source license.
View on GitHubRelated: read the architecture in AI-native ERP, see the test surface at quality, the foundation features, or the engineering deep-dive in building ERPClaw with Claude Code.