@davoodmehraban89 / Factor-easy / commits / caccf6f
Fork 0

سامانه صدور فاکتور و حسابداری

docs: record Stage B exact-head GREEN and scoped Stage C source-JWT QA decision

davoodmehraban89 committed Nov 22, 2026 at 07:14 UTC caccf6fa5f0dc929cc37ed0b70b6c83cd8e05b93
1 file changed +7
PROJECT_STATE.md
+7
@@ -480,3 +480,10 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
480 - This QA-only follow-on branch is based exactly on PR222 `8bcd5f923da8ecf9627b450345e44e2727ca7089`. It must not touch Codex-main-owned `sync.js`, `organization-rbac.js`, `journal-ui.js`, source/invoice financial code, SQL migrations, production Auth/DB, or posted financial history. PR218 remains financial integration base; PR220/221/222 preserve prior artifacts.
481 - **Scoped implementation decision:** add a disposable Supabase test script that provisions only ephemeral Auth user/organization/company/fiscal year/accounts, calls `finora_journal_create_draft` and `finora_journal_post` using the user's real JWT through PostgREST, reads back the posted voucher and balanced lines, verifies idempotent create replay and failed unbalanced request rollback, and add the test to existing WP2 local workflow and path triggers. No service-role token may be used for the tested RPC itself; service-role/local psql is fixture setup only.
482 - **Acceptance:** first CI run on exact branch SHA must show genuinely completed positive RPC job and Quality/WP1/Security. If it fails, record actual rejection and hand to owner of server-side accounting rather than falsifying fixtures or disabling guards. This test cannot prove source-document atomicity, whole Issue216, irreversible attachment numbering or production readiness.
483 +
484 +
485 +### 2026-11-22 — FIN-QA-SOURCE-JWT-ATOMIC (owner "continue" request; decision BEFORE test implementation)
486 +- **Stage B final exact-head gate:** PR224 SHA `6f16c00b9b67eeace45cc2f5b46e8dfaff34c3ef` has completed SUCCESS on [Quality 44980084933](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44980084933) (all 4 jobs), [WP1 44980084934](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44980084934) (both jobs), [WP2 44980084953](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44980084953) (real Auth/JWT manual journal positive path), [Security 44980084871](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44980084871) (CodeQL + safety PASS; conditional Dependency review SKIPPED). PR224 remains DRAFT, not merged/published, Codex main independent review pending.
487 +- **Correction with preserved history:** prior QA description of `finora_journal_autopost` missed later replacement migration `supabase/migrations/20261117110000_wp1_autopost_source_link_atomic.sql`. The *effective* function **atomically** writes an already-persisted sale/purchase source link and posts its journal voucher in one RPC transaction, including recovery by persisted source identity/version; it is already verified in narrow mock/SQL evidence. The earlier 20261016102000-only inference was wrong. A dated correction was recorded in PR218 comments; do NOT recreate or replace this useful existing feature. Separate source creation/sync before posting and draft-first independent finalization remain unproven against Issue216.
488 +- **Exact Stage C QA decision:** new *independent* branch `qa/source-autopost-jwt-atomicity-20261122` from PR224 green SHA. Modify ONLY synthetic WP2 Auth/PostgREST test, its workflow path filter, and existing canonical status documents. Test the effective sale source `autopost` with a real user JWT, replay with a DIFFERENT request ID for same source version, competing simultaneous requests, rollback injected at the source-link update after voucher creation/posting, and ledger/source audit integrity. Preserve PR224 green head and PR218/221 owner-held SQL/JS. No migrations, financial production code, production access, deployed data, schema, sensitive values or trigger changes in the repo.
489 +- **Acceptance:** actual RED/GREEN evidence on exact QA SHA in disposable Supabase; no interpretation of a failed, skipped or pending CI as pass. This tests source+posted-voucher linkage for already-persisted sources only; independent draft-first lifecycle, permanent ATF, cheque, company/year numbering, historic conversion, source create/update/delete atomics still open. Codex-main final reviewer/integration authority.