# Operational–financial reconciliation

**Goal:** Prove that **inventory (operational)** and **inventory (financial)** stay aligned within defined tolerances and time windows. Gaps are **detected**, **owned**, and **resolved** without silent ledger edits.

## Scope of consistency

| Layer | What “truth” means |
| --- | --- |
| **Operational** | On-hand, movements, layers (FIFO/weighted/etc.) per costing policy—**systems of record** |
| **Financial** | GL balances for inventory accounts, COGS, GRNI, etc., derived from posted journals |

Reconciliation compares **aggregates and roll-forwards**, not necessarily line-by-line movement-to-line unless sub-ledger granularity exists.

---

## Inventory vs accounting consistency

**Expected relationship:**

- Sum of **posted** inventory movement economics (net debits − credits to `INV_ASSET` role) matches **operational valuation roll-forward** for the same period, within **rounding policy**.
- **COGS** for the period matches operational **cost of issues** (fulfillment + adjustments) per costing method, within same tolerance.

**Time lag:** Async posting creates **temporary** mismatch windows. Metrics should separate:

- **Backlog:** Operations committed, posting not yet completed (healthy if bounded).
- **True drift:** Persistent gap after posting backlog clears.

---

## Mismatch detection

| Signal | Interpretation |
| --- | --- |
| Unposted operational facts older than SLA | Posting pipeline failure or missing trigger |
| Posted journal without resolvable source | Data integrity breach or manual journal—requires classification |
| Quantity or value drift after backlog = 0 | Costing bug, mapping error, duplicate movement, or unauthorized manual GL |
| Period-end trial balance vs cycle count variance | Mix of operational shrink vs unreconciled finance |

**Detection mechanisms:**

- Scheduled **reconciliation job**: compares operational closing inventory value vs GL inventory accounts by tenant.
- **Exception queue**: movements or receipts missing `journal_entry_id` (or equivalent link) after retry exhaustion.
- **Audit queries**: filter journals where `source_*` metadata null—should be rare and intentional.

---

## Reconciliation ownership

| Role | Responsibility |
| --- | --- |
| **Operations / inventory control** | Cycle counts, movement corrections, scrap approvals—**source truth** for quantities |
| **Accounting / finance** | GL mappings, period close, manual adjusting entries with approval workflow |
| **Engineering / platform** | Posting pipeline health, idempotency store, alert tuning |

**Resolution pattern:** Operational correction **first** when quantities wrong; **compensating journal** when finance wrong; **paired reversal + repost** when mapping bug affected historical entries—never **silent** updates to posted lines (`accounting-invariants.md`).

---

## Metrics & SLAs (recommended)

- Max age of unposted operational events (p95/p99).
- Reconciliation variance amount and count by tenant.
- Time-to-clear for reconciliation tickets.

---

## Related documents

- `accounting-invariants.md` — non-interference and immutability  
- `posting-pipeline.md` — failure and retry  
- `audit-traceability.md` — end-to-end trace  
