سامانه صدور فاکتور و حسابداری
docs(phase1a): handoff actual toolchain, isolated QA environments, stage gates and current red CI in project history
davoodmehraban89 committed
Oct 17, 2026 at 01:48 UTC
ca33d0982c388a471098245723f9bbc0c1d42526
1 file changed
+13
PROJECT_STATE.md
+13
@@ -60,3 +60,16 @@
60
- Stage 3 requires another owner go-ahead: sale, purchase, receipt/payment and subsequent source integrations with browser gate per path.
61
- No DDL/DML Production, no merge to main, no Phase 1B. No enforce activation without separately approved backup and browser acceptance. Posted originals immutable; reversal references original only, computed reversal status in view. Any necessary posted-original trigger exception must STOP for approval.
62
- Existing risks to retain: client-editable fiscal year lock; operational inventory records with status/postedAt outside journal guard. Existing Phase 1A test CI at branch head before this request was RED for positive client journal flow; expected until Stage 2, never mark as green.
63
+
64
+
65
+### 2026-10-17 — New-chat continuity: exact tools, environments, Stage 1 handoff (documentation only)
66
+- **Authority/source:** Read AGENTS.md, README.md and this PROJECT_STATE.md fully, plus docs/archive/PROJECT_STATE_PRE_MASTER_PHASE0_2026-10-16.md for earlier history. Verify CURRENT GitHub ref/main/CI/Production READ-ONLY; do not treat this snapshot as live ground truth.
67
+- **GitHub remote:** davoodmehraban89/Factor-easy; protected main baseline bccd474433b4188e43aae345773498ea6fc65209; work ONLY on feature/finora-phase1a-supabase-cli-20261016. GitHub connector can read files/branches, edit branch files and inspect workflow runs/jobs/logs; NEVER merge, deploy or write to main without separate consent.
68
+- **Production:** https://factoreasy.ir ; Supabase project ref hcsixhqbyuhpshfwqpjx. Production database access through Supabase connector is SELECT/catalog/aggregates ONLY, explicitly NO DDL, DML, INSERT/UPDATE/DELETE or write-like test, and NO migration ledger repair or db push. Latest read-only inspection found 608 records across two data-bearing organizations (401 and 207 rows), 9 posted/reversed vouchers in those orgs (7 + 2); both owners verified with previous login; treat org B as REAL, not synthetic. No identity or personal details to be exposed in reports.
69
+- **Disposable database test:** GitHub Actions workflow .github/workflows/phase1a-supabase-parity.yml; ubuntu-latest, Docker, Supabase CLI pinned 2.121.0; isolated supabase start -x inbucket (unlinked, no remote project configured), local Postgres 127.0.0.1:54322 database postgres user postgres via psql; Node.js scripts and SQL in supabase/tests; synthetic auth.users, orgs and records only here. Main stage1 tests include SQL behavior, two-fiscal counters, seeded 1000 events (seed=20261016), real concurrent psql sessions, up/down/up and SECURITY DEFINER grant audit. Historical migration tail \\n normalization happens ONLY inside ephemeral CI checkout. No historic blob edits.
70
+- **Browser/QA:** Node.js/Playwright Chromium + GitHub workflows .github/workflows/quality.yml, qa.yml, security.yml, release-gate.yml, pages.yml; browser real integration must target a separate staging URL backed by disposable TEST Supabase, never mutate Production. Staging URL and credential/account readiness have NOT been independently confirmed. TinyFish browser automation profile 'Finora ERP — Test / Work Account' id prof_5ea28cf6866d447d; read-only authenticated dashboard session was observed in prior browser test, but saved login status needs re-verification. TinyFish may inspect Production read-only; cannot replace Postgres concurrency/RLS/schema tests. Other debugging aids: GitHub Actions logs/artifacts, SQL fixture and schema fingerprint comparison, container/Python for non-Production work; Remote Desktop Commander only if connected and specifically authorized. Production backup tool/document docs/FINORA_OFFLINE_BACKUP_FA.md is documented, actual encrypted backup + restore UNVERIFIED.
71
+- **Current staged SQL:** migrations 20261016100000 (server journal invariants), 20261016100500 (CAS and legacy sync compatibility), 20261016101000 (per-org off/audit/enforce + immutable audit), 20261016101500 (core/counters/scope/unique source), 20261016102000 (five lifecycle RPCs + atomic autopost, computed reverse view). The stage1 code has NOT passed the full test gate; never call accepted or release-ready. No per-organization enforce on Production; local synthetic fixtures can use enforce.
72
+- **Last observed branch head BEFORE this note:** 2513a49b2b79da3dc2d1448de5923f5790e98689; latest Actions run 38911880626 CANCELLED, preceding 38911422707 FAILED specifically at seeded 1000 events due to duplicate key 'ux_finora_journal_source_version'; branch now includes scripts/phase1a-stage1-concurrency.mjs and supabase/tests/phase1a_stage1_counter_two_fiscal.sql. Obtain newer CI evidence before diagnosing next. Positive legacy JS journal client contract is RED and belongs to Stage 2; do not hide it by removing assertions.
73
+- **Three approval stop gates:** Stage 1 SQL + isolated tests ONLY -> report proof, stop; Stage 2 manual journal async strangler with existing function names + Playwright real staging, CI green -> report, stop; Stage 3 source flows one by one sale -> purchase -> receipt/payment -> other with browser test per path. Never start Stage 2 or 3 without separate approval following prior stage report. No Phase 1B, no merge into main, no Production writes. Activating enforce requires owner's additional explicit signoff AFTER verified backup and staging-browser test. Original posted voucher immutable; reverse-only link toward original and computed view; if trigger exception or original mutation needed STOP for user approval.
74
+- **Known unresolved security/domain risks:** fiscal year lock is client-editable; stock/inventory operational records status/postedAt outside journal guard; source autopost must strictly validate source-to-ledger amounts and permitted mappings rather than trust caller-supplied lines; duplicate-click and concurrent reversal must be independently proved. Stage 1 seed test failure is real; no 'pass' without exact-run evidence.
75
+- User requested a SINGLE copyable plain-text prompt/file for migrating to a new ChatGPT chat; this section ensures tools and test environments are recorded in repository history too. New chat should proceed from actual repo/tool state, not speculative claims.