@davoodmehraban89 / Aram-2 Mirror · read-only / commits / 17b50a8
Fork 0

Mirrored from https://github.com/davoodmehraban89/Aram.git

Synced Dec 3, 20:45 UTC

docs(statements): specify paired transaction direct cash flow and explicit limitations

davoodmehraban89 committed Oct 31, 2026 at 08:25 UTC 17b50a809ea3fa14256d406504263c7dc1b38b8d
1 file changed +76
docs/CASH_FLOW_DIRECT_CANDIDATE.md new
+76
@@ -0,0 +1,76 @@
1 +# ARAM — direct-method cash flow candidate (NOT OFFICIAL)
2 +
3 +## Why this needs a different source
4 +
5 +An account-level trial balance only supplies opening balances and aggregate debit/credit turnover. **It does not tell us which cash transaction was operating, investing or financing.** Guessing cash-flow categories from account codes or names would produce a misleading report.
6 +
7 +The direct-method candidate therefore requires a separate, explicitly scoped transaction export made of paired cash/counterpart journal lines. It does not manufacture cash-flow categories from aggregate balances.
8 +
9 +## Required inputs
10 +
11 +1. A structurally valid Pilot XLSX containing the selected company's account balances and turnovers.
12 +2. A local JSON manifest with the same company, fiscal year, currency and unit.
13 +3. An explicit registry of all cash and cash-equivalent accounts in scope, each with evidence.
14 +4. A counterpart-account policy assigning each noncash counterpart account to `OPERATING`, `INVESTING` or `FINANCING`, with evidence.
15 +5. A transaction line for every paired cash posting. Each row contains company/year, unique line ID, voucher/transaction ID, posting date, cash account, counterpart account, cash debit/credit, counterpart debit/credit and evidence reference.
16 +
17 +Each transaction row represents **one cash posting paired to one counterpart posting**. If a voucher has several counterpart lines, split it into separately identified paired rows. The cash side must have exactly one nonzero debit or credit; the counterpart must equal the opposite side. All amounts are exact decimal strings. Every counterpart account must exist in the scoped Pilot account list.
18 +
19 +If the counterpart account is itself in the cash-account registry, the line is an internal cash transfer. Both cash accounts' turnovers are reconciled, and the transfer is excluded from operating/investing/financing totals. Both sides are included in the transparent internal-transfer totals.
20 +
21 +## Arithmetic and reconciliation
22 +
23 +For every registered cash account, aggregate the cash-side and any cash-counterpart debit/credit from the transaction manifest and compare them exactly to the account's source turnovers:
24 +
25 +```text
26 +opening_cash + source_debits - source_credits = closing_cash
27 +transaction_debits = source_debits
28 +transaction_credits = source_credits
29 +```
30 +
31 +For each external counterpart policy:
32 +- Cash debit is an inflow.
33 +- Cash credit is an outflow.
34 +- The explicit counterpart policy supplies the activity category.
35 +
36 +Then:
37 +
38 +```text
39 +operating_net = operating_inflows - operating_outflows
40 +investing_net = investing_inflows - investing_outflows
41 +financing_net = financing_inflows - financing_outflows
42 +net_change = operating_net + investing_net + financing_net
43 +opening_cash_and_equivalents + net_change = closing_cash_and_equivalents
44 +```
45 +
46 +Cash account opening/closing values use the Pilot source's **debit-net signed** convention; no sign multiplier or account-name inference is applied. A source cash-account turnover mismatch, unmatched cash roll-forward, unclassified counterpart, orphan policy, invalid paired posting, or wrong company/year blocks analyst eligibility.
47 +
48 +The manifest's `posting_date` is shape-checked as `YYYY-MM-DD`, month 1–12 and day 1–31, with its year prefix equal to the selected source fiscal-year label. **No Gregorian/Jalali conversion or calendar-date validity proof is performed.** Finance owner must confirm the source date convention.
49 +
50 +## Local CLI
51 +
52 +For synthetic or explicitly authorized local files:
53 +
54 +```bash
55 +cd backend
56 +python -m aram_backend.cash_flow_direct_candidate_cli \
57 + --file ./synthetic_pilot.xlsx \
58 + --manifest ./synthetic_cash_transactions.json
59 +```
60 +
61 +The manifest root contains `schema_version`, `company_code`, `fiscal_year`, `currency`, `unit`, `cash_accounts`, `counterpart_policies` and `transactions`. Every nested object is strict: unknown or duplicate keys fail closed. Cash manifest max size is 20 MiB; max 5,000 cash accounts, 20,000 counterpart policies and 30,000 transaction pairs. The CLI rejects symlink/nonregular/changed files and emits diagnostic JSON to stdout only. Exit 0 is analyst-preview eligibility only; exit 3 is a valid but blocked reconciliation; exit 2 is invalid/unsafe input.
62 +
63 +## Non-approval and release blockers
64 +
65 +The candidate always marks `cash_account_scope_owner_approved=false`, `transaction_ledger_completeness_verified=false`, `accounting_policy_authorized=false`, `official_financial_statement=false`, `independently_reviewed=false`, `export_authorized=false`, `releasable=false`. Even an eligible preview does not prove that the registry includes every cash equivalent or that the transaction export is complete/authentic.
66 +
67 +Before any official use:
68 +- Confirm completeness of all cash/bank/cash-equivalent accounts and their approved accounting scope.
69 +- Reconcile every paired transaction line to source voucher IDs and immutable source evidence.
70 +- Confirm classification of every counterpart account with the financial owner.
71 +- Review bank overdrafts, restricted cash, foreign currency, noncash transactions, leases, taxes and other applicable cash-flow policy.
72 +- Cross-check closing cash to the balance sheet and net income/working-capital effects to the income statement.
73 +- Obtain authenticated finance-owner signoff and three genuinely independent C1/C2/C3 approvals.
74 +- Build immutable official export and Windows UI only after accounting and security gates pass.
75 +
76 +No real company ledger, bank statement, source export, database, migration, secret or release artifact is included in this public repository. Use synthetic fixtures in the tests.