docs(coverage): define candidate semantics and strict no-approval boundary
davoodmehraban89 committed
Oct 31, 2026 at 00:16 UTC
b1d30559d9725905c2ed20858ff4a3be5d62ee7e
1 file changed
+33
docs/READONLY_MAPPING_COVERAGE.md
new
+33
@@ -0,0 +1,33 @@
1
+# ARAM Gate 3 — read-only Mapping coverage preview (candidate)
2
+
3
+**Status:** development-only, not accepted, not a financial report and not a reviewer approval.
4
+
5
+This isolated candidate is intentionally based on accepted `source-data-cleanup` rather than the unmerged Gate 3 parent branches. It adds a narrow, independent analysis of an existing Pilot XLSX byte snapshot. It does not alter source documents, write databases, execute Mapping changes, or create any official statements or export files.
6
+
7
+## Contract
8
+
9
+Call `preview_mapping_coverage(workbook_bytes, company_code="001", fiscal_year=1404)` from `aram_backend.coverage_preview`.
10
+
11
+The input must pass `preflight_pilot_workbook`. It must contain an explicit company/fiscal-year record and at least one account. The result includes the source SHA-256, full account lineage (Excel row/source row), candidate note exposure, ambiguous/unmapped/unapproved exceptions, and source/covered/blocked closing exposures.
12
+
13
+Only an account with **exactly one** Mapping row marked `Approved` and `Valid` **in the workbook** is included in the *candidate* group. These are untrusted workbook claims, **not** authorization. Duplicated mappings are excluded regardless of their stated approval status. Missing mappings are excluded. A closing balance is **not** a statement line, cash flow, income, or auditor-approved figure.
14
+
15
+Each output has `kind="UNAPPROVED_MAPPING_COVERAGE_PREVIEW"`, `financial_statement=false`, `trusted_approvals=false`, `releasable=false`. Do not remove these protections or expose an approval/export UI until authenticated independent reviews, source-to-statement semantics and reconciliation are accepted.
16
+
17
+Input size limit: 20 MiB; archive has at most 500 entries and 128 MiB declared expanded size. The tool rejects hidden input sheets/rows/columns and merged input ranges in the four authoritative sheets and forbids a cross-company or cross-year fallback. It uses Decimal arithmetic and deterministic ordering; it does not auto-map based on descriptions.
18
+
19
+## Verification
20
+
21
+Synthetic tests in `backend/tests/test_coverage_preview.py` cover accepted unique Mapping, unmapped and ambiguous accounts, workbook-marked Draft/Approved states, source preservation, hidden/merged inputs, invalid/oversized workbooks, absent company/year scopes and JSON-safe results.
22
+
23
+Run `cd backend && python -m pytest tests/test_coverage_preview.py -q` and then full backend CI with migration round-trip and compilation. No live customer data is required or permitted in tests.
24
+
25
+## Remaining acceptance dependencies
26
+
27
+- Real signed employee identity and scoped roles, reviewer segregation of duties and persisted decisions;
28
+- Database-enforced company/year immutability, concurrency/CAS and auditable Mapping application;
29
+- Financial owner confirmation of note/sub-note, account nature and debit/credit signs;
30
+- Reconciliation of historical financial figures and signed output/print;
31
+- Real GUI, clean Windows installation, end-to-end testing and independent C1/C2/C3 review.
32
+
33
+These are not implemented by this preview.