سامانه صدور فاکتور و حسابداری
docs(finora): record PR247 observed missing WP4 fixture seed and scoped SQL test correction decision
davoodmehraban89 committed
Nov 23, 2026 at 22:53 UTC
ac2ccf1153178293a4562a91fba66ca488c0b238
1 file changed
+6
PROJECT_STATE.md
+6
@@ -445,3 +445,9 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
445
- Create *child QA-only branch* `qa/pr219-wp1-disposable-dburl-proof-20261123` strictly on PR219 exact SHA to isolate one reproducible WP1 CI gate. No product JS, migrations, journal core, grants/RLS/Auth, protected main, production, data history or release edits. First change only the WP1 `.github/workflows/wp1-ledger.yml` lifecycle step to source fresh `supabase status -o env`, export `DB_URL` in the SAME step, reject nonlocal DB addresses, execute the existing SQL fixture. Do NOT treat a `psql` connection fix as a lifecycle PASS; run actual GitHub WP1 exact-head and inspect log before any further change. Keep branch Draft and stacked; WP2 Quality Security may remain parent-broken. Existing QA PR244 remains separate and untouched.
446
- **Preliminary unexecuted SQL fixture hazards:** `supabase/tests/wp4_journal_document_lifecycle.sql` ends last anonymous block with `DO $` / `END $;` rather than `DO $$` / `END $$;`; test file creates `auth.users` but doesn't itself insert an owner organization/company/FY/posting accounts for synthetic UUID `b900...`, and no repo `supabase/seed.sql` was found. Only after real test log verify syntax/bootstrap root and consider narrowly scoped *test fixture* repairs on the same QA child; never change application migration to silence failures.
447
- Expected acceptance: actual WP1 local stack moves past disconnected `psql` into SQL and reports either verified lifecycle test PASS or precise SQL fixture/product failure; other jobs must not be falsely declared clean. Precommit/write decision now; result follow-up append with tested SHA and CI. Product six-stage A90/B50/C20/D55/E53/F10 unchanged.
448
+
449
+
450
+### 2026-11-23 — FIN-QA-219-WP1-DBURL / observed next RED and fixture-only decision
451
+- **Executed QA code SHA `add9342596800727965d1514f92028b0dfa7b7d9`**, [WP1 #45247819766](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45247819766) local stack reached the lifecycle SQL with a real loopback DB connection, after replacing the step-local absent `DB_URL`; original Unix-socket connection error no longer occurred. The unchanged SQL fixture **FAILED at line 44** with concrete `WP4_COMPANY_FY_NOT_FOUND`, not an observed lifecycle behavior failure. This is a newly exposed fixture setup error.
452
+- Cause verified against source: `supabase/tests/wp4_journal_document_lifecycle.sql` inserts a synthetic `auth.users` row, and the Auth trigger (migration `20261012080000_fix_identity_bootstrap_license_before_membership.sql`) creates profile, organization/license/member but NOT any `companies`, `fiscalYears`, or `accounts` records. The fixture immediately queries for those records without inserting any. It also has a final malformed anonymous SQL block `DO $` / `END $;` rather than dollar-quoted `DO $$` / `END $$;`; this is source evidence only until SQL reaches it.
453
+- **Before follow-up implementation**, limit changes to the existing `supabase/tests/wp4_journal_document_lifecycle.sql` *test fixture* on child Draft PR247: seed exactly one local company, unlocked fiscal year, two valid posting accounts for the Auth-trigger-created synthetic owner in the current transaction, and fix only malformed SQL test delimiter. Do not alter SQL migration, business code, grants, RLS, audit/history, Production or main; no blanket permissions. Retain strict real lifecycle assertions. Rerun WP1 on new exact SHA; any new SQL failure should be diagnosed as fixture vs actual lifecycle behavior, not relabeled PASS. Parent PR219 Quality/Security JS syntax and WP2 Auth fixture defects remain separately open. A90/B50/C20/D55/E53/F10 unchanged.