سامانه صدور فاکتور و حسابداری
docs: record linked draft UI action safety scope before changes
davoodmehraban89 committed
Nov 22, 2026 at 17:18 UTC
c7ceac488cbedc1afdb56b9471b2dccd6fd6054d
1 file changed
+8
PROJECT_STATE.md
+8
@@ -630,3 +630,11 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
630
- **Review and fix:** predecessor `6842011998e5d9c480a130ccfcc9aab02c091fb6` failed the existing static `!inv.accountingPostingPending` invariant; that guard was restored explicitly in `js/invoices.js` at `58debcf703371771d862fc9c20838c3c447e64a1` without reopening linked source edits. The subsequent single-file Playwright test at `1fb81b66...` verifies actual sale/purchase table actions, not merely internal selectors.
631
- **Owner A–F end-of-session estimate (new six-phase 0–5 mapped to A–F):** A (audit/architecture) 90%; B (server accounting core) 50%; C (draft-first source/journal lifecycle) 20%; D (ledger health) 55%; E (operational UX) 52%; F (release readiness) 10%. These are **approximate evidence-based estimates**, not computed earned-value metrics. Only E moves marginally due real browser UI acceptance; C and F remain blocked. Do not infer server readiness from UI success.
632
- **Unresolved owner boundary / next work:** Codex-main must implement approved ADR216 **atomic source+linked journal draft** Save/Edit/Delete and **separate accounting:approve-authorized Finalize** under controlled migration/test permission; restrict legacy `finora_journal_autopost` to prevent commerce:create-only bypass; convert last browser expected-RED and both JWT expected-product-RED checks into real denied-seller/allowed-approver acceptance and re-run full gates, historical rollback/number invariants and independent review. The task requires separate explicit owner approval before schema/RBAC/RLS/grants or financial history work under the existing project charter. No Prod/hosted DB operations, branch merge or publication were made. The documentation-only successor commit after this entry will start its own CI; do not transfer code SHA results to its new SHA.
633
+
634
+
635
+### 2026-11-22 — ISSUE229-UI-DRAFT-ACTIONS: continuation, design decision BEFORE code
636
+- **Owner instruction:** resume execution; reports of A–F **only at the end** of the turn, links for every relevant Quality/WP1/WP2/Security GitHub Action run, short statement of active phase and any owner participation required. Send sparse liveness updates, not repetitive percentage reports.
637
+- **Verified baseline:** Draft PR232 HEAD `18973d44e00d52995762caa7797cad51f073e131` is docs-only descendant of accepted UI code `1fb81b66d96d6b540ff5dffa74231eb2c40129d2`. Exact documentation-head [Quality 45028567670](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45028567670), [WP2 45028567661](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45028567661), [Security 45028567688](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45028567688) SUCCESS; [WP1 45028567672](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45028567672) IN PROGRESS at start. Production and main unchanged; Issues216/229 OPEN; real seller-JWT posting without accounting:approve still P0 RED.
638
+- **New bounded problem:** `js/invoices.js::invoiceDocumentStatusLabel` advertises a linked draft as “پیشنویس قابل ویرایش” even though current UI rightly blocks source-only edits; `finalizeInvoiceDocumentUi`, `purFinalizeUi`, `purDeleteDraftUi` still show a confirmation prompt if invoked directly on linked draft and only fail deeper in the RPC/guard path, creating false user expectations. Do not make backend calls for impossible operations.
639
+- **Plan/acceptance:** within same isolated Draft PR232 add transparent linked-draft read-only labels to sale and purchase registers, and early fail-closed UI guards for linked-draft finalization/deletion (plus direct sale finalize guard), *before* any confirmation dialog or `jeRpcAutoPost`/generic mutation. Add real Playwright browser test proving (a) labels no longer promise edit, (b) direct UI APIs do not open confirmation, call posting RPC, or mutate source/linked journal. Re-run exact-head Quality/WP1/WP2/Security. Keep unlinked draft flows and posted correction unchanged. **No SQL, RLS, schema, roles, Auth, financial engine, merge, publication or hosted writes.** Client controls are never a substitute for server `accounting:approve` enforcement.
640
+- **Safety boundary:** Codex-main remains only implementer of atomic source+linked journal draft / independent approval fixes. Existing one browser expected-RED and both real JWT expected-RED probes must remain; no false issue closure.