@davoodmehraban89 / Aram / commits / ab87fc0
Fork 0

docs: define mapping matcher semantics and limitations

davoodmehraban89 committed Nov 1, 2026 at 15:05 UTC ab87fc0c8df863144bb58b417f2b4205879b98a8
1 file changed +30
docs/MAPPING_MATCHER.md new
+30
@@ -0,0 +1,30 @@
1 +# Multi-dimensional mapping matcher
2 +
3 +## Scope and status
4 +
5 +This module classifies ledger rows against the canonical mapping rows. It is a read-only diagnostic, not an approval workflow and not a statement-generation input.
6 +
7 +## Composite key
8 +
9 +The matching dimensions are:
10 +- Account code (`حساب` in ledger, `کد حساب` in mapping)
11 +- `T1_CODE`
12 +- `جاري / سرمایه ای`
13 +- `T4_CODE`
14 +
15 +The current `LedgerRecord` parser does not expose a `جاري / سرمایه ای` ledger field. The matcher therefore deliberately does **not** pretend that dimension was checked. Its current default matching contract only checks T1 and T4, and the JS mapping value is not yet accepted as a discriminator. This is a known integration blocker, not a verified full composite match.
16 +
17 +Rule semantics implemented:
18 +- Blank mapping dimension = wildcard.
19 +- Populated mapping dimension = exact match required.
20 +- A populated mapping dimension does not match a missing ledger dimension.
21 +- Every source mapping row remains distinct; duplicate rows create ambiguity.
22 +- No rule precedence, formula evaluation, or auto-approval.
23 +
24 +## Exclusions and exposure
25 +
26 +Account `8999` is excluded from the mapping-eligible denominator, consistent with the existing source-analysis decision. Its source row remains present in total source counts and source closing exposure. The exclusion is configurable at the API boundary.
27 +
28 +## Required next gate
29 +
30 +Before calling this production-ready, add the source ledger's approved current/capital classification field (if present) to `LedgerRecord`, verify the exact workbook header/value domain with an authorized source workbook, and run the full 252,898-row reconciliation. Do not interpret this preview as finance approval.