سامانه صدور فاکتور و حسابداری
docs(finora): record owner authorization and scoped financial core recovery decision
davoodmehraban89 committed
Nov 24, 2026 at 10:40 UTC
6ce3c16c3b7aa0a3befa22a55f7463bb43d4e5a8
1 file changed
+6
PROJECT_STATE.md
+6
@@ -493,3 +493,9 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
493
- Previous Issue248 diagnostic is COMPLETE: exact test SHA `38a20bda7654b7ce637844d6a25fc829045b3a95`, WP1 #45342205391 local job 138268270627 proved ordered lifecycle trigger→observational trigger→posted-source guard, inter-trigger voucher absent/status NULL, registry deleted, nullable guard predicate NULL while source draft; original false immutable error rethrown after exact source/voucher/registry/audit snapshots rolled back. See Issue248 comment #7124218555. No further similar probes. Product fix still owner-only. Main `dab1a45fcfc4f12e675cfe055e477138cd3e99fa` and PR219 `ab14e46abec4b8ef1f36c4f219d9a9ba6d99bc6d` unchanged. Issues229/245/246/248 open.
494
- Independent current WP2 #45342205332 local job 138268380959 failed `FINORA_ORG_FORBIDDEN` when existing WP3 fixture inserts journal directly via SQL at scripts/wp3-financial-tenant-e2e.mjs:46. Auth users and org setup already run. Do not weaken authorize or change actual product.
495
- **Scope**: on same Draft PR247 edit only existing `scripts/wp3-financial-tenant-e2e.mjs` plus append-only PROJECT_STATE. Explicit fail-closed loopback API/DB URL guard before setup. Seed two synthetic manual-posting accounts/company/open fiscal year via existing isolated psql fixture, then call existing `finora_journal_create_draft` with actual signed owner A JWT, valid balanced lines and header (no status). Require 200 and exact persisted draft/lines/version/actor readback; verify owner A positive before testing cross-tenant B; use actual revision/valid lines in foreign RPC attempts. Preserve all existing REST and five RPC denials, add exact owner readback before/after and no foreign-created row; do not use service role for journal operations. Do not relax denial codes or swallow unexpected errors; no actual production, financial migration, app JS, roles/grants/RLS/trigger changes. WP1 Issue248 strict RED unchanged. Retest exact new QA head and report available evidence, no claim of completed CI if still pending. A90/B50/C20/D55/E53/F10 unchanged.
496
+
497
+
498
+### 2026-11-24 — OWNER AUTHORIZATION / FIN-CORE-RECOVERY-01
499
+- Owner expressly confirmed in chat "تاییده استارت بزن" after proposal to transfer responsibility for financial core implementation to this conversation. Prior QA-only division superseded for scoped development on a separate review branch; do not concurrently edit the existing owner/QA heads. Main/Production, destructive history conversions, merge/release remain prohibited without separate safeguards/approval. No hosted DB access.
500
+- New branch `fix/financial-lifecycle-recovery-20261124` created from QA PR247 exact `eaa873c3c22d43d5c5a8e1c8e98ec46ff3c9abae` (PR219 parent `ab14e46abec4b8ef1f36c4f219d9a9ba6d99bc6d`; protected main `dab1a45fcfc4f12e675cfe055e477138cd3e99fa`). WP2 real signed JWT draft/tenant isolation passed; overall WP2 4/22 adapter tests passed due syntax and obsolete purchase Save expectation. WP1 local RED Issue248; ledger negative PASS. Prior isolated first-save reproduction in PR219 comment 7124650687 showed syntax error and, after in-memory newline correction, TypeError assignment to constant variable for both sale/purchase, persistence stub once/RPC zero. No product fix previously.
501
+- First bounded implementation: repair source-draft adapter parsing and refreshed context/version checks after persistence; prevent concurrent draft creation, preserve canonical server RPC and readback. Add behavior tests for sale/purchase first Save (draft only, no post), refreshed source fields, changed context and failed persistence. Replace only stale purchase Save autopost static expectation with draft-only requirement and separate explicit finalizer. Existing legacy autopost behavioral assertions must be reviewed against current explicit finalize contract; do not silently green them or bypass independent approval. Validate exact changed code in isolated JavaScript and GitHub CI, keep known P0/P1 release gates red until fixed. Issue248 trigger-order repair and P0 approval/RBAC are next separate bounded changes, not claimed complete. Existing mass history conversion/identity exposure are release blockers; no production conversion. Progress unchanged A90/B50/C20/D55/E53/F10 until verified.