@davoodmehraban89 / Factor-easy / commits / 7752d2a
Fork 0

سامانه صدور فاکتور و حسابداری

docs: reconcile verified tests and missing production Wave 4 migration

davoodmehraban89 committed Oct 2, 2026 at 13:44 UTC 7752d2a3718ab355d18a804a1e15d9c0bc3aa80e
1 file changed +15 -4
PROJECT_STATE.md
+15 -4
@@ -17,9 +17,9 @@ The latest user message is the sole source of new instructions. Read AGENTS.md t
17 ## Current change ledger
18 | Date | Request / decision | Status | Evidence / next action |
19 |---|---|---|---|
20 -| 2026-10-02 | Latest owner request: verify live main and Supabase, reconcile state before implementation, enforce explicit approval for sensitive database/auth changes and evidence-based slice acceptance. | **RECONCILIATION IN PROGRESS / NO PRODUCT CHANGE** | Baseline main `d70e7d02ecebe5aa75f05b71c0d9a18ad316e7e5`; previous branding merge `5d33b6ea4fb173f6b2e6514c756fc1d122fd2773`. Quality `36991861922`, Security `36991863100`, Release `36992001841`, gated Pages `36992033310` succeeded. Test execution details still under review; no new completion claim. Supabase Finora ACTIVE_HEALTHY, 78 migration history entries, all 18 public tables have RLS; 10 private tables have no client CRUD grants (3 RLS enabled, 7 disabled). Migration history/file version alignment is not exact; full SQL equivalence NOT VERIFIED. No schema/RLS/auth/role/data mutation performed. |
21 -| 2026-10-02 | Branding PR first Quality run exposed a Pages-artifact packaging gap: new icon files were present in source but `scripts/build-pages.mjs` copied only `js` and `vendor`, causing a 404 in hardened Pages smoke. | **MERGED ON MAIN / CI SUCCESS / TEST EVIDENCE REVIEW PENDING** | Pages builder now copies the versioned `assets` directory into `_site`; product/auth logic was not the cause. Merged in `5d33b6ea4fb173f6b2e6514c756fc1d122fd2773`; baseline main Quality `36991861922` succeeded; independent test execution review is tracked in the current reconciliation row. |
22 -| 2026-10-02 | Owner requested product-wide naming change to «نرم‌افزار ERP سازمانی فینورا», a premium redesign of the login screen based on the supplied reference, and replacement of the generated letter favicon/bookmark icon with the supplied Finora F icon. | **MERGED ON MAIN / CI SUCCESS / TEST EVIDENCE REVIEW PENDING** | Browser/bookmark title, application metadata, manifest and visible legacy tagline now use «نرم‌افزار ERP سازمانی فینورا». Added supplied-logo-derived 32px favicon + 180px app/apple icon, real icon in shell branding, and a responsive premium split login with Finora Enterprise visual while preserving every auth contract ID/action. Added static + Real-DOM desktop/mobile regression gates; merged in `5d33b6ea4fb173f6b2e6514c756fc1d122fd2773`, baseline CI/release/deploy succeeded as recorded above; runtime checks remain bounded by actual evidence. |
20 +| 2026-10-02 | Latest owner request: verify live main and Supabase, reconcile state before implementation, enforce explicit approval for sensitive database/auth changes and evidence-based slice acceptance. | **RECONCILIATION RECORDED / WAVE 4 PRODUCTION BLOCKER / NO PRODUCT CHANGE** | Baseline main `d70e7d02ecebe5aa75f05b71c0d9a18ad316e7e5`; previous branding merge `5d33b6ea4fb173f6b2e6514c756fc1d122fd2773`. Quality `36991861922`, Security `36991863100`, Release `36992001841`, gated Pages `36992033310` succeeded. Job `110789670982` logs confirm 49/49 real-DOM tests and accounting phases 2–6 + Golden passed; the seven accounting scripts were also rerun locally at the baseline SHA and passed. DOM tests use controlled fixtures/mocked auth and are not authenticated production E2E. Supabase Finora ACTIVE_HEALTHY, 78 migration history entries, all 18 public tables have RLS; 10 private tables have no client CRUD grants (3 RLS enabled, 7 disabled). 79 repository SQL files versus 78 production migration records; 21 same-name files have different production versions. Wave 4 operational-integrity migration is genuinely absent; details below. Full SQL equivalence of all historical migrations NOT VERIFIED. No schema/RLS/auth/role/data mutation performed. |
21 +| 2026-10-02 | Branding PR first Quality run exposed a Pages-artifact packaging gap: new icon files were present in source but `scripts/build-pages.mjs` copied only `js` and `vendor`, causing a 404 in hardened Pages smoke. | **MERGED ON MAIN / CONTROLLED DOM + ACCOUNTING VERIFIED** | Pages builder now copies the versioned `assets` directory into `_site`; product/auth logic was not the cause. Merged in `5d33b6ea4fb173f6b2e6514c756fc1d122fd2773`; baseline main Quality `36991861922` succeeded; job logs verify 49/49 controlled real-DOM tests and accounting regression gates; production two-user E2E remains NOT VERIFIED. |
22 +| 2026-10-02 | Owner requested product-wide naming change to «نرم‌افزار ERP سازمانی فینورا», a premium redesign of the login screen based on the supplied reference, and replacement of the generated letter favicon/bookmark icon with the supplied Finora F icon. | **MERGED ON MAIN / CONTROLLED DOM + ACCOUNTING VERIFIED** | Browser/bookmark title, application metadata, manifest and visible legacy tagline now use «نرم‌افزار ERP سازمانی فینورا». Added supplied-logo-derived 32px favicon + 180px app/apple icon, real icon in shell branding, and a responsive premium split login with Finora Enterprise visual while preserving every auth contract ID/action. Added static + Real-DOM desktop/mobile regression gates; merged in `5d33b6ea4fb173f6b2e6514c756fc1d122fd2773`, baseline CI/release/deploy succeeded as recorded above; runtime checks remain bounded by actual evidence. |
23 | 2026-10-02 | Owner video confirms the three-scrollbar defect is still visible after PR #35 deployment. | **HOTFIX MERGED / MAIN CI + RELEASE + DEPLOY VERIFIED** | Main `a55933c421eb1ea75a863fadd5d51f3bb29d6b8d` duplicates critical desktop ownership CSS in `index.html` and cache-busts `ui.js` as `20261002-shell-scroll-ownership-v2`. Quality `36985456403` SUCCESS, Security `36985456341` SUCCESS, Release gate `36985769059` SUCCESS and gated Pages `36985796598` SUCCESS. |
24 | 2026-10-02 | Owner reported three desktop vertical scrollbars are attached to the wrong visual edges and requested strict scroll ownership: module rail scrolls only main modules from its right edge; contextual subsystem panel scrolls only its own links from its right edge; workspace scrolls only the active work surface from its right edge. | **MERGED / MAIN CI + RELEASE + DEPLOY VERIFIED** | PR #35 merged as `4a8caf7447ddb5361fe56555a8a6bccc7a733602`. Desktop document scrolling is suppressed; module rail, subsystem links, and workspace are independent viewport-bound scroll owners with physical-right scrollbars while Persian content remains RTL; workspace navigation resets its own scroller; mobile/print retain normal flow. PR retest corrected one test-only mobile overflow expectation. Main Quality `36984349326` SUCCESS, Security `36984349300` SUCCESS, Release gate `36984494858` SUCCESS, gated Pages `36984556741` SUCCESS. |
25 | 2026-10-02 | Wave 5c privileged full backup/restore authorization after offboarding hardening. | **PRESENT ON MAIN / CI SUCCESS / PRODUCTION E2E NOT VERIFIED** | Full organization export/restore now requires both fresh server membership revalidation and existing organization-management authority (owner or `core:configure`); restore performs the check before reading the selected file. Static + Real-DOM denial-path gates added. This is an application-layer privilege boundary over data already readable under server RLS; no new schema/RLS/auth-role change was introduced. |
@@ -84,9 +84,20 @@ Posted accounting history is immutable and balanced; tenant isolation is enforce
84 ## NOT VERIFIED / external boundary
85 Automatic background scheduling for SLA scans; delivery/dispatch consumers for D3c outbox intents; authenticated two-real-user production browser E2E with a persistent legitimate non-owner member; automatic external invitation email delivery; owner-approved accounting cutover; real Persian OCR accuracy/provider; qualified digital signature; physical printer; live external adapters; GitHub Dependency graph/enforceable dependency review; leaked-password protection; PostgreSQL upgrade; CodeQL v4 migration; external BPM/provider integration remain outside verified scope.
86
87 -The connected Supabase production target is `hcsixhqbyuhpshfwqpjx` (`Finora`). Live migration history now includes C8, D1–D4a, request security Waves 1–4, `request_wave4b_scheduler_outbox_delivery` version `20261002072526`, and `identity_wave5a_bootstrap` version `20261002075156`. Read-only production reconciliation after Wave 4b confirmed both scheduler evidence tables, stable destination-command/dead-letter outbox columns, and scheduler/claim/complete/fail/replay RPC contracts exist. Security advisor still reports 3 private C8 tables with RLS but no policies and 20 authenticated-callable SECURITY DEFINER functions; live intent review on 2026-10-02 verified these as deliberate deny-by-default private storage and guarded privileged RPC boundaries, respectively. Leaked-password protection remains disabled.
87 +The connected Supabase production target is `hcsixhqbyuhpshfwqpjx` (`Finora`). Live migration history includes C8, D1–D4a and request security Waves 1–3; the 2026-10-02 reconciliation found Wave 4 operational integrity missing despite later Wave 4b being present. History includes `request_wave4b_scheduler_outbox_delivery` version `20261002072526`, and `identity_wave5a_bootstrap` version `20261002075156`. Read-only production reconciliation after Wave 4b confirmed both scheduler evidence tables, stable destination-command/dead-letter outbox columns, and scheduler/claim/complete/fail/replay RPC contracts exist. Security advisor still reports 3 private C8 tables with RLS but no policies and 20 authenticated-callable SECURITY DEFINER functions; live intent review on 2026-10-02 verified these as deliberate deny-by-default private storage and guarded privileged RPC boundaries, respectively. Leaked-password protection remains disabled.
88 +
89 +## Reconciliation evidence — 2026-10-02
90 +- Request recorded before implementation in commit `cb7f4f0606207077151f5c82801842670a35d90a` on `audit/reconcile-state-20261002`. This slice changes documentation only. No feature, schema, RLS, auth, role or production data mutation was performed.
91 +- Baseline main `d70e7d02ecebe5aa75f05b71c0d9a18ad316e7e5` follows branding merge `5d33b6ea4fb173f6b2e6514c756fc1d122fd2773`. The heartbeat commit changed AGENTS.md without a same-commit PROJECT_STATE.md update; this is a historical continuity-protocol discrepancy, not retroactively corrected history.
92 +- Exact-SHA workflow evidence: Quality `36991861922` (static job `110789670982`: 49/49 real-DOM tests; accounting phases 2–6 and Golden passed); Security `36991863100`; Release gate `36992001841`; gated Pages `36992033310`: all SUCCESS. Logs were inspected, not inferred from workflow color. All seven accounting scripts also passed locally on the baseline; local DOM was NOT RUN (browser/test runtime unavailable). CI DOM fixtures mock auth/data and do not prove live tenant isolation.
93 +- Supabase `hcsixhqbyuhpshfwqpjx`: ACTIVE_HEALTHY, PostgreSQL `17.6.1.166`; 18/18 public tables RLS enabled. Ten private tables have zero effective SELECT/INSERT/UPDATE/DELETE privileges for anon/authenticated; three have RLS, seven do not. Authenticated has private-schema USAGE, anon does not. This inventory does not prove all policy predicates or RPC authorization behavior.
94 +- Advisor recheck: three private C8 no-policy INFO findings, 20 authenticated-callable SECURITY DEFINER WARN findings, leaked-password protection disabled. Previous intent review remains historical evidence; no privileged-function-wide re-audit claimed. References: https://supabase.com/docs/guides/database/database-linter?lint=0008_rls_enabled_no_policy ; https://supabase.com/docs/guides/database/database-linter?lint=0029_authenticated_security_definer_function_executable ; https://supabase.com/docs/guides/auth/password-security#password-strength-and-leaked-password-protection .
95 +- Migration inventory: 79 SQL files / 78 live records; 21 same-name repository files differ in version from production. `20260930222500_iran_enterprise_control_collections.sql` is an intentional no-op placeholder. Duplicate live entries exist for the Wave 1 guard, Wave 2 duplicate-code guard and Wave 3 replay hardening. Do not blindly replay or repair history; full statement equivalence remains NOT VERIFIED.
96 +- **CONFIRMED PRODUCTION DRIFT / APPROVAL REQUIRED:** `supabase/migrations/20261002072000_request_wave4_operational_integrity.sql` has no production history entry. Live pg_proc inventory and full function-body reads show only the six-argument delegation create RPC, no seven-argument idempotent RPC, no duplicate target/action guard in workflow validation, and revoke retries unconditionally append audit events. The archived SQL adds the delegation idempotency column/check/index, seven-argument guarded RPC, duplicate-intent rejection and revoke audit deduplication, and changes EXECUTE grants on old/new signatures. CI disposable database job `110789671195` applied this exact file and passed Wave 4 assertions, but that does not establish production deployment. **Do not apply until the owner explicitly approves these schema/function/grant changes.**
97 +- NOT VERIFIED: authenticated production browser E2E; production accounting writes/reconciliation; complete historical SQL equivalence; full RLS policy adversarial tests in production; Wave 4 production behavior. No new product slice is marked COMPLETED.
98
99 ## Exact next executable work
100 +0. Obtain explicit owner approval for the archived Wave 4 schema/function/EXECUTE-grant migration above. After approval, recheck live main/migration history/function definitions for concurrent changes, apply the reviewed SQL via migration tooling, record the returned production version and reconcile contracts. Any data-writing production tests need a separately safe authorized scope. Current schema/RLS/auth/role changes remain approval-gated.
101 1. Finish Wave 5 offboarding/session-revocation verification on protected main, then execute persistent legitimate non-owner E2E when a second durable test identity is available without weakening tenant/capability checks.
102 2. Keep D4c destination consumers disabled until a real destination adapter enforces `destination_command_key` idempotency and its authorization/audit behavior is adversarially verified; automatic scheduler invocation remains a separate operational verification.
103 3. Resolve remaining platform-security gaps: formalize the three private C8 no-policy contracts, enable leaked-password protection when supported by the connected Auth control surface, and keep Dependency Review marked unavailable until Dependency Graph is enabled.