سامانه صدور فاکتور و حسابداری
docs(qa): record posted purchase correction Save draft-first expected-red scope
davoodmehraban89 committed
Nov 22, 2026 at 18:31 UTC
c906a70e7eb19945ff20edcebe89a7ba1fd65c2a
1 file changed
+8
PROJECT_STATE.md
+8
@@ -645,3 +645,11 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
645
- **Scope/security:** PR233 diff has only `PROJECT_STATE.md`, `scripts/accounting-document-workflow.spec.js` and `.github/workflows/free-supabase-local-e2e.yml`. No migration, financial source/SQL/RPC/RBAC/RLS/Auth, posted-history, production, protected main `dab1a45fcfc4f12e675cfe055e477138cd3e99fa`, merge or release. Issue216 and Issue229 P0 OPEN; PR232 UI remains an independent Draft, not merged. This is **CI QA contract integrity**, not a product/security-fix acceptance.
646
- **A–F conservative phase estimates (owner end-of-turn only):** A architecture/audit **90%**, B server finance **50%**, C source-linked draft lifecycle **20%**, D ledger health **55%**, E operational UX **53%**, F release readiness **10%**. All estimates unchanged: real authz and source/journal lifecycle P0 failures block genuine phase advancement.
647
- **Next owner-controlled boundary:** owner must **explicitly approve** any Codex-main schema/grant/RLS/Auth/RPC/migration changes even in disposable test DB. Acceptance remains server-atomic sale+purchase source-linked draft Save; distinct `accounting:approve` Finalize; blocked old commerce:create-only autopost; immutable posted history/attachment sequence, rollback, source-edit/delete atomicity, real-JWT positive approver and negative seller scenarios; convert expected RED into normal PASS only after actual fix. No such permission has been inferred from a plain “continue.” This subsequent docs-only commit will start Quality/WP1/Security anew without an exact-docs-head WP2 trigger; code-SHA results above remain exact/authoritative.
648
+
649
+
650
+### 2026-11-22 — FIN-P0-229-PURCHASE-AMEND-SAVE: owner continuation, decision BEFORE code
651
+- **Owner says continue**. Keep manual A–F progress only in end-of-session report, direct URL for every relevant Quality/WP1/WP2/Security run, explicit active phase and no implicit approval for schema/grant/financial SQL changes.
652
+- **Observed P0 contract gap at current Draft PR233** `a24c73c14bb21d8a02a2e00e5450aaed65e1603d`: `js/purchases.js::purchaseSaveSeamless` builds a corrective purchase draft after posted-purchase reversal, but directly calls `finalizePurchasePilotDraft(newId)` on **Save** (line 113). Existing Playwright `seamless purchase correction` explicitly expects a posted correction after pressing Save, which represents the *legacy behavioral baseline*, not accepted ADR216 draft-first accounting. A new corrective purchase should persist a **linked journal DRAFT** with balanced lines after Save; explicit `accounting:approve` Finalize is distinct. Original posted purchase and reversal must remain traceable and immutable.
653
+- **Bounded QA-only plan:** extend `scripts/accounting-document-workflow.spec.js` with a **real browser expected-product-RED** for corrected posted purchase Save (use existing `createPostedPurchase`, `beginPurchaseAmendment`, genuine form quantity change, Save, server records and exact original-voucher fingerprint). Validate setup before `test.fail(true)`; expected result is corrected source `draft` + source-linked balanced `draft` voucher, **no posted correction voucher on Save**, preserve original posted source+voucher and reversal audit; a successful legacy repost must be observed as RED, NOT celebrated as a fix. Preserve prior happy-path tests as transparent legacy baseline for later migration. Do not touch `js/purchases.js`, SQL, migration, RPC, grants, RLS, Auth, production or posted financial history.
654
+- **Acceptance/evidence:** exact-code four-gate CI and real JWT WP2 markers, since WP2 trigger now covers this spec. Keep Issue229 and Issue216 P0 OPEN; Codex-main still responsible for actual server-atomic lifecycle with separately approved test-DB changes. Do not raise C/F from negative QA evidence.
655
+- **Prechange gates on docs-only head:** [Quality 45035378143](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45035378143), [WP1 45035378134](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45035378134) active at continuation; [WP2 45035378122](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45035378122) and [Security 45035378174](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45035378174) SUCCESS. No speculative status transfer between commits.