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

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

Synced Dec 4, 15:30 UTC

arena/2d4eda07-aram
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/checkout-7 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/globals-17.15.0 dependabot/npm_and_yarn/frontend/vite-8.4.0 dependabot/npm_and_yarn/frontend/vitest-5.1.2 dependabot/npm_and_yarn/frontend/vitest/coverage-v8-5.1.2 dependabot/pip/backend/mypy-gte-1.13-and-lt-3 dependabot/pip/backend/pytest-cov-gte-6.0-and-lt-8 dependabot/pip/backend/setuptools-gte-75-and-lt-85 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
md 134 lines 6.99 KB
Rendered Raw
1 # Booklet v1.0 — Deep Compliance Review (5 reviewer passes)
2
3 - Date: 2026-12-03
4 - Branch: `arena/094f314c-aram` · PR: [#96](https://github.com/davoodmehraban89/Aram/pull/96) (ready for review)
5 - Method: five distinct reviewer roles, each with a concrete mandate, executed
6 against the code/tests/CI with real evidence. This is a single author running
7 five structured passes (not five independent models); findings are reproducible
8 from the commands below. The independent GitHub reviewer remains the acceptance
9 authority (§19 — author does not merge).
10
11 ## Agent 1 — Financial integrity & source sanctity
12
13 Mandate: P-02 exact money, rial-for-rial reconciliation, sign convention, source
14 sacred, drill-down lineage, discrepancies never invented, codes as text.
15
16 Checks & evidence:
17 - `domain/money.py`: `Rial.process_bind_param` rejects `float` (TypeError),
18 fractional rial (ValueError), non-finite (ValueError); BIGINT scale-0; rounding
19 (`round_half_up`/`allocate_remainder`) is display-only. `test_domain_money.py`
20 includes the P-02 no-silent-rounding guards.
21 - Exhaustive probe (ADR-012): 457,074 rows across both ledgers, **0 fractional rial**.
22 - `git diff --name-only <base> HEAD -- data/ samples/` → **empty** (source untouched).
23 - Golden reconciliation (UAT, real source_1404): core BS notes match official
24 rial-for-rial (10/11/12-1/12-2/13/14/15); other differences surfaced as
25 discrepancies (OD-08), never silently corrected.
26 - Drill-down: `drill_down` returns file/SHA-256/sheet/row per account; UAT exported
27 158,050 lineage rows.
28
29 Verdict: **PASS**. No defect found.
30
31 ## Agent 2 — Architecture & layering
32
33 Mandate: domain←services←api←ui direction, raw rows + compute-layer aggregation
34 (D3/P-01), approval runs all controls (D5/C-03), no eval, generic, editable.
35
36 Checks & evidence:
37 - `grep` domain imports → no services/api/models/fastapi upward imports.
38 - `grep` services imports → no api/fastapi imports.
39 - `ledger_import` stores one raw `LedgerBalance` per source row; aggregation lives
40 in `ledger_aggregate`/`statement_build` (compute layer).
41 - `domain/formula.py` + `note_engine.py`: AST tokenizer (`re.compile`), **no
42 eval/exec**; cycle detection.
43 - No company-specific logic in domain/services (`grep` for gas/company names).
44 - **Finding F2-1 (FIXED):** notes/mappings/rows had only CREATE endpoints; the
45 owner requires editable codes/accounts/notes/subnotes. Added PUT/DELETE for
46 notes, mappings, note rows + GET list endpoints, Draft-guarded, D-07 → HTTP 409,
47 note-delete refuses while referenced (rows cascade). `test_editing.py` (9 tests)
48 incl. locked-year edit refusal; UI `NotesManager` wired.
49
50 Verdict: **PASS after F2-1 fix**.
51
52 ## Agent 3 — Security, audit & immutability
53
54 Mandate: hash-chained append-only audit, locked-year immutability, controlled
55 reopen, users/roles (no plaintext), role gates, backup integrity, zero network.
56
57 Checks & evidence:
58 - `db_triggers`: locked-year insert/update/delete guards + audit append-only +
59 fiscal-year transition (SQLite & PostgreSQL); `test_immutability.py` passes.
60 - `audit.verify_chain` recomputes the SHA-256 chain; tamper tests pass.
61 - Reopen requires an approved `ReopenRequest` (ORM guard + DB trigger re-check).
62 - `users.py`: PBKDF2-HMAC-SHA256 200k rounds + per-user salt, `hmac.compare_digest`,
63 no plaintext; `grep` for hardcoded secrets → none.
64 - `backup.py`: online SQLite snapshot + source-store copy + SHA-256 manifest +
65 chain re-verification; tamper/non-empty-dest/broken-chain refused.
66 - `grep` backend src for requests/httpx/urllib/socket → **no outbound network**;
67 desktop binds 127.0.0.1 only.
68 - **Finding F3-1 (FIXED):** API `/approve` was not role-gated while `/lock` and
69 `/reopen` were. Now requires reviewer/admin once users exist (bootstrap/dev
70 open); the C-01..C-04 ERROR gate always applies. +2 tests.
71
72 Verdict: **PASS after F3-1 fix**.
73
74 ## Agent 4 — Testing, CI & quality
75
76 Mandate: full suite green, negative tests, mypy/ruff, frontend gates, Playwright,
77 migration round-trips, coverage, no faked green.
78
79 Checks & evidence:
80 - `cd backend && pytest` → **319 passed** (after review fixes).
81 - `mypy` domain strict + services → clean; `ruff check`/`format` → clean.
82 - Frontend `eslint`/`tsc`/`vitest`/`build` → pass; Playwright smoke + workflow specs.
83 - `grep` pytest skip/xfail → only `skipif` conditional on canonical-data presence
84 (runs in CI where data exists); no unconditional skips faking green. The e2e
85 workflow spec is backend-gated by design (frontend-only CI stays green).
86 - Migrations 20261203_05/06/07 up/down/up verified (SQLite); PostgreSQL via CI matrix.
87 - CI (head `969f608`): Backend [47101026519] ✅, Frontend [47101026555] ✅. Review
88 fixes re-run CI on the new head.
89
90 Verdict: **PASS**.
91
92 ## Agent 5 — Booklet process & deliverables
93
94 Mandate: §15 phase order, §17 autonomous defaults+ADR, §19 bans, §0 status/log,
95 ADRs, §18 report, reproducible packaging, no committed binaries.
96
97 Checks & evidence:
98 - Phases 0–9 present in §15 order; PROJECT_STATUS + PROJECT_LOG updated.
99 - ADRs 012–024 present (015 reserved/unused; not a compliance gap).
100 - §19: no source edits; no self-merge (PR ready, not merged); no bypassed controls;
101 no runtime network; no secrets; no NEW root analytical doc (PROJECT_STATUS.md is
102 the existing canonical status file required by §0).
103 - **Finding F5-1 (FIXED):** `python-multipart` runtime dep (FastAPI uploads) now
104 documented in ADR-018.
105 - **Observation O5-1 (owner decision):** vendored `.whl` files (~250KB+18KB,
106 duplicated in `docs/vendor` and `webapp/vendor`) were committed in the earlier
107 **pilot** commit `2fce09d`, not the booklet work. They are small offline
108 dependencies for the browser edition, not large binaries; a strict §19 reading
109 flags ZIP-like artifacts. Left intact because they back the accepted pilot
110 deliverable; the owner may split the pilot browser edition into a separate PR.
111 - Packaging: `packaging/aram.spec` + `build_desktop.py` reproducible; **no EXE/ZIP
112 committed**; tag `v1.0.0` is the owner's post-acceptance action.
113 - §18 report delivered (base/branch/head/PR, tests, CI URLs, artifact NONE,
114 source-unchanged, risks, "Ready for independent GitHub review; not merged.").
115
116 Verdict: **PASS after F5-1 fix; O5-1 noted for owner**.
117
118 ## Findings summary
119
120 | ID | Severity | Status | Resolution |
121 |---|---|---|---|
122 | F2-1 editable notes/mappings/rows | High | Fixed | PUT/DELETE + list endpoints, Draft-guarded, 9 tests, UI manager |
123 | F3-1 approve role gate | Medium | Fixed | reviewer/admin gate when users exist, 2 tests |
124 | F5-1 python-multipart ADR | Low | Fixed | documented in ADR-018 |
125 | O5-1 pilot vendored wheels | Info | Noted | pre-existing pilot artifact; owner may split PR |
126
127 ## Overall verdict
128
129 All five reviewer passes **PASS** after the fixes above. Backend 319 tests green,
130 mypy/ruff clean, frontend gates green, CI green, source data unchanged. The work is
131 complete and booklet-compliant to the extent verifiable without the owner's
132 accounting judgment on the surfaced real-data discrepancies (OD-08).
133
134 **Ready for independent GitHub review; not merged.**