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

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

docs(finora): checkpoint stable retry-ID expected-red code and CI criteria

davoodmehraban89 committed Nov 22, 2026 at 20:12 UTC e72b92844695897457020e68ef4bd0918eb4c432
1 file changed +7
PROJECT_STATE.md
+7
@@ -676,3 +676,10 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
676 - **Confirmed QA contract discrepancy:** `scripts/journal-rpc-adapter.test.mjs` case `ambiguous auto-post retry reuses source identity and accepts server idempotent replay` currently asserts `assert.notEqual(calls[0].args.p_voucher_id,calls[1].args.p_voucher_id)`, while `js/journal-rpc.js::jeRpcAutoPostOnce` generates a fresh `afId('JV')` at every retry. Stable request/voucher identity after an ambiguous response is required by project instructions and ADR216. Existing server source/version replay may avoid a second voucher, but it does **not** establish a stable client retry token. Do not hide this mismatch under a green test name.
677 - **Narrow QA-only assignment:** preserve the existing successful ambiguous-response replay test as a normal PASS for source scope and linked voucher reconciliation, replace its misleading `notEqual` with extra hard assertions about replay context, and add a *separately executed Node test.todo expected PRODUCT RED* asserting the desired exact stable `p_voucher_id`. Node v22 was verified to execute TODO callbacks and report failing TODOs while keeping unrelated tests enforceable. Add a normal-PASS fixture/sentinel so unexpected states do not hide behind a TODO. Document that TODO is a **known product defect**, not a successful acceptance result. Do not change code in `js/journal-rpc.js`, `js/sync.js`, `js/organization-rbac.js`, `js/journal-ui.js`, SQL, Auth, production, main, or the owned PR234 baseline.
678 - **Acceptance:** syntax and actual `node --test scripts/journal-rpc-adapter.test.mjs` in exact SHA Quality, assert TODO callback executed at intended stable-ID assertion; WP1/WP2/Security exact-head status when triggered; Codex-main independent review before any integration. This is QA-only **no P0 product fix**, progress percentages unchanged.
679 +
680 +### 2026-11-22 — FIN-QA-RETRY-ID / bounded implementation handoff (pre-CI)
681 +- **QA-only code SHA `79bf54020e07c1406690afd8e6ab924af329b48d`** changes only `scripts/journal-rpc-adapter.test.mjs` after the pre-code decision. No production JS/SQL/schema/Auth/RLS/grants/main/merge/release changes.
682 +- Instead of the misleading green `assert.notEqual` for repeated `p_voucher_id`, the previously passing lost-response replay scenario is now covered by **two normal-PASS sentinel tests**, one each for sale and purchase, verifying active organization, source collection/id, company, fiscal year, version, empty caller lines, single linked final voucher, and freeze/reconcile semantics.
683 +- **Two distinctly executed `node:test` TODO cases** make the actual *desired* assertion `assert.equal(second.p_voucher_id,first.p_voucher_id)` under a real lost-response fixture. They print `FINORA_ISSUE216_RETRY_ID_EXPECTED_RED sale` and `... purchase` only when the request identity changes; this is **expected PRODUCT RED, NOT FIXED**. Node v22 was separately verified to execute TODO callback and classify the failing assertion without skipping it. The normal-PASS counterparts must fail closed if the setup or replay behavior changes; do not convert these TODOs to PASS until the engine is actually corrected by Codex-main.
684 +- The server's source/version replay may still return one posted voucher while the client violates stable request ID. This QA item is distinct from Issue229 seller approval bypass and does **not** authorize the current autoPOST lifecycle.
685 +- **Next:** create a Draft stacked PR on PR234 at `bc4f2a8b18b13bea2ab6ffdd333fa883e31dd02a`; inspect exact final SHA Quality's `Authoritative manual journal RPC adapter contracts` step and `# todo 2, # fail 0, # skipped 0` plus markers, and WP1/WP2/Security if triggered. Keep main protected; Codex-main owns final review. QA TODO + CI success is not product success. Earlier FIN-AUDIT PR235 remains separately Draft.