Mirrored from https://github.com/davoodmehraban89/Aram.git
Synced Dec 3, 20:45 UTC
docs(statements): document offline BS candidate CLI and fail-closed JSON manifests
davoodmehraban89 committed
Oct 31, 2026 at 00:38 UTC
6ec76c5e0373054a47e5e55da81251a4e9229fee
1 file changed
+30
docs/BALANCE_SHEET_CANDIDATE.md
+30
@@ -45,3 +45,33 @@ assert not candidate.official_financial_statement
45
- Full: `cd backend && pytest -q`, `alembic upgrade head`, `alembic downgrade base`, `python -m compileall -q src tests migrations`.
46
- No modification to canonical `data/`, no DB writes, no migrations, no enterprise IdP, no HTML/GUI/export/print functionality in this PR.
47
- A real finance owner must specify the required Iranian financial-statement classification and sign policies, verify trial balance and note disclosures, and approve fiscal-year controls. Real C1/C2/C3 reviewers must independently sign off. This preview does not substitute for those controls.
48
+
49
+
50
+## Offline user-facing CLI (read-only)
51
+
52
+Create two **local and synthetic/authorized** JSON manifests. The note reference manifest is described in `docs/NOTE_RECONCILIATION_REVIEW.md`. The presentation manifest must contain a strict version and the same company/year scope:
53
+
54
+```json
55
+{
56
+ "schema_version": 1,
57
+ "company_code": "001",
58
+ "fiscal_year": 1404,
59
+ "policies": [
60
+ {"statement_section":"Assets","note_number":"A1","subnote_code":"","category":"ASSETS","sign_multiplier":1,"line_label":"Synthetic assets","policy_evidence_ref":"SYNTH-POLICY-A"},
61
+ {"statement_section":"Liabilities","note_number":"L1","subnote_code":"","category":"LIABILITIES","sign_multiplier":-1,"line_label":"Synthetic liabilities","policy_evidence_ref":"SYNTH-POLICY-L"},
62
+ {"statement_section":"Equity","note_number":"E1","subnote_code":"","category":"EQUITY","sign_multiplier":-1,"line_label":"Synthetic equity","policy_evidence_ref":"SYNTH-POLICY-E"}
63
+ ]
64
+}
65
+```
66
+
67
+```bash
68
+cd backend
69
+python -m aram_backend.balance_sheet_candidate_cli \
70
+ --file ./synthetic.xlsx \
71
+ --references ./synthetic_references.json \
72
+ --policies ./synthetic_presentation.json
73
+```
74
+
75
+Exit status `0` means mathematically balanced for **analyst preview only**; `3` means unbalanced or other blocking findings; `2` means invalid/unsafe input. No official statement, XLSX/PDF document, database record or approval is ever created. Data is printed to stdout as JSON only. Never save real financial files in the public repository.
76
+
77
+Both JSON files and XLSX are read using bounded, no-symlink local readers; duplicate or unknown JSON keys and mismatched company/year scopes block. Security and CLI tests are in `backend/tests/test_balance_sheet_candidate_cli.py`.