@davoodmehraban89 / Aram-1 / commits / 1adc900
Fork 0

docs(desktop): specify native EXE pilot scope, real controls and unimplemented finance workflows

davoodmehraban89 committed Oct 30, 2026 at 23:42 UTC 1adc9005123ed87c61dc3ac4bb9769f7ce889766
1 file changed +38
docs/superpowers/specs/2026-10-30-windows-native-desktop-pilot.md new
+38
@@ -0,0 +1,38 @@
1 +# ARAM Windows native Desktop Pilot — safety and acceptance specification
2 +
3 +**Status:** Proposed, [unmerged Draft PR #59](https://github.com/davoodmehraban89/Aram/pull/59), child of unmerged Draft #57 exact head `6b6aca8883ad4902574cbf954d739e1a3bcf3967`; ancestors #56→#55→#54→#53→#52→#51→#50→#26 and initial schema PR #25 also unmerged. Accepted `source-data-cleanup@7dc864fd032f0c4ae4d650d89304a01286a6d914` unchanged.
4 +
5 +## User-authorized product goal
6 +
7 +ARAM must ultimately ship as a **Windows native desktop EXE/installer** for preparing Iranian financial statements, rather than a mobile app, a fake "Coming Soon" template or a browser page merely wrapped by Electron/webview. The previous root `index.html` is quarantined, explicitly NOT approved for real accounting. There was no real GUI to click in audit [Issue #58](https://github.com/davoodmehraban89/Aram/issues/58).
8 +
9 +This focused PR builds the *first real, explicitly limited native window* using the Python standard library Tk/ttk and real existing Gate 2A in-memory XLSX preflight. It is a **candidate shell**, not a technology commitment for final production UX and not a financial application release. Tkinter enables fast, dependable proof of real Windows controls without adding a heavy web runtime or inventing financial reporting behaviors.
10 +
11 +## Actual workflows and affordances
12 +
13 +- Real native RTL-friendly Persian UI: header and visible **UNRELEASED / no accounting approval** banner; tabs **Workbook validation**, **Blocked finance workflows**, **Help**; native File and Help menus.
14 +- Named actions: `file.open`, `file.validate`, `file.clear`, `file.exit`, `help.about`. All have actual callable implementations. File open/validate/clear duplicated as three real native buttons. UI must not display a nonfunctional Apply, Approve, Export or Print button.
15 +- Shortcuts `Ctrl+O`, `Ctrl+R`, `Ctrl+L`, `Ctrl+Q`, `F1`. Validate menu item/button is disabled until a local XLSX is selected; invalid file selection resets selection/result, cancel keeps previous choice; Clear affects GUI state only and never deletes source files.
16 +- Controller accepts only a local existing normal `.xlsx` file (case insensitive) of 1 through 20MiB, explicitly rejects symlinks, and reads at most 20MiB+1, detecting any file that grows after selection. Before invoking openpyxl, inspect ZIP central directory metadata to reject more than 500 entries or 128MiB total uncompressed file-size claims. An invalid/corrupted workbook is passed to existing validator for structured `INVALID_WORKBOOK` issues.
17 +- Call existing `aram_backend.pilot_workbook.preflight_pilot_workbook(content)` completely **in memory**. Display validator issue codes, sheets, rows, fields, severity, messages and total counts. Cap visible detailed rows at 3,000 with explicit disclosure; do not silently hide excess. A success means *structural/contract preflight*, NOT actual financial correctness.
18 +- No database imports, source editing, upload, network, SQL Server requirement for **this pilot**, financial decision, mapping apply, statement generation/export or actual user authorization. All financial workflows beyond preflight displayed as **not implemented**.
19 +- No fabricated account balances, source figures, dates, review identities or approval stamps.
20 +
21 +## Test and Windows artifact contract
22 +
23 +1. Unit tests in `backend/tests/test_desktop_pilot.py` cover actual original file-byte SHA stability, controlled file selection, size/mimetype/path/symlink handling, invalid XLSX structured errors, stale-result reset on file change/removal, state clear without deletion, ZIP metadata limits, five action bindings and headless `self_test`. All test workbooks are ephemeral generated bytes, **never** real customer inputs.
24 +2. Actual Windows GitHub Actions workflow added as `.github/workflows/desktop-windows-ci.yml` with Windows x64 Python 3.12, `pytest tests/test_desktop_pilot.py`, PyInstaller onefile `AramPilot-UNRELEASED.exe`, frozen EXE `--self-test`, and frozen EXE `--ui-smoke`.
25 +3. `--ui-smoke` instantiates a real Tk window and programmatically invokes **every new button and menu action** (both File and Help), cycles all three notebook tabs and checks keyboard mappings, enablement, selection, results and exit. The file picker and message box are injected with synthetic, controlled implementations to avoid OS modal prompts in unattended CI. This is real **Tk callback invocation**, NOT pixel-level mouse testing, keyboard accessibility or acceptance of financial workflows.
26 +4. Upload unsigned Windows executable **only as a short-retention (7-day), clearly UNRELEASED workflow artifact**; not a release, tag, accepted binary, code-signing evidence or production installer. No EXE/ZIP binary committed to repo. Confirm artifact SHA, successful exact-head run and clean Windows VM/SmartScreen inspection before making any distribution claim.
27 +5. Existing Linux backend CI must remain green on exact final candidate head; Alembic 01→02→03→04 and reverse downgrade pass on disposable DB, compileall passes. PR diff only scoped allowed files; original accepted branch must not move. Independent C1/C2/C3 review and finance owner sign-off still required.
28 +
29 +## Limitations and next real implementation work
30 +
31 +- Excel validation is synchronous, large permitted workbooks may block GUI for a period; future worker/progress and cancel must be tested before production use.
32 +- Tk's built-in RTL and number formatting support is limited; verify Persian accounting tables and mixed-direction digits, accessibility, DPI scaling, focus order and Windows screen-reader support. Decide independently between richer Qt/PySide6 and Tk after prototype usability testing; **do not conflate this first GUI with a final design-system choice**.
33 +- Review input ZIP-bomb caps (declared sizes are not a sandbox); large workbooks may need streaming validated worker isolation.
34 +- Missing real enterprise IdP, user session, company/year state, account explorer, source ingest, Mapping Studio, note/subnote hierarchy, BS/IS/CF/EQ generation, reconciliation, immutable review decision, atomic CAS, Excel direct-write bypass closure, PDF/XLSX output, backups, signed Windows installer, restore and update path. **No finance approve/apply control in this candidate**.
35 +- No full physical mouse traversal, visual QA, high DPI/RTL or clean Windows install verified by source tests alone. The earlier UI QA audit had *zero* clickable controls because the only HTML was a quarantine notice; this PR introduces a small new set and must be re-audited.
36 +- SQL Server/Postgres and financial Gate 3 provider-specific controls still pending, as are parent PR merges and migration conflict reconciliation.
37 +
38 +**Acceptance remains blocked:** no formal Gate 3 user acceptance, release, production EXE, corporate deployment or qualification. Draft PR #59 must not be merged merely due green CI.