سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 4, 03:00 UTC
ux-scroll-ownership-20261002
PROJECT STATE — FINORA / FACTOR-EASY
MANDATORY CONTINUITY FILE — READ THIS FIRST
Repository:
davoodmehraban89/Factor-easy· Canonical branch:main· Product: Finora 1.0
Read AGENTS.md first, then this file. Latest user chat is the only source of new instructions; repo files are continuity/context. Detailed older history remains available in Git history and the verification documents listed below.
Protocol / authority
Verify live GitHub + Supabase before acting; implement/test/fix/retest/commit/verify in bounded vertical slices; archive exact production SQL; never call unrun work verified. The owner has repeatedly directed autonomous roadmap execution without routine confirmation pauses and has authorized normal in-scope GitHub/Supabase work. Keep five specialist workstreams under one coordinator: Architecture & Requirements, Implementation, UX/UI, QA & Verification, Security & Release. Use real subagents only when the environment provides them; otherwise execute those responsibilities directly without claiming parallel agents.
This is high-assurance accounting/ERP software. Posted financial history, tenant isolation, migration safety, traceability, reconciliation and rollback are mandatory. Do not create billable resources; development/verification must stay on zero-cost/free-tier paths. Destructive financial-history changes, unapproved external costs, public/external messaging and sensitive access changes remain safety boundaries.
Current change ledger
| Date | Request / decision | Status | Evidence / next action |
|---|---|---|---|
| 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. | IMPLEMENTED ON BRANCH / CI PENDING | Desktop document scrolling is suppressed; module rail, subsystem links, and workspace are independent viewport-bound scroll owners. Each scroll container uses LTR only for physical scrollbar placement while direct content is restored to RTL. Workspace navigation resets the workspace scroller instead of the document. Mobile/print retain normal RTL flow. Real-DOM regression added for direction, overflow ownership, independent scroll movement, and absence of desktop document scrolling. |
| 2026-10-02 | Wave 5c privileged full backup/restore authorization after offboarding hardening. | IMPLEMENTED ON BRANCH / CI PENDING | 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. |
| 2026-10-02 | Supabase security-advisor intent review for authenticated-callable SECURITY DEFINER RPCs and three private C8 no-policy tables. | LIVE INTENT REVIEW VERIFIED / NO DDL REQUIRED | Production hcsixhqbyuhpshfwqpjx reviewed read-only. All 20 public advisor-listed SECURITY DEFINER functions use search_path='' and enforce caller/admin/org/capability/read-scope checks appropriate to their RPC contract; warning is retained as an intentional privileged-RPC boundary rather than weakened. The three private C8 tables have RLS enabled, zero policies, and no anon/authenticated CRUD grants, confirming deliberate deny-by-default private storage behind controlled RPCs. Evidence: docs/SECURITY_ADVISOR_INTENT_REVIEW_2026-10-02.md. Leaked-password protection remains an external Auth-setting gap. |
| 2026-10-02 | Wave 5b offboarding/revocation client fail-closed remediation from Round 29. | MERGED / MAIN CI + RELEASE + DEPLOY VERIFIED | PR #32 merged as e9831e4d23fceae3a30359fe2eca8743087bb6b5. Main Quality 36982398280 SUCCESS, Security 36982398238 SUCCESS, Release gate 36982548804 SUCCESS, gated Pages 36982584408 SUCCESS. Added 30s + visibility membership revalidation, known-revocation tenant-memory/cache purge, stale currentUser removal, sensitive-view lock, alternate-org recovery path, no-membership sign-out, and fresh server membership gate before bulk export. Persistent two-real-user production E2E and capability-specific privileged export authorization remain NOT VERIFIED. |
| 2026-10-02 | Permanent project constraint: user operates from Iran and cannot use paid infrastructure, paid APIs, international-card billing, or services that require a later paid upgrade for essential operation. Railway is excluded from Finora runtime/deployment. | ACTIVE ARCHITECTURE CONSTRAINT | Use only genuinely no-cost capabilities for required operation; do not create paid resources or make Finora depend on a service whose essential path later requires billing. GitHub + Supabase remain current sources of truth; any future infrastructure choice must pass this zero-cost/no-billing constraint first. |
| 2026-10-02 | Gmail/GitHub failure review: latest Wave 5a Quality run failed only because the disposable PostgreSQL harness lacked Supabase roles anon/authenticated; Security latest run is green. |
TEST HARNESS VERIFIED | Added the two no-login Supabase compatibility roles to the disposable identity DB bootstrap. Wave 5a identity DB gate passed on PR head and main Quality 36980655736; the earlier failure was harness-only. |
| 2026-10-02 | Second CI retest showed the safety-check regex itself was over-escaped. | REGEX FIX VERIFIED | Normalized regex literals to match the workflow labels/variable gate exactly; main Security 36980655725 passed Release/QA safety + CodeQL. |
| 2026-10-02 | CI retest exposed a literal \\n introduced while editing the release-safety checker. |
TEST SYNTAX FIX VERIFIED | Replaced the escaped text with a real newline; subsequent PR and main security checks passed. |
| 2026-10-02 | Release-safety invariant initially rejected the explicit Dependency Graph availability gate. | TEST CONTRACT VERIFIED | Safety checker requires both properties: Dependency Review is conditional on DEPENDENCY_GRAPH_ENABLED=true, and remains fail-closed whenever enabled; main Security 36980655725 succeeded. |
| 2026-10-02 | Wave 5a identity/signup/invitation bootstrap remediation (WS-01, F-121/F-122 and OTP bootstrap boundary). | MERGED / PRODUCTION + CI VERIFIED | PR #30 merged as cfd15dcf51cf8b9085a5512ded497fe0363ae322. Main Quality 36980655736 SUCCESS including identity disposable-DB + static/Real-DOM gates; Security 36980655725 SUCCESS. Production migration 20261002075156 identity_wave5a_bootstrap applied to hcsixhqbyuhpshfwqpjx; live reconciliation confirms search_path='', organization-bound trial creation, trigger present, licenses_without_org=0, duplicate organization licenses=0 and orphan memberships=0. Persistent two-real-user production E2E and offboarding cache/session purge remain NOT VERIFIED. |
| 2026-10-02 | PR #29 exposed that Dependency Review now fails hard when GitHub Dependency Graph is disabled. | CI BOUNDARY VERIFIED | Security workflow runs Dependency Review only when repository variable DEPENDENCY_GRAPH_ENABLED=true; when enabled the action remains fail-closed. Main Security 36980655725 passed Release/QA safety + CodeQL; Dependency Review was skipped because the graph remains unavailable. |
| 2026-10-02 | Owner granted standing approval to continue in-scope project work without repeated confirmation. | WAVE 4B PRODUCTION APPLIED + VERIFIED | Supabase production hcsixhqbyuhpshfwqpjx recorded request_wave4b_scheduler_outbox_delivery as migration version 20261002072526. Read-only reconciliation confirmed scheduler tables, outbox delivery columns, and all five Wave 4b RPC contracts exist. GitHub main 41aff95d11a66c67e2c64df3eac11a122f94dfd7: Quality 36975968198, Security 36975968108, Release Gate 36976087514, Deploy 36976115600 succeeded. Automatic external scheduling and D4c destination consumers remain NOT VERIFIED. |
| 2026-10-02 | Wave 4b first disposable-DB run exposed an ambiguous PL/pgSQL test variable in the final replay assertion. | TEST FIX APPLIED / RETEST PENDING | Product migration executed through all scheduler/outbox assertions; failure was confined to the final test query where local variable k shadowed temp-table column k. Renamed/qualified the assertion; no production permission or state-machine rollback. |
| 2026-10-02 | Owner said «ادامه بده» after Wave 4 F-420/F-421/F-422 merge. | IMPLEMENTED ON BRANCH / CI PENDING | Added server-clock five-minute scheduler slots, durable run/claim evidence, replay binding, skip-locked overdue claims, stable outbox destination command identity, lease claims, retry/backoff, dead-letter and idempotent authorized replay. D4c destination consumers remain disabled. Production migration is NOT APPLIED pending the schema-change gate. |
| 2026-10-02 | Owner supplied environment/connection handoff and directed it to be enforced while continuing work. | LIVE RECONCILED / ACTIVE OPERATING CONTEXT | Verified GitHub target davoodmehraban89/Factor-easy with admin/read-write access, canonical main, and Supabase target hcsixhqbyuhpshfwqpjx = Finora / ACTIVE_HEALTHY. GitHub + Supabase remain source of truth; Gmail/Notion are optional support only, and Railway/Render are not deployment truth unless a later explicit project decision makes them so. Detected concurrent branch advancement during Wave 4 and refused a non-fast-forward overwrite; re-read the newer head before continuing. |
| 2026-10-02 | Wave 4 remediation F-420/F-421/F-422 from canonical audit register. | IMPLEMENTED ON BRANCH / NOT YET VERIFIED | F-420 rejects duplicate normalized onApproved target/action identities; F-421 binds SLA editor values to logical step keys across reorder/remove/key-edit; F-422 adds actor-scoped delegation idempotency, explicit overlap rejection and revoke retry audit dedupe. Disposable-DB + Real-DOM gates added. CI/merge/production remain NOT VERIFIED at this checkpoint. |
| 2026-10-02 | Owner supplied the current remediation/audit package plus manual GitHub QA workflow and directed continuation of both roadmap execution and defect remediation. | F-412 + WAVE 3 F-415/F-416 VERIFIED / PRODUCTION RECONCILED | PR #23 merged as d13498f3af03f544c05168727b440f053de1d733. Main Quality 36973781026 SUCCESS including disposable D1 DB adversarial tests; Security 36973781055 SUCCESS (Release/QA safety + CodeQL; PR Dependency Review remains externally blocked by disabled Dependency Graph); Release gate 36973927530 SUCCESS; gated Pages 36973959986 SUCCESS. Production migrations 20261002063121 request_wave2_duplicate_code_guard and 20261002063123 request_wave3_decision_idempotency applied. Read-only production reconciliation: duplicate legacy code groups=0; replay actor binding, reauthorization and immutable event-outcome reconstruction are present. Next: Wave 4 F-420/F-421/F-422; D4c consumers remain disabled. |
| 2026-10-02 | Owner directed immediate continuation after observing execution delay. | D4A IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + REAL-DOM + ACCOUNTING + SECURITY VERIFIED | PR #21 merged as 4583703396a7ddb00bdad76b52c22932d634cbef. Main Quality 36961361891 SUCCESS (38/38 real-DOM, accounting phases 2–6 + Golden, D1/C8 DB); Security 36961361897 SUCCESS; Release gate 36961459328 SUCCESS; gated Pages 36961492170 SUCCESS. Production migration 20261002034311 request_workflow_d4a_work_queue reconciled. Evidence: docs/REQUEST_WORKFLOW_D4A_VERIFICATION.md. |
| 2026-10-02 | Wave 2 request integrity remediation F-411/F-413/F-414/F-417/F-418. | IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + REAL-DOM + ACCOUNTING + SECURITY VERIFIED | Squash merge 7346910638b6ef9555d4adb5952dd62c8f4c130d from PR #19. PR Quality 36937247798: DB jobs SUCCESS and 37/37 real-DOM tests passed; accounting phases + Golden journey passed. PR Security 36937247803: required Release/QA invariants + CodeQL SUCCESS (Dependency review remains the documented external graph boundary). Main Quality 36937448157 SUCCESS; Security 36937448101 SUCCESS; exact-SHA Release gate 36937598497 SUCCESS; gated Pages 36937616201 SUCCESS. Production migration recorded as 20261001225044 request_wave2_integrity_hardening; live validator negative controls and function-contract checks passed. |
| 2026-10-02 | Live Supabase target hcsixhqbyuhpshfwqpjx became available to the connector; owner directed immediate continuation. |
WAVE 1 PRODUCTION RECONCILED / WAVE 2 STARTED | Production migration history and live request_transition_instance definitions were inspected read-only. F-409/F-410 guard is present in production; next slice is F-411/F-413/F-414/F-417/F-418 with server validation, form-runtime fidelity, idempotency binding, active/latest-version enforcement and schema-bound conditions. |
| 2026-10-02 | Owner completed the GitHub Protect main ruleset and directed autonomous continuation to fully remediate the audited defects. |
ACTIVE — REMEDIATION CONTINUATION | Ruleset 24334764 verified ACTIVE on default branch with deletion + non-fast-forward protection, PR-only updates, strict required checks static-quality, Release and QA safety invariants, and CodeQL JavaScript; bypass list empty. Continue Wave 1/2 request integrity work. |
| 2026-10-01 | Owner authorized starting the canonical remediation pack after external full-system audit. | WAVE 0 CLOSED | Release/QA fail-open paths, exact-SHA promotion and Pages deployment ordering are now verified by positive and negative controls above. |
| 2026-10-01 | Owner said «ادامه بده» after D3a handoff. | D3B + D3C VERIFIED | D3b visual editor/conditions/timeline and D3c SLA/delegation/outbox are production + disposable-DB + real-DOM verified. Remediation audit supersedes roadmap ordering. |
| 2026-10-01 | Slice D3c — SLA/escalation, delegation/substitution, transactional outbox. | IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + REAL-DOM + CI VERIFIED | js/request-workflow-d3c.js; migrations 20261001235500, 20261002000500, 20261002001000; Quality run 36917772952 all three jobs SUCCESS. Evidence: docs/REQUEST_WORKFLOW_D3C_VERIFICATION.md. |
| 2026-10-01 | Slice D3b — visual workflow editor + conditions + timeline. | IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + REAL-DOM + CI VERIFIED | js/request-workflow-d3b.js; migration 20261001233000; bounded predicate DSL, skipped-step evidence and authorized timeline RPC. Quality run 36915696611 all three jobs SUCCESS. Evidence: docs/REQUEST_WORKFLOW_D3B_VERIFICATION.md. |
| 2026-10-01 | Slice D3a — sequential/parallel request workflow runtime. | IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + CI VERIFIED | Migrations 20261001230000, 20261001230500; private step/vote runtime, quorum semantics, capability checks, idempotent decisions and immutable evidence. Quality run 36913565943 all three jobs SUCCESS. |
| 2026-10-01 | Slice D2 — request UI/read-model + legacy cutover. | IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + REAL-DOM + CI VERIFIED | js/request-workflow-d2.js; migrations 20261001223500, 20261001224500; Quality run 36912668369 all three jobs SUCCESS. Legacy source records remain preserved and imported rows traceable. |
| 2026-10-01 | Slice D1 — requests/BPMS-lite server foundation. | IMPLEMENTED / PRODUCTION + DISPOSABLE-DB + CI VERIFIED | Migrations 20261001204500, 20261001205500, 20261001210500, 20261001211500; Quality run 36910187257 all three jobs SUCCESS. |
| 2026-10-01 | Office Slice C8 workflow policy/runtime. | IMPLEMENTED / PRODUCTION + ADVERSARIAL + CONCURRENCY + REAL-DOM + SECURITY VERIFIED | Immutable workflow evidence, pinned policy versions, capability-gated transitions, optimistic revision checks, idempotency, private runtime tables and SECURITY INVOKER public wrappers. |
| 2026-10-01 | Owner reconfirmed autonomous GitHub + Supabase execution and free-tier-only development. | ACTIVE OPERATING DIRECTIVE | No repeated routine approval requests; no paid development resource. Preserve safety/cost boundaries. |
| 2026-10-01 | Live QA: commerce/tax IDs/request builder/personnel/license/floating-detail coding. | PARTIALLY IMPLEMENTED / FOLLOW-UPS OPEN | Kardex/tax-ID/request/profile/license/floating-code work landed. Exact Taxpayer-System print layout owner reference is now available and has regression coverage. |
| 2026-09-30—2026-10-01 | Office C1–C7, ELI-1–ELI-4, Slice A/B and accounting phases 1–6. | VERIFIED WITH DOCUMENTED BOUNDARIES | See required evidence; do not redo completed phases without verified regression evidence. |
| 2026-09-30 | Iran-first high-assurance ERP expansion. | IN PROGRESS — BROADER ROADMAP | docs/IRAN_COMPLIANCE_MATRIX_V1.md; do not claim statutory consolidation/full tax submission/full HR/CRM until lifecycle/accounting/permissions/tests exist. |
Wave 0 checkpoint — CLOSED 2026-10-02
- Manual QA no longer uses
continue-on-error; live/all require credentials; live credential-bearing runs reject non-allowlisted origins before secrets are injected into the test step; authenticated browser origin is rechecked before/after login/navigation; menu click errors are no longer swallowed and each navigated item must change observable UI state. - QA evidence retention reduced to 3 days and screenshots changed to failure-only.
- Security dependency review no longer uses
continue-on-error. Security runsscripts/release-safety-check.mjsto prevent regression of Wave 0 code contracts. - Exact-SHA
Release gaterequires successful Quality + Security for the same SHA and explicitly checksstatic-quality,c8-policy-database, andd1-request-databasebefore promotion. - Historical reproduction: Pages run
36922017645for SHA6b529647...completed before Quality/Security, proving the old branch-deploy path was unsafe. - Negative control after
Protect main+ Pages source change: failing SHA03561a33...on PR #15 failedstatic-quality; merge was rejected; no Release gate or gated Pages deployment existed for that SHA. - Positive control on protected main SHA
150ff54d938a45b9a9b476f3a4a8fdabbb45d065: Quality36932956964SUCCESS; Security36932956877SUCCESS; Release gate36933115365SUCCESS;Deploy gated Pages36933151878SUCCESS. The earlier Pages trigger36933134567was skipped, as designed, and no legacy dynamic branch deployment ran. - Wave 0 findings F-402/F-403/F-406/F-407/F-423/F-424 are closed at the verified GitHub/repository boundary.
Implemented foundations
- Accounting phases 1–6: accepted high-assurance accounting foundation; posted history remains immutable and balanced.
- Slice A/B + ELI-1–4: modular entitlements, tenant/RBAC, seats, delegated admin, reusable roles, secure invitations and organization UX.
- Office C1–C8: registration/read evidence, referrals, archive/classification, numbering/templates, approvals/SLA, OCR provenance boundary and versioned correspondence workflow runtime.
- Requests D1/D2: independent versioned request definitions/forms/workflows, pinned versions, idempotent create/transition, immutable evidence, server authorization, server-backed UI/read model and non-destructive legacy cutover.
- Requests D3a: ordered sequential/parallel approval steps, quorum voting, per-step capability authorization and private runtime state.
- Requests D3b: visual ordered-step editor, bounded server condition predicates, skipped-step evidence and authorized runtime timeline.
- Requests D3c: step SLA/deadline/escalation evidence, explicit time-bounded delegation with provenance, and transactional approved-request outbox intents.
Invariants
Posted accounting history is immutable and balanced; tenant isolation is enforced at the data boundary; commercial entitlement and member authorization are independent; UI hiding is never security; expired licenses are read-only; office numbering is server-atomic; private scans remain private; seat/company limits are server-enforced; delegated customer admins cannot mutate commercial license entitlements; invitation acceptance is authenticated/email-bound/seat-safe; raw invitation tokens are never persisted or audited; organization-unit parents cannot cross tenants or form cycles. Request type/workflow versions are immutable snapshots; request instances pin both versions; runtime mutation is server-authorized, idempotency/revision guarded and append-only evidence is retained. D2 legacy import is non-destructive/idempotent/traceable. D3a votes require distinct actors for parallel quorum. D3b conditions are bounded server-validated predicates and skipped results remain evidence. D3c delegation never impersonates the source actor, source capability is revalidated, SLA escalation appends evidence, and approved cross-module effects are queued transactionally rather than directly executed. Request workflow state never replaces C1 registration or C5 correspondence approval evidence.
Required evidence
docs/PHASE_1_REDESIGN_VERIFICATION.md through docs/PHASE_6_VERIFICATION.md · docs/PHASE_6_CUTOVER_MANIFEST.md · docs/PRODUCTION_ACCOUNTING_CUTOVER_READINESS_2026-09-30.md · docs/IRAN_COMPLIANCE_MATRIX_V1.md · docs/FINORA_ERP_EXPANSION_ROADMAP_V4.md · docs/FINORA_UX_ACCOUNTING_BENCHMARK_V3.md · docs/FINORA_MODULAR_ERP_OFFICE_AUTOMATION_V1.md · docs/SLICE_B_TENANT_RBAC_VERIFICATION.md · docs/SECURITY_DEFINER_HARDENING_2026-09-30.md · docs/CURRENT_STAGE_GAP_REGISTER_2026-09-30.md · docs/ELI_1_ENTERPRISE_LICENSE_VERIFICATION.md through docs/ELI_4_ENTERPRISE_ORGANIZATION_UX_VERIFICATION.md · docs/OFFICE_SLICE_C1_VERIFICATION.md through docs/OFFICE_SLICE_C8_RUNTIME_UI_VERIFICATION.md · docs/REQUEST_WORKFLOW_D2_CUTOVER_VERIFICATION.md · docs/REQUEST_WORKFLOW_D3A_VERIFICATION.md · docs/REQUEST_WORKFLOW_D3B_VERIFICATION.md · docs/REQUEST_WORKFLOW_D3C_VERIFICATION.md · docs/REQUEST_WORKFLOW_D4A_VERIFICATION.md · docs/PRODUCTION_RUNBOOK.md · supabase/migrations/ · supabase/tests/request_d1_behavior.sql · supabase/tests/request_d2_legacy_behavior.sql · supabase/tests/request_d3a_workflow_behavior.sql · supabase/tests/request_d3b_condition_timeline.sql · supabase/tests/request_d3c_operations.sql.
NOT VERIFIED / external boundary
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.
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.
Exact next executable work
- 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.
- Keep D4c destination consumers disabled until a real destination adapter enforces
destination_command_keyidempotency and its authorization/audit behavior is adversarially verified; automatic scheduler invocation remains a separate operational verification. - 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.
Live QA open items
- Exact Taxpayer-System print redesign: owner reference images were received in chat and implementation was reported complete; retain regression coverage and do not silently redesign away from the approved reference.
- Legacy request records are preserved for rollback/audit after D2; new request configuration/runtime must not be routed back through record-store writes.
- Floating-detail defaults for new records: 8-digit semantic codes currently use slot/category/sequence (Branch
11xxxxxx, Counterparty21xxxxxx, Project31xxxxxx); historical codes are not rewritten and account-chart coding stays independent. - Product/service deletion must continue to fail closed whenever operational references exist.