@davoodmehraban89 / Factor-easy / commits / f0b98a1
Fork 0

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

docs: record scoped membership-fixture and invoice-hydration repairs pending CI (#216)

davoodmehraban89 committed Nov 22, 2026 at 01:53 UTC f0b98a1e413c16a019588328049d2557dddf2cd6
1 file changed +4
PROJECT_STATE.md
+4
@@ -453,3 +453,7 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
453 - **2026-11-22 post-fix CI result:** exact commit `0b3b1e1a19396279f40eb694ec752c459bfdfb87` [Quality 44954272409](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44954272409) completed **FAIL**: 237 passed, 12 failed (previous exact-head RED was 236 passed, 13 failed). `scripts/accounting-document-workflow.spec.js:476` is no longer among failures; Kardex scenario passed in the suite. All three Quality DB jobs passed; browser static-quality failed. [Security 44954272331](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44954272331) passed; [WP1 44954272389](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44954272389) was in progress at this observation. WP2 not observed on this SHA. **This is test evidence, not production acceptance.**
454 - **Remaining 12 failures classified without masking:** commerce route 2, phase0 invoice persistence 5, UX hardening 5. Logs for commerce and UX clicks show `#finora-membership-lock` intercepting events; UX hydration checkbox mismatch is a separate assertion. Invoice test harness seeds `QA_PROD` in its fake RPC server but the selector has zero matching options after `enterApp`; cause may be read/hydration or authorization, not yet proven. Fixtures replace `fetchCurrentUser`, `sb.from`, `sb.rpc` and abort Supabase network, so a browser fixture pass would not establish authorized real-service posting. These tests are not skipped, weakened or changed.
455 - **Next work and ownership:** Codex main to review PR221 scoped Kardex change and resolve any overlapping canonical docs with PR220. Independent QA should collect membership-lock reason and tenant/company hydration snapshots on PR218/PR221 exact SHA, compare to permitted real membership fixture, then assign minimal correction to the owner of that module. No independent implementation of `sync.js`, `organization-rbac.js`, or `journal-ui.js` is authorized.
456 +
457 +- **2026-11-22 focused independent repairs after post-fix CI:** source diagnosis found that `scripts/commerce-route-types.spec.js`, `scripts/ux-hardening-r2.spec.js`, and `scripts/phase0-invoice-persistence.spec.js` replace `sb.from` with a records-only fake; `organization-rbac.js::revalidateFinoraMembership` awaits an `organization_members` chain, receives no `data` from the inert builder, and correctly interprets it as no active membership. This fixture mismatch can trigger `#finora-membership-lock`; do **not** disable production membership checks. The three QA fixtures now implement a genuinely awaitable active-membership result scoped to their synthetic user and organization, and assert `revalidateFinoraMembership({sensitive:true})===true` for the authorized scenario. Revoked-user security acceptance remains a separate test.
458 +- **Second independent source defect:** `js/invoices.js::finoraEnsureInitialInvoiceRow` creates a placeholder-only first item row before authentication when `getMyProducts()` is empty; later `refreshAllSurfaces()->renderInvoices()` does not replenish that row even though `pullAll` loaded products. Limited change `hydrateEmptyInvoiceProductSelectors()` runs during `renderInvoices`, appends current product options **only** to placeholder-only selectors and never recreates the row or touches quantity, price, invoice number or notes. New regression `scripts/phase0-invoice-persistence.spec.js::late invoice product hydration preserves unsaved number, quantity and price` snapshots entered values before/after option hydration. This does not claim broader org-switch preservation or real-service posting acceptance.
459 +- **Scope and test gate:** these changes affect `js/invoices.js` plus three QA fixtures only, with no edits to Codex-main-owned `sync.js`, `organization-rbac.js`, `journal-ui.js`, no new SQL/migration or operational data change. The prior exact-head RED is 12 failures from [44954272409](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44954272409); **post-fix Quality/Security/WP1/WP2 and independent acceptance on the new head are not yet established at this checkpoint.** A test passing in a synthetic fixture cannot replace real PostgREST membership and financial E2E.