سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 4, 14:15 UTC
docs(finora): record bounded real-JWT company-scope QA extension before implementation
davoodmehraban89 committed
Nov 23, 2026 at 16:31 UTC
27ae9f34568ec8e4cc272acdb5d810e62388af35
1 file changed
+8
PROJECT_STATE.md
+8
@@ -849,3 +849,11 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
849
- **Product boundaries unchanged:** real JWT proves organization-level isolation and existing posted stock/count mutation guards only. Same-org A1/A2 visibility is expected under organization RLS; active-company Phase5/Kardex read model remains PRODUCT P0. Issue229 sale/purchase non-owner `commerce:create` without `accounting:approve` still emits both expected-RED markers in final WP2. PR240/242 browser expected-RED inventory failures remain unresolved. No application JS, SQL, migration, RLS/Auth/grant, financial history, Production, main, merge or release change.
850
- **Exact diff:** 4 files, 230 insertions, zero deletions against PR242 base; test script and WP2 workflow blobs identical between tested code SHA `b309e240be66137ccf042aa728935eaf31130662` and docs-inclusive head `e4168eb...`. No independent Codex-main review submitted; PR remains Draft. The append below/after this note creates a new SHA and must trigger/verify new exact-head gates before any acceptance.
851
- **Six-stage estimate remains unchanged:** A90/B50/C20/D55/E53/F10. This is QA proof and continuity work, not product phase completion.
852
+
853
+
854
+### 2026-11-23 — FIN-QA-223-COMPANY-SCOPE-JWT / pre-implementation decision
855
+- **Reason for a separate test (not a claim of a defect):** the existing [Slice B tenant/RBAC record](docs/SLICE_B_TENANT_RBAC_VERIFICATION.md) describes `own/unit/branch/company/organization` row scopes and historical authenticated-role transaction checks, but its enumerated executed cases do not demonstrate a real Auth-issued JWT limited to one company. Current PR243 tests organization isolation using owner JWTs; owners legitimately see A1 and A2 in their organization. That owner result must not be generalized to restricted members.
856
+- **Source contract read-only:** `20260930031853_organization_membership_rbac_foundation.sql` `records_select` delegates to `private.can_access_record`, which requires `private.record_in_member_scope`; `20260930033010_allow_member_core_read_context.sql` preserves `scope_type='company'` and compares `scope_id` to `data.companyId/company_id`. `20260930025546_modular_entitlements_office_automation_foundation.sql` maps `stockMovements` and `inventoryCounts` to `inventory`. This is an implementation claim to validate, not a proof that it works through the live PostgREST JWT path.
857
+- **Selected non-overlapping QA extension:** extend only `scripts/wp2-stock-tenant-jwt-e2e.mjs` with a third temporary Auth user C, active non-owner membership in disposable organization A, and `inventory:read` permission restricted to `scope_type='company'`, `scope_id=A1`. Raise only A's disposable test-license `max_users` to 2 (A owner + C) while preserving the real seat trigger. Verify C reads A1 `stockMovements` and `inventoryCounts`, cannot read same-org A2 or foreign-org B, and cannot create/edit/delete even A1 with read-only capability. Verify owner A still sees both A1/A2, and all original records remain unchanged.
858
+- **Strict interpretation:** this validates server-side *company row scope for a delegated member*, not the UI's active-company selector/Kardex projection, not a general per-user license entitlement, not posting authorization, and not production RLS. A1/A2 owner visibility remains expected. No product JS, SQL/migration/RLS/Auth/grant, Production data, main, PR242, PR218, history or deployment will be changed. Any unexpected status/readback fails closed; no expected-red masking.
859
+- **Owner/overlap:** QA-only continuation of PR243 on its existing PR242 child branch; Codex-main remains sole financial integration owner and reviewer. Existing PR240/242 browser defects and Issue229 sale/purchase approval expected-REDs remain untouched. After the note, implement the one test, run exact-SHA WP2/Quality/WP1/Security, and append the actual result before handoff. A90/B50/C20/D55/E53/F10 unchanged.