@davoodmehraban89 / Factor-easy / commits / 85fd550
Fork 0

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

docs(state): record exact-head 251-browser GREEN and explicit non-release handoff (#216)

davoodmehraban89 committed Nov 22, 2026 at 06:33 UTC 85fd550c6e09a122d17057489303de087c7c1b77
1 file changed +8
PROJECT_STATE.md
+8
@@ -457,3 +457,11 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
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.
460 +
461 +
462 +### 2026-11-22 — FIN-QA-218-01/02/03 exact-head GREEN handoff, PR221 (supersedes earlier pending-CI checkpoints)
463 +- **Request / decision:** Continue only non-overlapping, evidence-based work; keep PR218 as the unchanged integration base and PR220 as a separate audit. PR221 now contains two targeted production-code repairs (Kardex in `js/products.js`, initial invoice product options in `js/invoices.js`), synthetic authorized-membership fixture repairs in three Playwright files, one explicit revoked-membership negative test, one unsaved invoice input preservation test, and updates to existing canonical documents. This **corrects the earlier docs-only description of the worker scope**; no protected/main or financial-core owner-held file was changed.
464 +- **Verified immutable application/test SHA:** `14a88586c7bf95491707d6368699c1438ed56a47`. [Quality run 44956627612](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44956627612) completed **SUCCESS**: `static-quality` successful, **251/251 browser tests passed**; the same job also reported a separate **4/4 tests passed**. Quality `identity-wave5a-database`, `c8-policy-database`, `d1-request-database` all successful. [WP1 run 44956627606](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44956627606): `ledger-negative-and-behavior` and `supabase-local-stack` both SUCCESS. [Security run 44956627615](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44956627615): `CodeQL JavaScript` and `Release and QA safety invariants` SUCCESS; dependency review **SKIPPED**, not an independent pass. No WP2 run was returned for this exact SHA. Earlier intermediate commits had cancelled/non-final runs; none are counted as passes.
465 +- **RED/GREEN relationship:** RED [44949211793](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44949211793) had 236 pass/13 fail; after Kardex correction, [44954272409](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44954272409) 237 pass/12 fail; after preserving fixture membership and hydrating initial invoice product options, final 251/251 browser PASS. No test was removed, skipped, or weakened; two browser tests were added. The real organization revocation guard remains active, including the new negative test.
466 +- **Acceptance boundary:** `FIN-QA-218-01/02/03` may be marked **پذیرفته‌شده در تست (candidate)** for the documented browser/CI scope only, **not منتشرشده**. The entire financial draft lifecycle Issue216, authorized positive financial PostgREST/journal posting, cheque accounting, real customer accounts, and historical migration are **NOT accepted** by these runs. No production Supabase access/write, tenant history change, migration, protected merge or Pages deployment occurred. The main Codex remains sole independent reviewer/integration authority; PR221 currently has no external reviews, and PR220 may overlap in canonical documentation. Do not claim self-review as independent.
467 +- **Continuity / exact next checkpoint:** PR221 Draft based on PR218; canonical status docs updated after the test SHA (thus next docs-only head will require its own exact-head checks). Main Codex should inspect `js/products.js::productKardexRows`, `js/invoices.js::hydrateEmptyInvoiceProductSelectors`, `scripts/commerce-route-types.spec.js` revoked/authorized cases, `scripts/phase0-invoice-persistence.spec.js` preservation case and `scripts/ux-hardening-r2.spec.js` authorization fixture. Check final docs-head Quality, WP1, Security plus the missing WP2 coverage where applicable; selectively reconcile PR220 documentation without merging duplicate financial alternatives. Leave PR221 Draft; no merge or deployment authority delegated.