Mirrored from https://github.com/davoodmehraban89/Aram.git
Synced Dec 4, 10:30 UTC
arena/2d4eda07-aram
Aram Project Status
Canonical status entry point. Update this file in every meaningful pull request. Always fetch the live accepted-branch head before acting; a committed snapshot is not a substitute for GitHub remote evidence.
Repository baseline
- Repository: davoodmehraban89/Aram
- Accepted branch:
source-data-cleanup - Live accepted head:
f2e6da5e7ade3c851584008d590c588894d4c9c3— squash merge of PR #97, merged 2026-12-04T07:25:29Z under a one-time owner waiver (preconditions verified: OPEN, head1e247083,mergeable_state=clean). Previous head46253c9(PR #96) is preserved by tagv1.0.0. - Release tag
v1.0.0points to46253c94405abd065dfc5e8cf080b295cb83cde4(owner-authorized, created pre-mission). The implementation author does not tag (§19); no further tagging without owner directive. - Post-merge CI on the accepted head: Backend CI #47137691800 ✅ and Frontend CI #47137691857 ✅.
- Product objective: a controlled, auditable accounting and financial-statement workflow that preserves canonical source data.
- Authoritative work orders: booklet 1 v1.0 (
docs/booklet/BOOKLET_v1.0.md, ADR-025) and booklet 2 v2.0 (docs/booklet/BOOKLET_v2.0.md, ADR-027 — course correction + general-platform architecture; supersedes conflicting parts of booklet 1). Integrity anchored by SHA-256 indocs/booklet/MANIFEST.json. Governing now: booklet 2.1 (owner message 2026-12-04; no markdown copy is committed because the agent holds no byte-exact original — the owner's text is authoritative, seeMANIFEST.json). It closes only the remaining gaps and takes precedence over booklets 2 and 1, whose other sections stay valid. Work is split into R1…R6, one PR each, ≤1,500 lines excluding tests/data; security/control defects may not be deferred.
Status vocabulary
| State | Meaning |
|---|---|
| VERIFIED_AND_MERGED | Present on the accepted branch with Git evidence. |
| IN_PROGRESS | Work is in an open PR and is not accepted. |
| NOT_IMPLEMENTED | Required capability is absent. |
| BLOCKED | Work cannot proceed until the recorded blocker is resolved. |
Accepted state — booklet Phases 0–9 (all MERGED via PR #96)
All Phase 0–9 work below is VERIFIED_AND_MERGED on source-data-cleanup at head 46253c9 (squash of PR #96). Evidence is the merged head plus post-merge CI; per-commit references are the pre-squash implementation history on arena/094f314c-aram.
| Phase / capability | State | Evidence |
|---|---|---|
| Phase 0 debts D-01..D-07, D-10..D-12 (LedgerBalance, controls C-01..04, rial money, code/header normalization, source store, immutability+audit+reopen, hierarchy, inspection guards, CI gates) | VERIFIED_AND_MERGED | head 46253c9; ADR-012/013/014/016/017 |
| Phase 1 statements + drill-down | VERIFIED_AND_MERGED | head 46253c9; ADR-018 |
| Phase 2 mapping import/export | VERIFIED_AND_MERGED | head 46253c9; ADR-019 |
| Phase 3 note formula engine (AST, no eval) | VERIFIED_AND_MERGED | head 46253c9; ADR-020 |
| Phase 4 golden comparison (1403+1404) | VERIFIED_AND_MERGED | head 46253c9; ADR-021 |
| Phase 5 RTL React workbench + Playwright | VERIFIED_AND_MERGED | head 46253c9; Frontend CI #47137691857 |
| Phase 6 reviewable outputs (XLSX+JSON, exact rial + lineage) | VERIFIED_AND_MERGED | head 46253c9; ADR-022 |
| Phase 7 users/audit/reopen/backup (roles, PBKDF2, migration 07) | VERIFIED_AND_MERGED | head 46253c9; ADR-023 |
| Phase 8 offline desktop packaging (loopback entrypoint + PyInstaller recipe) | VERIFIED_AND_MERGED | head 46253c9; ADR-024; no binary committed (§19) |
Phase 9 UAT + release prep (scripts/uat_real_data.py) |
VERIFIED_AND_MERGED | head 46253c9; UAT evidence below |
| Review fixes: approve role gate, note/mapping edit/delete endpoints, NotesManager UI, python-multipart ADR | VERIFIED_AND_MERGED | head 46253c9; docs/reviews/BOOKLET_COMPLIANCE_REVIEW.md |
| D-08 status/log refresh | VERIFIED_AND_MERGED (this B0 PR) | this entry |
| D-09 git-history rewrite | BLOCKED | owner-only; requires explicit owner directive (§19); tracked in B12 |
Test/quality evidence at the accepted head: backend 319 tests passed (full local suite); Backend CI #47137691800 green (SQLite + PostgreSQL migration round-trips, ruff, mypy domain-strict + services, coverage, pip-audit); Frontend CI #47137691857 green (eslint, tsc, vitest, build, Playwright). No canonical data/ or samples/ file changed.
Historical control events (reference)
Earlier accepted control events remain part of history: PR #1/#4/#6/#8/#10/#12/#13/#15/#18/#19/#20/#21 (see docs/PROJECT_LOG.md). Closed-unmerged candidates PR #7/#9/#16/#17 were never accepted and are reference only. The stale "V1-01 IN_PROGRESS" and "VERIFIED_BUT_UNMERGED" phase rows from prior snapshots are superseded: that work is now merged in PR #96.
Active mission — booklet 2 course correction + C0…C10 roadmap
Booklet 2 v2.0 («اصلاح مسیر و معماری نهایی Aram», docs/booklet/BOOKLET_v2.0.md, ADR-027; appendix revised by owner 2026-12-03 — positioning + Host Integration API + accepted elements, ADR-029) supersedes the conflicting parts of booklet 1 and the earlier B0…B12 framing; it defines the governing roadmap C0…C10 + optional C11 below. Positioning: Aram is an independent, pluggable financial-statement preparation/control/audit engine with a Host Integration API (REST + permissions) for future embedding; government systems (مودیان/IMED/trade), bank-invoice processing, form builder/cartable are rejected scope; messenger bots for financial data prohibited (ADR-029). One focused PR per phase task, ≤ ~1,500 changed lines excluding tests/generated data (الف5); PR body must match git diff --stat + real head (الف4). Executor only; independent reviewer separate; no "done" without evidence (§19). Ambiguities closed via booklet 2 §14 (default + proof + ADR, OD-01..OD-14), never by querying the owner. data/ + samples/ read-only with before/after tree-hash evidence per PR. No merge, no tag, no runtime network, no company-specific code (§16).
| Phase | Scope (summary) | State |
|---|---|---|
| C0 | Course correction (بخش الف): browser-edition removal (الف1, ADR-028); persistent core is main path (الف2); phase 0/1 + golden 1404 verified (الف3); PR honesty/size rules (الف4/5); docs/PR_TRIAGE.md (الف6); exit criteria (الف7); booklet 1+2 references |
IN_PROGRESS (this PR) |
| C1 | Real vertical slice: 1404 ledger → LedgerBalance → C-01/C-02 → mapping → BS/IS → official reconciliation; golden green or diffs documented | NOT_IMPLEMENTED (core largely merged; re-verify on new model) |
| C2 | Mapping + notes (booklet 1 phases 2–3) | NOT_IMPLEMENTED |
| C3 | Four statements BS/IS/EQ/CF + all controls C-01..C-15 + two-year comparison + 1403 | NOT_IMPLEMENTED |
| C4 | Connector framework + FileConnector: plugin model, manifest, Conformance Suite, Adapter, snapshot + reconciliation | NOT_IMPLEMENTED |
| C5 | DB Connector: SQLite/PostgreSQL then SQL Server (OD-09 revised: pyodbc-first, python-tds fallback — ADR-029), test DB in CI, read-only source user | NOT_IMPLEMENTED |
| C6 | Data packs + generalization: template/mapping packs; "second synthetic company" CI proof (ب1/ب8); document level only after C6 (OD-12) | NOT_IMPLEMENTED |
| C7 | Full UI + outputs (booklet 1 phases 5–6 on new model): exact-rial Persian UI, PDF/XLSX; work center; print templates w/ letterhead + statutory ledgers (روزنامه/کل); Ctrl+K search; group dashboard; Host Integration API surface (ADR-029) | NOT_IMPLEMENTED |
| C8 | Security + audit (booklet 1 phase 7 + ب10): pilot API auth, Argon2id, DPAPI vault, encrypted backup, plugin allowlist; multi-layer access (module←company←year←row/field); source-drift detection → «نیازمند بازبینی»; dry-run; nightly document audit C-16+ (optional, post-C6) | NOT_IMPLEMENTED |
| C9 | Packaging + deployment (booklet 1 phase 8 + SBOM/signing): offline Windows, CI gates, large-file manifest; signed updates w/ auto-rollback + in-app backup/restore; Windows drift service | NOT_IMPLEMENTED |
| C10 | Acceptance: Shadow Run on a real period of two companies + owner signature | NOT_IMPLEMENTED |
| C11 | AI assistant (optional, OFF by default): understands questions only, never generates numbers — figures only from engine + approved CalculationRun with lineage; read-only, local/anonymized, audited (ADR-029) | NOT_IMPLEMENTED (optional) |
C0 progress (بخش الف)
- الف1 (browser removal): DONE —
webapp/,docs/{app.js,index.html,bridge.py,styles.css,py,vendor},scripts/build_webapp.py,.github/workflows/pilot-pages.ymlremoved (ADR-028). Recoverable from history at46253c9; the namedexperiment/browser-editionbranch is an owner action (Arena single-branch constraint). - الف2 (persistent core main): VERIFIED —
domain/{controls,money,hierarchy,formula,normalization}+statement_api/admin_apion storedLedgerBalanceis the product path; legacy in-memory pilot (pilot_engine/store/api/editing,static/pilot) retained as logic reference, secured in C8 then retired; exception-queue persistence tracked in C4. - الف3 (phase 0/1 + golden 1404): VERIFIED merged at
46253c9— D-01..D-12,test_golden.py/test_domain_controls.py/test_approval_gate.py; real-1404 UAT evidence below. - الف4/الف5 (PR honesty/size): rules added to
AGENTS.md; this PR body matches the diff. - الف6 (PR triage): DONE —
docs/PR_TRIAGE.md(ADOPT #81/#89/#92; CLOSE NO-GO #82/#88; SUPERSEDED #90/#91 + #22–#80 backlog). - الف7 (exit criteria): MET — CI green at accepted head;
PROJECT_STATUS.mdconsistent with head; golden 1404 freshly re-run (golden.compare_year): 28 comparisons, 9 matched, 19 differences (BS 9/16, IS 0/6, EQ 0/0, CF 0/6), all 19 recorded one-by-one indocs/discrepancies.jsonwith cause + reproducible evidence (16 caused: 8 presentation-sign flips with exact magnitude, note-number reuse, absent/undderived CF notes; 3 under investigation = IS notes 6/8/9, treated as bugs until proven, D1). EQ official sheet yields 0 extractable note rows (C3 parsing gap, recorded). Real-1404 approval remains blocked by C-01/C-03/C-04 (fail-loud, correct). - Appendix revision (owner, 2026-12-03 second message): Databan catalog studied by owner (marketing, unverified; agent has no site access); positioning + Host Integration API recorded (ADR-029); OD-09 revised to pyodbc-first (python-tds fallback); accepted elements mapped to C4–C9/C11; C11 added (optional AI assistant, OFF by default, never generates numbers); rejected scope binding; booklet 2 markdown re-anchored (revision history in
MANIFEST.json).
Phase 9 UAT evidence (real source_1404.xlsx, read-only)
python scripts/uat_real_data.py --year 1404 on a fresh local DB:
- Import: 131,280 raw rows preserved (4 anomalous rows skipped + reported).
- Auto-mapping from embedded note numbers: 22 notes, 244 mappings.
- Build: BS/IS/CF/EQ persisted; 1 unmapped ordinary account surfaced.
- Golden reconciliation: core balance-sheet notes match official rial-for-rial (÷10⁶ half-up): 10→673,740,637 · 11→242,194 · 12-1→13,386,398 · 12-2→8,310,168 · 13→6,839,535 · 14→11,273,650 · 15→19,951,136 (plus zero notes 17-1/17-2). Remaining BS/IS differences are surfaced as discrepancies (OD-08), never silently corrected; B8 records them one-by-one in docs/discrepancies.json.
- Approval gate: correctly blocks on real-data control failures (C-01/C-03/C-04) — fail-loud, no bypass.
- Export: XLSX (6.27 MB) + JSON with 158,050 lineage rows (file/SHA-256/sheet/row).
- Backup: created + verified (hashes + audit chain); audit chain valid.
Booklet 2.1 — R-task progress
| Task | Scope | Status |
|---|---|---|
| R1 | Real authentication (backend + frontend), backup confinement, desktop launch token, legacy surfaces | MET (this PR; evidence below) |
| R2 | Controls C-05..C-15 wired into run_controls + approval |
NOT_STARTED |
| R3 | build_statements vs official; (statement, note) aggregation; IS 6/8/9 root cause; EQ/CF parsing |
NOT_STARTED |
| R4 | Remove create_all from the production path; backup → alembic upgrade head → trigger check |
NOT_STARTED |
| R5 | docs/c01_exceptions.json — the six C-01 source rows, unapprovable until resolved |
NOT_STARTED |
| R6 | Propose marking the v1.0.0 Release as pre-release; experiment/browser-edition = owner action |
NOT_STARTED |
R1 acceptance ← evidence
All R1 criteria are met; the full «معیار پذیرش ← شاهد» table is in the R1 PR report.
Witnesses: the 33 tests in backend/tests/test_auth_r1.py, the frontend vitest suite,
and frontend/e2e/session.spec.ts (CI starts uvicorn on a migrated throwaway DB with
ARAM_E2E_BACKEND=1). Migration 20261204_08 verified on a populated copy: 131,280
ledger rows, 2 users, 28 triggers unchanged.
Backend 354 passed (was 319); frontend 15 vitest tests / 5 files; ruff, mypy, tsc, eslint all clean.
Known gaps feeding the C-phases (honest residual risks)
- Authorization forgeability — CLOSED in R1 (2026-12-04, ADR-030). Was: roles derived from a client-supplied
actorbody string;"actor":"admin"granted admin to anyone; most endpoints unguarded; approval open when no users existed;pilot_api.pyexposed 17 unauthenticated routes. Now:actorremoved from every request model; identity comes only fromcurrent_userresolving a 256-bit bearer token whose SHA-256 is stored server-side (8-hour absolute TTL, logout, 5-attempt lockout for 15 minutes, PBKDF2 600,000); every route except/health,/auth/login,/auth/launchand the one-time first-admin bootstrap requires a session, reads included; approval without users is impossible; the pilot router and the legacy/UI are out of the app; backupdestis confined to the data folder; the desktop launcher gates the local API with a one-time token. Evidence:backend/tests/test_auth_r1.py(33 tests). Remaining C8 scope: DPAPI vault, encrypted backup, plugin allowlist, row/field-level access layers. frontend/src/lib/format.tsusesNumber(value)(float risk) (C7).- Only 4 of 15 controls implemented (
domain/controls.py= C-01..C-04); approval depends only on these, so a year with an unbalanced BS or note/statement mismatch can be approved. C-05..C-15 absent → R2 (booklet 2.1; was C3): wire all ERROR controls intorun_controls+ approval gate; a control lacking inputs must report «اجرا نشد: دلیل» and block approval. - Desktop install bypasses Alembic (
desktop.pyBase.metadata.create_all); existing user DBs will not migrate on update → R4 (booklet 2.1; was C9). R1 added migration20261204_08and verified it on a copy of a populated database (131,280 ledger rows, 2 users, 28 triggers unchanged), but the startup path still usescreate_all. - ImportRun/CalculationRun/LineageEdge/Adjustment/UnknownAccountQueue/carried_from_year_id/calculation_run_id refs absent; pilot exception queue not persisted in
domain/(C1/C4). note_engine.acct()is closing-only; statement_balance-only rows evaluate 0 in notes (C1/C3).- No connector framework / Source Adapter / snapshot reconciliation / packs yet; generality grep test pending (C4/C5/C6).
- CI: prod-dependency
npm audit --omit=dev --audit-level=moderategate + initial frontend coverage gate (thresholds lines/statements 30, branches 70, functions 40 vs measured 33.97/72.97/42.85) + repo-wide pre-commit/secret-gate/Dependabot added by the 2026-12-04 tooling PR (frontend coverage + audit in Frontend CI;Repo Hygieneworkflow runs pre-commit + detect-secrets baseline gate on every PR). Dev-only advisories in the vitest/vite chain (tinypool ×2 critical, vite high, esbuild/@vitest/mocker/vite-node moderate — none shipped; prod audit clean) await a dedicated vitest+vite major-upgrade task. The 80/90 frontend coverage target and services-mypy strictness remain open (C9). - Backup unencrypted; no DPAPI vault / plugin allowlist / SBOM yet (C8/C9).
- Browser edition removed (C0); single reference UI = React workbench. Backend
static/pilotfiles remain in the tree but are no longer served or mounted (R1); the pilot router keeps thecurrent_userdependency and is exercised only by a test-only app. - Windows EXE not built; clean-machine install log + Shadow Run two-company + owner signature pending (C9/C10).
docs/discrepancies.jsonnow records all 19 golden-1404 differences with cause+evidence (الف7 met); 3 IS magnitude mismatches remain under investigation (bugs until proven, D1) and build-vs-official comparison is added in C3.- PR-discipline violation recorded (independent review): merged PR #96 bundled all 10 phases in one PR (154 files, +24,327 lines ≈ 16× the الف5 cap), its body cited a stale head (
969f608vs mergedbabe829), and it merged without independent review under a one-time owner waiver. Historical; cannot be un-merged. Booklet 2 الف4/الف5 now enforced inAGENTS.mdfor all future PRs. - Booklet 1 markdown is a token-reversal PDF extraction (ADR-025): RTL/English-code artifacts possible; the original PDF SHA-256 is the authoritative anchor. A faithful re-extraction awaits a docx original or a better bidi method (owner option).
Release procedure (owner)
The implementation author does not merge or tag (§19 / booklet 2 §16). Tag v1.0.0 already exists on 46253c9 (owner-authorized pre-mission). After C0…C9 acceptance, prepare the release checklist here (owner tags, retained artifact, clean-machine offline install log, SBOM/signing); final acceptance is C10: Shadow Run on a real period of two companies + owner signature (booklet 2 §15). Do not tag. Git-history rewrite / large-file external migration stays BLOCKED absent an explicit owner directive (C9).