Mirrored from https://github.com/davoodmehraban89/Aram.git
Synced Dec 3, 23:15 UTC
docs(review): define reference reconciliation contract and nonapproval boundary
davoodmehraban89 committed
Oct 31, 2026 at 00:25 UTC
c7ac1558354866a6c56a80d289395dfb9a0614d1
1 file changed
+52
docs/NOTE_RECONCILIATION_REVIEW.md
new
+52
@@ -0,0 +1,52 @@
1
+# ARAM — Note exposure reconciliation gate (UNRELEASED)
2
+
3
+## Purpose and approved boundaries
4
+
5
+This focused component compares **workbook-derived candidate account closing exposures** against separately entered per-note **reference closing exposures**. It does not decide whether the signs, account nature, accruals, cash flows, equity movements, or statutory financial statements are correct.
6
+
7
+Upstream: Draft PR #60 read-only coverage preview (`coverage_preview.py`). This change must remain a Draft child until its parent, security controls and actual accounting owner decisions are accepted.
8
+
9
+## API
10
+
11
+```python
12
+from aram_backend.reconciliation_review import NoteReference, reconcile_workbook_for_review
13
+
14
+result = reconcile_workbook_for_review(
15
+ workbook_bytes,
16
+ company_code="001",
17
+ fiscal_year=1404,
18
+ references=[
19
+ NoteReference(
20
+ statement="BS",
21
+ section="Assets",
22
+ note_number="N01",
23
+ subnote_code="",
24
+ expected_closing_exposure="126.00",
25
+ evidence_ref="SYNTHETIC-CONTROL-TOTAL-01",
26
+ )
27
+ ],
28
+)
29
+assert not result.approved
30
+assert not result.releasable
31
+```
32
+
33
+References and workbooks **must** be synthetic or authorized. The reference amount and evidence identifier are *untrusted assertions*, not independently verified source facts. Never copy production data into tests or repository logs.
34
+
35
+## Fail-closed rules
36
+
37
+- Explicit company/year only; no cross-year fallback.
38
+- Pilot workbook must pass upstream preflight, including detection of hidden and merged data.
39
+- Missing/ambiguous/unapproved Mapping accounts remain blocking exceptions.
40
+- Every candidate note requires one unique explicit reference; an extra or duplicate reference blocks or rejects the comparison.
41
+- Exact Decimal comparisons with no silent tolerance, rounding or invented sign rules; amounts must be finite bounded text values (not floats).
42
+- Source workbook SHA-256 and canonical independent reference SHA-256 are attached to every result. Changing source or control reference changes provenance.
43
+- Output is structured in-memory data only. No database writes, ledger mutation, report export, approval action, PDF or EXE.
44
+- Even an exact match means only `matched_for_analyst_review=True`, while `financial_statement=False`, `trusted_approvals=False`, `approved=False`, and `releasable=False`.
45
+
46
+## Scope explicitly NOT implemented
47
+
48
+Statement generation and financial-sign policy, authenticated reviewer identities, documented year/company approval, independently signed audit decisions, atomic Mapping application, database locking/CAS, cash flow movement reconciliation, official note disclosures, PDF/XLSX printing and release packaging are out of scope.
49
+
50
+## Verification
51
+
52
+Run `cd backend && pytest tests/test_reconciliation_review.py` and then full Backend CI (all tests, SQLite migration round trip, bytecode compilation) on the exact last commit. Review against the accepted parent, keep accounting sources untouched, and obtain real external C1/C2/C3 reviews before any merge. Use the linked PR's CI instead of agent-written counts for acceptance.
\ No newline at end of file