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

docs(qa): verify formal-sale Save expected-red browser contract and CI scope

davoodmehraban89 committed Nov 22, 2026 at 17:56 UTC 7342deffff8bcdff4ece24e6e7fc74fafc7d1cb3
1 file changed +10
PROJECT_STATE.md
+10
@@ -614,3 +614,13 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
614 - **Allowed QA work:** Add one truthful Playwright `test.fail(true)` for a *formal sale invoice Save* through the real browser form that asserts server-persisted business draft AND linked journal **draft** (no final number, no posted voucher, zero autoPOST RPC), with an atomic source-to-journal reference. Validate fixture and source record before declaring the known P0 expected-RED. Cover this as an executable acceptance requirement, not a product repair. Do not remove/alter the existing sale happy-path tests, purchase Save expected-RED, or linked-draft selector expected-RED on this independently stacked branch.
615 - **Safety:** no finance SQL/migrations, grants/RLS/Auth, server RPC, transaction semantics, paid/prod DB, posted history, merge or release. Codex-main remains sole owner for the financial server lifecycle fix, pending explicit authorization. UI PR232 already has exact-code four-gate success for E; this independent QA test concerns C only.
616 - **Verification:** run Quality/Chromium, WP1, WP2, Security on exact new QA code SHA; expected-failure must be clearly reported and must not mask fixture errors. Audit CI logs and retain both real-JWT sale/purchase approval bypass P0 repro markers. Do not increase C because an expected-red test is only added.
617 +
618 +
619 +### 2026-11-22 — FIN-P0-229-SALE-SAVE-RED: verified QA acceptance checkpoint
620 +- **User instruction honored:** continue work with one final A–F report, direct links for all available gates, succinct next phase and blocking owner permission.
621 +- **Actual scoped delivery:** new [Draft PR233](https://github.com/davoodmehraban89/Factor-easy/pull/233) stacked on Draft PR231, **exact code SHA `71e4a2fe2803248d2ea7abf0122ecfc5cddfef6f`**. One real Playwright expected-RED for formal sale Save now confirms the unimplemented ADR216 requirement: **source and exactly one source-linked journal draft**, both persisted and balanced without posting or allocating final number. Test validates real browser Save, server-persisted source/formal fixture/company/total **before** `test.fail(true)`, so a fixture failure is not mistaken for known product defect. Present sale Save still stores a business-only draft without linked journal; this is clear acceptance evidence, **not a fix**.
622 +- **Exact-code CI verified:** [Quality 45031609252](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45031609252) **SUCCESS**; GitHub job log: `254 passed (3.9m)` Chromium and `4 passed` Pages, new expected-RED test was **30/254**, existing purchase Save and linked-draft status expected-RED still present. [WP1 45031609246](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45031609246) **SUCCESS**, both disposable ledger jobs. [Security 45031609229](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45031609229) **SUCCESS** (conditional Dependency Review SKIPPED).
623 +- **WP2 important distinction:** **NO exact-code WP2 run for PR233** because `.github/workflows/free-supabase-local-e2e.yml` has a pull_request paths filter excluding `scripts/accounting-document-workflow.spec.js` and `PROJECT_STATE.md`. [WP2 baseline 45021915017](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45021915017) remains SUCCESS on unchanged server financial code in PR231, and verified two real-JWT **P0 product expected RED** unauthorized-posting paths. **Do not call base WP2 an exact-PR233 pass.**
624 +- **Safety/roadmap:** files changed on PR233 are **ONLY** `PROJECT_STATE.md` and `scripts/accounting-document-workflow.spec.js`. No finance JS/SQL/migrations, Auth, grants/RLS, real data, posted history, protected main (dab1a45fcfc4f12e675cfe055e477138cd3e99fa), deploy or merge. Issues216 and 229 OPEN; PR233 DRAFT. The QA proof must be converted to normal green once Codex-main fixes real atomic sale Save, not silenced.
625 +- **A–F owner progress estimate for end-of-turn only:** A audit/architecture 90%; B server finance 50%; C draft-first source+journal 20% (NO increase from negative QA evidence); D ledger health 55%; E UX 53%; F release readiness 10%. These are judgmental estimates, not quantitative completion certificates.
626 +- **Next P0 block:** require owner's **explicit scoped approval** to implement controlled additive server RPC/migration and independent `accounting:approve` posting authorization **in disposable test DB only**, with rollback, real negative seller JWT and positive approver JWT acceptance, immutable posted history and permanent attachment numbering. A general “continue” does not silently permit schema/RBAC/grants changes or production access. After approval, Codex-main reviews and implements, converts sale and purchase Save xfails/approval expected-RED to true negative+positive contracts; no posted-to-draft mass history mutation. This documentation-only successor commit starts its own CI; the successes above strictly refer to code SHA `71e4a2fe2803248d2ea7abf0122ecfc5cddfef6f`.