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

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

Synced Dec 4, 05:30 UTC

arena/094f314c-aram
add-index-html-10623938925177053894 arena/094f314c-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 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 15.6 KB

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: 46253c94405abd065dfc5e8cf080b295cb83cde4 — squash merge of PR #96, merged 2026-12-03T15:22:02Z (owner final acceptance).
  • Release tag v1.0.0 points to 46253c94405abd065dfc5e8cf080b295cb83cde4 (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 in docs/booklet/MANIFEST.json.

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.yml removed (ADR-028). Recoverable from history at 46253c9; the named experiment/browser-edition branch is an owner action (Arena single-branch constraint).
  • الف‌2 (persistent core main): VERIFIED — domain/{controls,money,hierarchy,formula,normalization} + statement_api/admin_api on stored LedgerBalance is 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.md consistent 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 in docs/discrepancies.json with 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.

Known gaps feeding the C-phases (honest residual risks)

  • Authorization is forgeable (independent review, 2026-12-03): roles derive from a client-supplied actor string in the request body, not a token/session; "actor":"admin" grants admin to anyone who reaches the API. Most endpoints (company create, ledger upload, mapping, export) are unguarded; with no users seeded, year approval is open to all. Loopback-only binding limits exposure on a single-user machine but this is serious on a server/shared machine and contradicts booklet 1 §13. pilot_api.py also exposes 17 unauthenticated routes. → C8 (token/session auth + role guards + audit on every write; fail-closed).
  • frontend/src/lib/format.ts uses Number(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 → C3 (wire all controls into run_controls + approval gate; ERROR year unapprovable).
  • Desktop install bypasses Alembic (desktop.py:62 Base.metadata.create_all); existing user DBs will not migrate on update → C9 (replace with alembic upgrade head + migration round-trip test on an existing DB).
  • 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: npm ci --no-audit, coverage gate not 80/90, services mypy non-strict (C9).
  • Backup unencrypted; no DPAPI vault / plugin allowlist / SBOM yet (C8/C9).
  • Browser edition removed (C0); single reference UI = React workbench, developed in C7. Backend static/pilot legacy retained until C8.
  • Windows EXE not built; clean-machine install log + Shadow Run two-company + owner signature pending (C9/C10).
  • docs/discrepancies.json now 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 (969f608 vs merged babe829), and it merged without independent review under a one-time owner waiver. Historical; cannot be un-merged. Booklet 2 الف‌4/الف‌5 now enforced in AGENTS.md for 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).

Control documents