Mirrored from https://github.com/davoodmehraban89/Aram.git
Synced Dec 4, 19:15 UTC
phase-1b1-audit-report-7365389436990903239
add-index-html-10623938925177053894
arena/094f314c-aram
arena/2d4eda07-aram
chatgpt-phase1b2-autopilot
codex/adr-future-connectors-pi-v1
codex/aram-account-note-source-trace-20261031
codex/aram-actions-node24-maintenance-20261031
codex/aram-analyst-review-workbook-20261031
codex/aram-bs-candidate-statement-20261031
codex/aram-cash-flow-direct-candidate-20261031
codex/aram-clean-reference-year-integrity-20261030
codex/aram-cross-statement-controls-20261031
codex/aram-equity-changes-candidate-20261031
codex/aram-five-statement-cli-20261031
codex/aram-five-statement-integration-20261031
codex/aram-five-statement-orchestrator-20261031
codex/aram-gate3-coverage-target-guard-20261030
codex/aram-gate3-hidden-xlsx-guard-20261030
codex/aram-gate3-integration-validation-20261030
codex/aram-gate3-mapping-change-preview-20261030
codex/aram-gate3-stale-note-guard-20261030
codex/aram-income-statement-candidate-20261031
codex/aram-manifest-referential-integrity-20261031
codex/aram-mapping-source-parser-20261101
codex/aram-multidimensional-mapping-20261101
codex/aram-multistatement-mapping-20261031
codex/aram-pipeline-manifest-schema-20261031
codex/aram-readonly-mapping-coverage-20261031
codex/aram-reconciliation-review-gate-20261031
codex/aram-same-flush-fiscal-lock-20261030
codex/aram-synthetic-windows-demo-20261031
codex/aram-trial-balance-diagnostic-20261031
codex/aram-windows-background-detail-search-20261031
codex/aram-windows-detail-review-20261031
codex/aram-windows-five-statement-pilot-20261031
codex/aram-windows-statement-figures-20261031
codex/gate-2a-pilot-workbook
codex/gate-2a-pilot-workbook-6864754244772568979
codex/gate3-authenticated-principal-boundary-20261030
codex/gate3-authored-draft-staging-20261030
codex/gate3-carry-forward-preview-20261023
codex/gate3-draft-staging-audit-20261030
codex/gate3-mapping-batch-freshness-20261030
codex/gate3-mapping-batch-review-20261030
codex/gate3-mapping-core
codex/gate3-mapping-coverage-20261023
codex/gate3-mapping-excel-20261023
codex/gate3-note-mapping-review-20261023
codex/gate3-signed-year-scope-20261030
codex/gate3-unapproved-proposal-storage-20261030
codex/payvast-mapping-discovery-20261023
codex/phase-2a-backend-foundation
codex/phase-2b-post-merge-record
codex/phase-2b-source-registration
codex/phase-2b-source-registration-12955190277775369594
codex/post-gate2a-control-reconciliation
codex/post-pr18-acceptance-record
codex/project-control-foundation
codex/t1-repo-hygiene-20261023
codex/t2-ci-hardening-20261023
codex/t3-explicit-migrations-20261023
codex/t6a-readonly-diagnostics-20261023
codex/v1-01-safety-gate-hardening
codex/v1-year-isolation-followup-20261023
codex/windows-native-pilot-shell-20261030
dependabot/github_actions/actions/setup-node-6
dependabot/github_actions/actions/setup-python-7
dependabot/github_actions/actions/upload-artifact-7
dependabot/npm_and_yarn/frontend/eslint-plugin-react-hooks-7.1.1
dependabot/npm_and_yarn/frontend/vite-8.4.0
dependabot/npm_and_yarn/frontend/vitest-5.1.2
docs/aram-master-control-plan-20261111
docs/aram-roadmap-dashboard-20261030
docs/financial-statement-reconciliation-1402-1404-20261110
feat/gate3-governed-mapping-20261101
feat/gate3-package9-1-security-20261103
feat/gate3-package9-isolated-20261103
fix/password-unicode-validation-20261111
governance/aram-5-1-3-controls-20261030
governance/role-based-operating-model
jules-1168663913887856558-73b8a885
jules-gate-2b-mapping-workflow-foundation-4137724387867065330
phase-1b1-audit-report-7365389436990903239
phase-2a-backend-foundation-10237597358138521261
phase1b2-postmerge-metadata-fix
refactor/drg-parent-year-id-15088443704684163304
source-data-cleanup
| 1 | # Source Lineage Analysis |
| 2 | |
| 3 | ## Overview |
| 4 | This document analyzes the structural schema, data quality, and lineage capabilities of the 1403 and 1404 source ledgers. |
| 5 | |
| 6 | ## 1. 1402 Lineage Limitations |
| 7 | No canonical `source_1402` ledger is currently part of the verified source set. |
| 8 | For 1402 the lineage terminates at: `Official Statement -> Statement Line -> Note -> Note Row`. |
| 9 | Source-row lineage cannot be claimed for 1402. |
| 10 | |
| 11 | ## 2. 1403 Lineage Limitations |
| 12 | The canonical ledger `source_1403.xlsx` exists. However, a dedicated `mapping_1403.xlsx` has not been provided. |
| 13 | `mapping_1404.xlsx` must **NOT** be applied retroactively to 1403. |
| 14 | Any mapping classification currently present in the application for 1403 must be distinctly tagged as `RECONSTRUCTED_MAPPING` unless directly extracted from `SOURCE_PROVIDED_1403_CLASSIFICATION` fields in the raw ledger itself. |
| 15 | |
| 16 | ## 3. Structural Reconciliation & Quality (1403 vs 1404) |
| 17 | |
| 18 | ### source_1403.xlsx |
| 19 | - **Actual Data Records**: 204176 |
| 20 | - **Duplicate Physical Rows**: 0 |
| 21 | - **Key-dimension null profile**: `AccountId`, `T1_CODE`, `T2_CODE`, `T3_CODE`, and `T4_CODE` were recorded as 0.0% null in the accepted Phase 1B-1 field dictionary. |
| 22 | - **Schema**: Contains 29 columns including dimensions, opening/closing balances, and statement mapping outputs. |
| 23 | |
| 24 | ### source_1404.xlsx |
| 25 | - **Actual Data Records**: 252898 |
| 26 | - **Duplicate Physical Rows**: 0 |
| 27 | - **Key-dimension null profile**: the accepted Phase 1B-1 field dictionary records non-zero null prevalence: `AccountId` 0.2%, `T1_CODE` 2.2%, `T2_CODE` 2.8%, `T3_CODE` 2.4%, and `T4_CODE` 2.4%. These nulls must not be described as zero and must be handled explicitly by any deterministic mapping logic. |
| 28 | - **Schema**: Contains 26 columns. Identifiable structural differences exist compared to 1403 (e.g., column count). |
| 29 | |
| 30 | The presence of a null in an optional dimension does not by itself mean a source row is ineligible for mapping; eligibility depends on the dimensions required by the applicable mapping rule. Coverage metrics below therefore use the full source-row denominator and separately report unmapped/multiple-match outcomes. |
| 31 | |
| 32 | ## 4. Specific High-Value Exception Review |
| 33 | A robust search across all account-code and account-name columns (including `حساب`, `kol`, `KOL_NAME`, `AccountId`, `ACCOUNT_NAME`, `شرح کل`, `T1_NAME`, `T2_NAME`, `T3_NAME`, `T4_NAME`) identified 11 rows related to the closing/offset account **8999** (حساب ترازاختتاميه). |
| 34 | |
| 35 | - **Row Count**: 11 |
| 36 | - **Debit**: 0 ریال |
| 37 | - **Credit**: 0 ریال |
| 38 | - **OPENING Balance**: 0 ریال |
| 39 | - **Gross Exposure (Absolute CLOSING)**: 2,621,766,893,910,080 ریال |
| 40 | - **CLOSING Balance**: 0 ریال |
| 41 | - **FS Balance**: 0 ریال |
| 42 | - **Mapping Status**: Unmapped (No corresponding mapping rule exists in mapping_1404.xlsx) |
| 43 | |
| 44 | Although the net exposure offsets to zero, the gross absolute closing exposure is extremely material (2,621,766,893,910,080 ریال). These offsetting entries must not be dismissed in historical reconciliations. |
| 45 | |
| 46 | ## 5. 1404 Mapping Provenance & Coverage |
| 47 | A deterministic mapping engine was executed linking `mapping_1404.xlsx` to `source_1404.xlsx`. The engine evaluates the `حساب` (Account), `T1_CODE`, `T4_CODE`, and `Current/Capital` dimensions. Exposure calculations use the source workbook fields `Debit`, `Credit`, and `CLOSING` exactly as provided in the ledger (units are in ریال). |
| 48 | |
| 49 | - **Total Source Ledger Data Rows**: 252,898 |
| 50 | - **Rows Eligible for Mapping**: 252,898 |
| 51 | - **Uniquely Mapped Rows**: 214,848 |
| 52 | - **Unmapped Rows**: 143 |
| 53 | - **Multiply Matched Rows**: 37,907 |
| 54 | - **Conflicting Matched Rows**: 37,907 |
| 55 | - **Excluded Rows**: 0 |
| 56 | - **Denominator**: 252,898 |
| 57 | - **PROVEN_MAPPING_COVERAGE**: 99.94% |
| 58 | |
| 59 | ### Unmapped Population Analysis |
| 60 | There are 143 rows that failed to map deterministically due to missing mapping logic for specific dimension combinations. |
| 61 | - **Unmapped Row Count**: 143 |
| 62 | - **Total Debit**: 3,961,800,186,318 ریال |
| 63 | - **Total Credit**: 3,881,433,378,410 ریال |
| 64 | - **Gross / Absolute Exposure (Debit + |Credit|)**: 7,843,233,564,728 ریال |
| 65 | - **CLOSING / Signed Net Exposure**: 196,907,918,801 ریال |
| 66 | - **Financial-Statement-Balance Exposure**: 196,907,918,801 ریال |
| 67 | |
| 68 | #### Ranked Exception Table (Largest Unmapped Accounts by Gross Exposure) |
| 69 | | Account Code | T1 | T4 | Rows | Gross Exposure (ریال) | Net Exposure (ریال) | |
| 70 | |---|---|---|---|---|---| |
| 71 | | 8161 | 117617 | 4512 | 9 | 1,376,000,000,000 | 0 | |
| 72 | | 8161 | 117401 | 4512 | 26 | 1,319,659,150,206 | 57,139,085,409 | |
| 73 | | 8161 | 118701 | 4512 | 11 | 1,256,051,927,394 | 63,510,465,448 | |
| 74 | | 8161 | 117124 | 4512 | 10 | 1,210,721,701,196 | 0 | |
| 75 | | 8161 | 117313 | 4512 | 8 | 1,090,000,000,000 | 0 | |
| 76 | | 8161 | 117001 | 4512 | 5 | 518,970,963,494 | -5,425,842,707 | |
| 77 | | 8161 | 117088 | 4512 | 4 | 307,741,714,522 | 11,365,395,802 | |
| 78 | | 8161 | 117777 | 4512 | 6 | 301,400,000,000 | 0 | |
| 79 | | 8161 | 117488 | 4502 | 22 | 159,965,459,804 | 48,274,392,545 | |
| 80 | | 8161 | 117865 | 4512 | 3 | 128,833,512,752 | 17,044,422,304 | |
| 81 | |
| 82 | ### Proven Lineage Examples |
| 83 | 1. **Simple Account Rule**: `1101 -> Note 6`. Rows with `حساب` 1101 are matched successfully if they don't have conflicting T1/T4 specific rules. |
| 84 | 2. **Composite Rule (8161)**: `حساب` 8161 requires `T1_CODE` and `T4_CODE` to route to correct notes like 19-1 or 12-1. When these dimensions are present, the engine accurately assigns the note. |
| 85 | 3. **Current/Capital Dependent**: Specific accounts branch based on the `جاری / سرمایه ای` string in the ledger matching the mapping condition. |