// lib/accounting/core/README.md

# Accounting Core Kernel (WP-01)

This directory contains the foundational types, interfaces, and contracts for the accounting posting kernel. All posting, extraction, and migration logic must depend on these contracts.

## Key Elements

- **accounting-event-registry.ts**: Event types, event schema, posting context, and result contracts.
- **journal-types.ts**: Immutable journal entry and line types, with hash chain fields.
- **dimension-validator.ts**: Dimension validation contract and example implementation.
- **open-balance-engine.ts**: Open balance calculation contract for AP/AR and other ledgers.
- **immutable-policy.ts**: Immutability enforcement for posted documents.
- **posting-status-types.ts**: Posting status type union.
- **hash-chain.ts**: Deterministic hash computation for journal entries.
- **currency-snapshot.ts**: Currency snapshot contract for FX and precision.
- **event-registry.ts**: Central registry for event schemas and handlers.
- **context-types.ts**: Posting context contract.

## Governance

- No extraction, migration, or posting logic may bypass these contracts.
- All posting events must be registered and versioned.
- All journal entries are immutable and hash-chained.
- All dimension validation and open balance logic must use these contracts.

---

> **Note:** This layer must be fully implemented and validated before any extraction or migration work begins.
