سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 15:45 UTC
docs(phase0): begin evidence-based phase acceptance and open-PR audit (#88)
* docs(phase0): register owner-requested acceptance verification before execution * docs(phase0): open evidence-based acceptance register and audit stale PRs * docs(phase0): record verified acceptance scan and nine PR dispositions * docs(phase0): record read-only live login/selector/print asset reachability * docs(phase0): note asset reachability and initial green PR gates
davoodmehraban89 committed
Oct 12, 2026 at 09:41 UTC
5c2a5bf263f7a3bfe5a6b2e99cba5c8e5443db04
2 files changed
+87
PROJECT_STATE.md
+19
@@ -259,3 +259,22 @@ Owner reports login blocked with generic 'check internet/VPN' network error on l
259
- Same-SHA protected `main` `a3c7dac165d1c451c635546eecff47e0aaaf562e`: Quality **`38203171552` SUCCESS**, Security **`38203171658` SUCCESS**, Release gate **`38203282658` SUCCESS**, gated Pages **`38203309936` SUCCESS**. Duplicated Release `38203264704` cancelled and Pages `38203301879` skipped; neither counted as successful evidence. Deployment is verified at the GitHub Actions boundary, not owner-authenticated browser/runtime/ISP.
260
- Classification: F0-05 **IMPLEMENTED / CONTROLLED_QA_PASSED / RELEASED regression coverage**. **AUTHENTICATED_E2E_PASSED and OWNER_ACCEPTED remain UNVERIFIED** for real account catalog, desktop performance and live tenant RLS; Phase 0 remains **OPEN** due to F0-01/F0-02/F0-03/F0-04 and the remaining cross-role/print/UI gates. Security advisor findings 21 SECURITY DEFINER, 3 C8 no-policy and disabled leaked-password protection remain review-only/open (no changes made).
261
- This is a documentation-only closing note, no change to release assets or database behavior. Next safest action: continue remaining independent read-only Phase 0 checks, then perform legitimate owner-authenticated login/catalog/print smoke without credentials in chat; avoid production financial postings. Rollback of the regression/test slice is PR #86 revert if needed.
262
+
263
+
264
+## 2026-10-12 Phase 0 acceptance execution kickoff — OWNER REQUESTED / IN PROGRESS
265
+- **Instruction:** Owner explicitly requests beginning phase acceptance now ("تایید فاز رو استارت بزن"). This starts acceptance verification of approved **Phase 0**, **not** automatic acceptance or promotion of any later phase. Accountable owner: QA/Validation; coordinating manager handles integration.
266
+- **Verified baseline at initiation:** protected `main` SHA `601a5b7b066ce4cf7e68fad2abe642c3e846cdd3`; same-SHA GitHub Quality `38203575835`, Security `38203575840`, Release `38203689209`, gated Pages `38203706432` all SUCCESS. Supabase `hcsixhqbyuhpshfwqpjx` ACTIVE_HEALTHY. No claim of owner-authenticated production proof from these CI gates.
267
+- **Authorized bounded first slice:** inspect existing Phase 0 acceptance evidence; audit open historical PRs against current main **read-only** to prevent stale fixes; create a test/evidence-based acceptance register and categorize each F0-01..F0-08 as controlled-QA-only, awaiting real user session, or blocked. Read-only live HTTP/JS smoke if accessible; document and run any zero-mutation test suitable for available tools. Use reviewable documentation-only branch/PR, verify CI and update this ledger with final evidence.
268
+- **Not authorized / out of scope:** creating users, entering owner credentials, changing Auth/RLS/schema/roles, posting/reversing production ledger, destructive test data or financial history, merging stale PRs, paid services or declaring Phase 0/V1 accepted without authenticated owner checks and explicit acceptance.
269
+- **Currently known open gates:** `F0-01` affected-ISP sign-in, `F0-02` existing tenant product/contact lookup, `F0-03` real safe-scoped server persistence, `F0-04` actual saved-invoice PDF/print; `F0-05` synthetic 1,208/1,206 Chromium regression green and deployed, but owner-authenticated test unverified; `F0-06` full UI review, `F0-07` tenant/roles security, `F0-08` PR audit pending. **Phase 0 = OPEN / ACCEPTANCE CHECKS STARTED**.
270
+- **Exit:** concrete `docs/FINORA_PHASE0_ACCEPTANCE_REGISTER_2026-10-12.md`, verified open-PR disposition, linked CI/risks/blockers and explicit next safe action. Rollback: revert docs-only PR; no runtime or database rollback needed.
271
+
272
+
273
+### 2026-10-12 Phase 0 acceptance evidence + F0-08 first read-only audit — DOCUMENTED / NOT PHASE ACCEPTED
274
+- Branch `qa/phase0-acceptance-start-20261012` created from protected main `601a5b7b066ce4cf7e68fad2abe642c3e846cdd3`; after the owner request was recorded above, created `docs/FINORA_PHASE0_ACCEPTANCE_REGISTER_2026-10-12.md` containing the F0-01..F0-08 gate matrix and owner-safe smoke protocol. This is documentation and review evidence only.
275
+- Exact baseline GitHub Quality `38203575835` SUCCESS (static job `114662032710`: syntax 55 JS / 52 MJS, Golden accounting, **83/83 Chromium PASS** and 3 disposable DB jobs); Security `38203575840`, Release `38203689209`, Pages `38203706432` all SUCCESS. Remote Desktop Commander online; authorized device read-only PowerShell GET `factoreasy.ir` returned HTTP **200**, no authenticated business verification.
276
+- Supabase project `hcsixhqbyuhpshfwqpjx` healthy with 81 migrations (latest `20261011174445 posted_source_idempotency_index`); advisors 21 SECURITY DEFINER WARN / 3 private RLS-no-policy INFO / 1 leaked-password WARN, not proven vulnerabilities. Live phone-identity migration `20261007165208` has no corresponding archive file on current main; proposed migration file remains in stale PR #58. No database changes performed.
277
+- F0-08 first independent scan: **9** open GitHub PRs, all diverged from main. Preliminary buckets: old documentation probably superseded #28/#43/#49; UI inspection required #39/#40/#57; sensitive financial/identity manual review #6/#58/#80. None merged or closed; no user/security/finance changes. Owner-authenticated sign-in F0-01, real tenant search F0-02, real safe-scope invoice save F0-03, real printing F0-04, true access F0-07 remain NOT VERIFIED. F0-05 controlled product/person 1,200+ stress PASS but full real context open.
278
+- **Status:** acceptance started and register independently read back; PHASE 0 OPEN, NOT OWNER-ACCEPTED. Next: review acceptance documentation PR with exact-head CI; then collect approved existing-user login/catalog/print test evidence, addressing actual reproducible bugs before phase signoff. Rollback: docs-only PR revert.
279
+
280
+- **Additional Phase 0 live asset check:** On authorized remote PC, separate read-only HTTP GETs returned 200 for deployed `js/login-connectivity.js`, `js/ux-hardening-r2.js`, and `js/print.js`; this does not establish exact cache-version parity, real sign-in, tenant catalog, invoice data or printer acceptance. The acceptance register records this evidence. PR #88 initial head Quality `38211055354` and Security `38211055404` **SUCCESS**; later head must rerun gates after this documentation update. No runtime/DB/auth/financial changes.
docs/FINORA_PHASE0_ACCEPTANCE_REGISTER_2026-10-12.md
new
+68
@@ -0,0 +1,68 @@
1
+# Finora Phase 0 — Acceptance register and first verified checkpoint
2
+
3
+**Date:** 2026-10-12 · **Accountable lead:** QA / Validation · **Authority:** Owner: «تایید فاز رو استارت بزن»
4
+**Approval state:** **ACCEPTANCE STARTED / PHASE 0 OPEN / NOT OWNER-ACCEPTED**.
5
+**Scope:** approved eight-phase roadmap, Phase 0 F0-01–F0-08. This document does **not** accept Phase 0 or authorize security/finance writes.
6
+
7
+## 1. Live pinned baseline
8
+
9
+- Canonical repository: `davoodmehraban89/Factor-easy`; protected pre-checkpoint `main` = `601a5b7b066ce4cf7e68fad2abe642c3e846cdd3`.
10
+- Same-SHA GitHub Quality [38203575835](https://github.com/davoodmehraban89/Factor-easy/actions/runs/38203575835), Security [38203575840](https://github.com/davoodmehraban89/Factor-easy/actions/runs/38203575840), Release gate [38203689209](https://github.com/davoodmehraban89/Factor-easy/actions/runs/38203689209), gated Pages [38203706432](https://github.com/davoodmehraban89/Factor-easy/actions/runs/38203706432): all **SUCCESS**; cancelled/skipped duplicate runs excluded.
11
+- Re-read real Quality static job `114662032710`: 55 JS/52 MJS syntax passed; financial/Golden invariants passed; **83/83 Playwright Chromium passed (55.7s)**, including F0-03 invoice mock-server persistence, F0-05 1,208-product and 1,206-contact synthetic fixture. Three disposable DB jobs succeeded. These are not customer production E2E evidence.
12
+- Remote authorized device `DESKTOP-71SJ63M`: read-only PowerShell `Invoke-WebRequest` to `https://factoreasy.ir/?phase0_acceptance=20261012` returned **HTTP 200**. No session, login, tenant data, JS version identity, save, or printing was verified by this HTTP-only check. Separate read-only HTTP GETs returned **200** for `js/login-connectivity.js`, `js/ux-hardening-r2.js` and `js/print.js` on the same device. This checks asset reachability only; it does **not** verify cache-version identity, authenticated operations or actual print output.
13
+- Live Supabase project `hcsixhqbyuhpshfwqpjx` **ACTIVE_HEALTHY**; **81** migrations; newest `20261011174445 posted_source_idempotency_index`. Read-only advisor counts: [21 authenticated SECURITY DEFINER function warnings](https://supabase.com/docs/guides/database/database-linter?lint=0029_authenticated_security_definer_function_executable), [3 private-table RLS-no-policy informational findings](https://supabase.com/docs/guides/database/database-linter?lint=0008_rls_enabled_no_policy), [1 leaked-password-protection warning](https://supabase.com/docs/guides/auth/password-security#password-strength-and-leaked-password-protection). These are **review inputs**, not 25 proven vulnerabilities.
14
+- Reconciliation risk: live migration `20261007165208 phone_identity_profile` is present on production but its archive file `supabase/migrations/20261007163500_phone_identity_profile.sql` is **absent from current main**, and exists in stale open PR #58. Treat as migration/source drift for supervised analysis in Phase 1; **do not rerun or cherry-pick** that migration automatically.
15
+
16
+## 2. Acceptance gate matrix
17
+
18
+Status definitions: **CONTROLLED QA PASS** = actual Chromium or isolated tests with synthetic/mock data; **VERIFIED READ-ONLY** = live read-only metadata/HTTP observation; **UNVERIFIED** = required authentication/real tenant/printer scope not tested. No check becomes **OWNER-ACCEPTED** without direct evidence and explicit owner decision.
19
+
20
+| ID | Priority | Current evidence | Acceptance status | Required next proof / owner |
21
+|---|---|---|---|---|
22
+| **F0-01** · Login/affected ISP | Production HTTP 200, historical synthetic Auth probes | **UNVERIFIED real user** / P0 open | Existing authorized login and refresh from affected ISP; browser/time/error screenshot with secrets redacted. QA/Auth. |
23
+| **F0-02** · Real product & person selection | PR #83 merged; keyboard/F2 and synthetic matching in Chromium | **CONTROLLED QA PASS; live tenant UNVERIFIED** / P0 open | Select existing `هارد` or `بلوک` and person in authorized tenant; correct unit/price/company boundary; no cross-tenant leak. UX/Data. |
24
+| **F0-03** · Invoice lifecycle | `scripts/phase0-invoice-persistence.spec.js` passes **2/2** on mock RPC: save→reload→edit→print, retry without duplication; no ledger posting | **CONTROLLED QA PASS; real persistence UNVERIFIED** / P0 open | Only separately approved isolated account/test scope: actual server save/reload/edit/print and reconcile duplicate count; never post fake accounting in production. Commerce/QA. |
25
+| **F0-04** · Print | PR #71 Persian print and controlled browser evidence | **CONTROLLED QA PASS; real printer/invoice UNVERIFIED** / P0 open | Authorized pre-existing saved invoice, formal/non-formal/purchase/taxpayer PDF/print; line totals/dates/pagination and physical-printer differences. Print QA. |
26
+| **F0-05** · Large selectors | `scripts/phase0-selector-stress.spec.js`, **1,208 synthetic products + 1,206 persons** passed 2/2; keyboard/Persian/metadata covered | **CONTROLLED QA PASS for products/persons; real catalog and other high-volume selectors UNVERIFIED** / P1 open | Owner tenant/real workstation test plus assess account/project/contract selectors where applicable; measure interactive latency. UX/Perf. |
27
+| **F0-06** · Modal, keyboard, RTL, themes | Controlled modal/dashboard regression and keyboard/F2, Quality suite green | **CONTROLLED QA PARTIAL; full visual/flow acceptance UNVERIFIED** / P1 open | Owner screenshots, all critical save/delete/import/export and RTL scrolling/dark-light. UI/QA. |
28
+| **F0-07** · Access and release safety | GitHub Security PASS; Supabase 21+3+1 advisor results | **VERIFIED READ-ONLY metadata; dual-user tenant/RLS proof UNVERIFIED** / P0 open | Independent role/tenant negative E2E with authorized second identity, strict no-write safe plan; formal Phase 1 security audit. Security. |
29
+| **F0-08** · Stale PR reconciliation | **9** live open PRs audited against current main; all `diverged` from main | **Read-only preliminary disposition RECORDED; no PR integrated** / P1 open | Review below and safely disposition PRs with owner/context; never merge stale sensitive code automatically. Coordination. |
30
+
31
+### Exit decision
32
+
33
+**PHASE 0 = OPEN.** P0 authenticated gates F0-01/02/03/04/07 have not met acceptance conditions. Passing CI, successful public HTTP and the existence of functional modules are insufficient for final Phase 0 signoff. Retain open items; no false `AUTHENTICATED_E2E_PASSED` or `OWNER_ACCEPTED` labels.
34
+
35
+## 3. Read-only audit of nine historical open PRs (F0-08)
36
+
37
+All nine PR heads **diverge** from current main (observed GitHub compare); therefore do **not** batch-merge or assume their old CI validates current code. Classification is a preliminary disposition, not permission to close or overwrite them.
38
+
39
+| PR | Classification | Evidence / safe next action |
40
+|---|---|---|
41
+| [#6](https://github.com/davoodmehraban89/Factor-easy/pull/6) — accounting recovery | **Sensitive finance — manual audit** | 26 files, 872 additions, 851 main commits behind; journal, reversal and posted history. Reproduce missing behavior in isolated fixtures and compare to current invariant tests; no automatic merge. |
42
+| [#28](https://github.com/davoodmehraban89/Factor-easy/pull/28) — Wave 4b QA docs | **Likely superseded documentation — confirm** | Old PR-only ledger/evidence, 173 behind; current PROJECT_STATE already holds newer acceptance records. Confirm any unique evidence before archive/close. |
43
+| [#39](https://github.com/davoodmehraban89/Factor-easy/pull/39) — scrollbar-side change | **UI issue needs fresh browser evidence** | 164 behind; shares files with #40 and current `js/ui.js`. Compare physical scroll ownership against owner screenshot before selective fix. |
44
+| [#40](https://github.com/davoodmehraban89/Factor-easy/pull/40) — structural scrollports | **UI issue needs fresh browser evidence** | 164 behind; overlapping alternative to #39; do not merge both. Verify actual RTL behavior first. |
45
+| [#43](https://github.com/davoodmehraban89/Factor-easy/pull/43) — execution heartbeat | **Likely superseded documentation — confirm** | 162 behind; current AGENTS.md already defines checkpoint heartbeat. Check distinct wording before archive/close. |
46
+| [#49](https://github.com/davoodmehraban89/Factor-easy/pull/49) — old state reconciliation | **Likely superseded documentation — confirm** | 157 behind; PROJECT_STATE now records October 12 protected-main checks. Historical note may be retained in Git history, not auto-merged. |
47
+| [#57](https://github.com/davoodmehraban89/Factor-easy/pull/57) — dark contrast | **UX regression — fresh visual audit** | 150 behind; old hardening script overlaps recent changes. Check dark mode live screenshots and relevant selectors, port only proven missing fix if needed. |
48
+| [#58](https://github.com/davoodmehraban89/Factor-easy/pull/58) — phone Auth / user mgmt | **High-risk identity + schema drift — manual security audit** | 142 behind, 14 files including Edge and SQL; prod has phone migration but main lacks archive. Never reapply migration, re-enable function or elevate auth on this evidence. |
49
+| [#80](https://github.com/davoodmehraban89/Factor-easy/pull/80) — admin provisioning | **High-risk identity — explicit gate** | 64 behind, 8 files and server auth function. Contract demands JWT/role negative tests and authorized test identity; no account creation or publish without separate approval. |
50
+
51
+**F0-08 preliminary finding:** 3 probable superseded docs (#28/#43/#49); 3 UI candidates needing fresh visual proof (#39/#40/#57); 3 sensitive finance/identity candidates (#6/#58/#80). Do not equate this classification with tested equivalence or final PR closure.
52
+
53
+## 4. First owner-authenticated acceptance script (safe)
54
+
55
+1. In the user's **existing** browser/ISP, sign in normally to `https://factoreasy.ir/`; record **PASS/FAIL**, local clock, browser and whether refresh works. **Do not send passwords, access tokens, cookies or recovery codes.**
56
+2. On the existing company, open sale/purchase invoice and type a known existing product such as `هارد` or `بلوک`; verify suggestions, keyboard Enter, product price/unit, person selection. **Do not save/post** a production test invoice.
57
+3. Choose an already saved document, inspect print preview/PDF, Persian digits, date and totals; share only a redacted observation or screenshot. **No financial modification.**
58
+4. Creating/editing a disposable invoice against real Supabase requires an explicitly isolated authorized test company and signoff to write test records. Testing permission boundaries requires a separately authorized second account and safe test plan. Neither has been implicitly approved.
59
+
60
+## 5. Next independent execution
61
+
62
+- QA: capture owner-context PASS/FAIL for F0-01, then F0-02 and F0-04; investigate reproducible defect before patch.
63
+- Coordination: resolve #39/#40/#57 UI visual differences under F0-06 without unreviewed old merges.
64
+- Security: audit #58/#80 and source/migration drift read-only; no auth/schema/RLS/role changes until separately approved.
65
+- Commerce: prepare F0-03 isolated real-server evidence only after scope and permission are confirmed.
66
+- Phase acceptance requires full evidence and explicit owner approval. **No phase promotion now.**
67
+
68
+**Rollback:** revert this documentation PR; no runtime, customer data, migrations, credentials, roles, accounting entries or production workflow modified.