سامانه صدور فاکتور و حسابداری
docs(finora): pre-register real-JWT Phase5 inventory QA boundaries
davoodmehraban89 committed
Nov 23, 2026 at 13:08 UTC
30f93ed506288e924593452f7ed09eb9a2b47245
1 file changed
+8
PROJECT_STATE.md
+8
@@ -821,3 +821,11 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
821
- **Diff verification:** before this after-verification append, PR240 base vs PR242 candidate was exactly 3 modified files (`PROJECT_STATE.md`, `docs/EXECUTION_STATUS.md`, `scripts/accounting-document-workflow.spec.js`), 4 commits ahead/0 behind, 112 lines added and **zero deleted**, no application runtime or SQL, migrations, Auth, RLS, main, production data, merges or deployment.
822
- **Final-SHA rule:** appending this checkpoint and the existing execution-status evidence changes branch HEAD again; do **NOT** claim old code SHA's runs also tested the new docs-only SHA. Check all triggered workflows on the final SHA, preserve current evidence as *tested-code* proof only, and post precise CI results as PR comments. Keep Draft and Codex-main final review mandatory. Same six-phase managerial A90/B50/C20/D55/E53/F10 estimates (no increment).
823
- **Exact next owner/test action:** Codex-main reviews [PR242](https://github.com/davoodmehraban89/Factor-easy/pull/242) and [Issue223](https://github.com/davoodmehraban89/Factor-easy/issues/223) together with PR221/240, then implements one shared company/status/sign/transfer recognition policy without reimplementing the existing transactional ledger. After real correction, rerun the four browser cases as normal PASS, the PR240 stock/cost cases, and independent real-JWT multi-company, approver, fiscal-lock, replay/rollback checks.
824
+
825
+### 2026-11-23 — FIN-QA-223-JWT-INVENTORY / decision BEFORE implementation
826
+- User asked to continue after [Draft PR242](https://github.com/davoodmehraban89/Factor-easy/pull/242). Rechecked exact PR242 head `af07e7d7888dbb25db257f255579c04aa8c1f189`: **all four** Quality #45142207667 / WP1 #45142207731 / WP2 #45142207598 / Security #45142207618 completed SUCCESS; Quality ran 272 Chromium, 4 Pages, all four *expected known-product-RED* manual Kardex fingerprints. This closes only QA replay CI, NOT the underlying inventory bugs. Protected main remains `dab1a45fcfc4f12e675cfe055e477138cd3e99fa`; no new financial product owner PR at task start.
827
+- **Uncovered, bounded next QA gap:** PR242 demonstrated *synthetic authenticated browser* stock read-model company/sign/status defects. Its tests explicitly did NOT exercise genuine Supabase Auth-issued JWT/PostgREST stock records or the Phase5 posted-record SQL immutability guard. Existing `scripts/wp3-financial-tenant-e2e.mjs` covers journal voucher cross-tenant protection, NOT `stockMovements` and `inventoryCounts`. Existing Phase5 migration `20260929172129_phase5_complementary_erp_collections.sql` registers these collections and immutability for posted `data`. Extend independent **disposable-local QA** only, not finance application.
828
+- **Authorized branch:** `qa/finora-issue223-stock-real-jwt-20261123`, created from exact PR242 SHA. Permitted: NEW bounded `scripts/wp2-stock-tenant-jwt-e2e.mjs`, existing `.github/workflows/free-supabase-local-e2e.yml` to execute it on PR, append-only `PROJECT_STATE.md` / `docs/EXECUTION_STATUS.md`. No production access/configuration, schema/migrations, RLS/roles/grants/Auth implementation, financial app JS, customer/posted history, merges, deployments or main writes. Codex-main sole owner of business corrections.
829
+- **Test scope:** create two real Supabase Auth JWT identities in two disposable organizations, plus two companies controlled by organization A. Fixture-seed posted stock movement and inventory count per organization (psql/service role fixture only), validate scoped read via real JWT PostgREST; same-organization multi-company rows are expected visible to their authorized owner and must **NOT** be mislabeled SQL cross-tenant RLS breach. Prove other organization cannot read/insert/update/delete A stock/count; prove posted stock/count data immutable against *same-tenant JWT* direct PATCH/DELETE. Verify readback after mutation attempts; all tests fail closed and never catch/skip an unexpected product state. Localhost endpoint guard and nonproduction Supabase stack required.
830
+- **Scope limitations:** this validates cross-*organization*/owner RLS and posted immutability only. It cannot establish active-company UI scoping, warehouse accounting correctness, physical stock reception/post authorization, inventory count draft-first, rollback/concurrency or approval boundary. These remain open and require separate Codex-main acceptance. No Phase A–F percentage change (A90/B50/C20/D55/E53/F10).
831
+- **Gate:** exact-head WP2 test log must contain precise positive marker; verify Quality/WP1/WP2/Security statuses on tested and final SHAs without copying previous results. If new test reveals a true RLS or immutability bypass, report FAIL (no generic xfail) and preserve raw evidence while seeking Codex-main repair.