سامانه صدور فاکتور و حسابداری
docs(finora): record verified retry-ID expected RED and exact CI boundaries
davoodmehraban89 committed
Nov 22, 2026 at 20:23 UTC
1d5adf7da159e997f3541eba0dc80263bceace0f
3 files changed
+23
PROJECT_STATE.md
+6
@@ -683,3 +683,9 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
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.
686
+
687
+### 2026-11-22 — FIN-QA-RETRY-ID / verified exact-code QA evidence; docs successor
688
+- [Draft PR236](https://github.com/davoodmehraban89/Factor-easy/pull/236) initial QA code at `79bf54020e07c1406690afd8e6ab924af329b48d`; examined exact docs head `e72b92844695897457020e68ef4bd0918eb4c432`. [Quality 45045339870](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45045339870) **SUCCESS**: `scripts/journal-rpc-adapter.test.mjs` reports `# tests 27, # pass 25, # fail 0, # skipped 0, # todo 2`; both TODO callbacks **actually executed** and failed on exact `JV_2 !== JV_1` strict equality (sale and purchase), with separate normal-PASS replay/tenant/source/ledger sentinels. Full browser reports `258 passed (3.7m)` and generated Pages `4 passed`. This is QA acceptance of the *defect reproducer*, not product acceptance.
689
+- [WP2 45045339689](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45045339689) **SUCCESS** with live disposable real-JWT manual positive proof AND still-**unfixed** `FINORA_ISSUE229_APPROVAL_EXPECTED_RED` / `FINORA_ISSUE229_PURCHASE_APPROVAL_EXPECTED_RED`: non-owner commerce:create-only seller actually POSTs sale and credit purchase. [Security 45045339639](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45045339639) **SUCCESS** (Dependency review SKIPPED). [WP1 45045339727](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45045339727) was **IN PROGRESS** on the exact code/docs head at this checkpoint; local Supabase job SUCCESS, ledger job ongoing. A completed verdict cannot be claimed from this checkpoint.
690
+- Source-grounded root: `js/journal-rpc.js::jeRpcAutoPostOnce` allocates `p_voucher_id:afId('JV')` anew at each invocation, whereas manual `jeRpcCreateDraft` has an existing `jeRpcPendingCreate` reuse mechanism. Effective server `20261117110000_wp1_autopost_source_link_atomic.sql` currently replays a prior committed source/version and may avoid duplicates, but the client still violates ADR216's stable idempotency identity and loses its identity after ambiguous response/reload. **Do not build a second server autopost engine**. Codex-main should design a stable org/company/source/version-scoped request identity, safe on ambiguous response, rejection, account switch and reload; then turn both TODOs into normal PASS with real DB/PostgREST proof.
691
+- This follow-up updates the existing roadmap and execution-status files **in one docs-only commit** after the QA-code SHA. Its newly triggered CI must be verified on the new final SHA separately; previous CI success must not be reattributed. No financial source, SQL migration, Auth/RLS, production data, protected main, merge or deployment was changed. Issue216/229 remain open, six-phase estimates A90/B50/C20/D55/E53/F10 unchanged.
docs/ACCOUNTING_CORE_ROADMAP_V1.md
+9
@@ -468,3 +468,12 @@ This register maps execution stages A/B to the **existing** accounting Phase 6 (
468
- **QA accepted as an Issue229 purchase+sale defect reproducer only:** Draft [PR231](https://github.com/davoodmehraban89/Factor-easy/pull/231), code SHA `bd244962915824d0ad825e99b5cda4d530f18402`. Exact-head [Quality 45019982985](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45019982985), [WP1 45019983033](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45019983033), [WP2 45019982974](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45019982974) and [Security 45019982983](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45019982983) ALL SUCCESS (Dependency Review conditional skipped). QA contained 253 browser passes with two issue229 `test.fail` known RED cases.
469
- **Live JWT evidence:** The restricted non-owner seller with `commerce:create` but no `accounting:approve` can post BOTH sale and credit-purchase source through existing `finora_journal_autopost`. The purchase probe checks durable single linked voucher, balanced expense/payable 170/170, audit attribution and number allocation. Both `FINORA_ISSUE229_APPROVAL_EXPECTED_RED` and `FINORA_ISSUE229_PURCHASE_APPROVAL_EXPECTED_RED` markers were observed in one successful WP2 run. This means **authorization lifecycle NOT accepted**, not a financial-system fix.
470
- **Exit criteria unchanged:** preserve posted history/ATF/tombstones; transactionally create/edit/delete source+linked draft; disallow create-only user Finalize including old RPC; independent approver JWT must Finalize once with versions and audit; then ordinary browser/JWT tests PASS without `test.fail`, plus rollback/replay/concurrency/tenant checks. Codex-main owns code/integration; no main merge, release or Production changes. Follow-on documentation commit head must have its own exact-SHA check status; do not transfer code SHA check conclusions.
471
+
472
+### ۲۰۲۶-۱۱-۲۲ — FIN-QA-RETRY-ID (پیوست وضعیت به Phase 6/8، بدون تغییر شماره فازها)
473
+
474
+| شناسه | هدف | مسئول | وابستگی | وضعیت | معیار پذیرش | PR/SHA | شاهد | اقدام بعدی |
475
+|---|---|---|---|---|---|---|---|---|
476
+| FIN-QA-RETRY-ID | اثبات نقص پایداری شناسهٔ درخواست پس از قطع پاسخ autoPOST در خرید و فروش | QA مستقل؛ Codex اصلی بازبین نهایی | PR234، ADR216، `scripts/journal-rpc-adapter.test.mjs` | پذیرفتهشده در تست تشخیص نقص؛ نه منتشرشده | دو سناریوی replay عادی PASS، دو TODO واقعی در مقایسهٔ `JV_2 !== JV_1`، بدون skip یا شکست fixture؛ گیتها روی SHA نهایی | [PR236](https://github.com/davoodmehraban89/Factor-easy/pull/236)، QA HEAD `e72b92844695897457020e68ef4bd0918eb4c432` پیش از commit نهایی سند | [Quality 45045339870](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45045339870) ۲۵ PASS/۲ TODO، ۲۵۸ مرورگر/۴ Pages؛ [WP2 45045339689](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45045339689) و [Security 45045339639](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45045339639) SUCCESS؛ [WP1 45045339727](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45045339727) هنگام ثبت در جریان | Codex اصلی باید دادهٔ درخواست را روی org/company/source/version در retry پایدار کند و با آزمون HTTP/DB اثبات کند؛ سپس TODO به PASS واقعی تبدیل شود |
477
+| FIN-P0-RETRY-ID | رفع نقص تولید `p_voucher_id` جدید در هر فراخوانی پس از نتیجهٔ نامطمئن | Codex اصلی (مالک کد مالی) | FIN-QA-RETRY-ID، پایان کار مالی فعال، Issue216 و طرح idempotency | مسدود در محصول | همان شناسه در retry و بعد از reload؛ رد تغییر سازمان/نسخه؛ عدم ثبت دوباره و تراکنش rollback؛ بررسی مستقل | PR محصول هنوز ایجاد نشده | `js/journal-rpc.js::jeRpcAutoPostOnce` اکنون `afId('JV')` داخل هر درخواست اجرا میکند؛ تست متضاد قدیمی اصلاح شد | انتخاب کوچکترین اصلاح توسط مالک؛ هیچ موتور موازی یا تغییر تاریخی اجرا نشود |
478
+
479
+**حد و مرز:** موفقیت QA در کشف خطا به معنی پذیرش محصول نیست. P0 مجوز مستقل قطعیسازی Issue229 نیز همچنان باز است. نسبت پیشرفت فازها از این ثبت افزایش نمییابد.
docs/EXECUTION_STATUS.md
+8
@@ -1,5 +1,13 @@
1
# وضعیت اجرای فینورا
2
3
+### ۲۰۲۶-۱۱-۲۲ — FIN-QA-RETRY-ID؛ نقص واقعی شناسهٔ ثابت درخواست پس از قطع پاسخ
4
+- **هدف جاری:** تثبیت و تحویل QA مستقل برای قرارداد replay در فروش/خرید؛ مالک اصلاح کلاینت و هسته مالی **Codex اصلی** است، بدون تغییر موازی `js/journal-rpc.js` و RPC/SQL.
5
+- **انجامشده و شواهد:** در [PR236 Draft](https://github.com/davoodmehraban89/Factor-easy/pull/236)، تست گمشدن پاسخ پس از commit، برای فروش و خرید با سناریوی مستقل اجرا شد. [Quality 45045339870](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45045339870) **SUCCESS** روی SHA `e72b92844695897457020e68ef4bd0918eb4c432`: مجموعه RPC **۲۵ PASS، ۲ TODO واقعی و ناموفق، ۰ FAIL خارج از TODO، ۰ SKIP**. لاگ واقعی هر دو `JV_2 !== JV_1` و نشانگرهای `FINORA_ISSUE216_RETRY_ID_EXPECTED_RED sale/purchase` را نشان میدهد؛ مرورگر ۲۵۸ PASS، Pages چهار PASS. QA روی **نقص جاری** موفق است، نه محصول.
6
+- **امنیت/سرور:** [WP2 45045339689](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45045339689) **SUCCESS**؛ اما دو شاهد واقعی JWT `FINORA_ISSUE229_APPROVAL_EXPECTED_RED` برای فروش و خرید باقیاند. [Security 45045339639](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45045339639) **SUCCESS** (Dependency review skipped). [WP1 45045339727](https://github.com/davoodmehraban89/Factor-easy/actions/runs/45045339727) در آخرین بررسی **در جریان** است؛ نتیجه نهایی بررسی شود.
7
+- **باقیمانده/مانع:** درخواست autoPOST در `js/journal-rpc.js::jeRpcAutoPostOnce` در retry شناسهٔ نو میسازد. قرارداد source+linked DRAFT و مرز `accounting:approve` نیز مستقل از این نقص باز هستند. اصلاح موتور و سرور فقط در اختیار Codex اصلی؛ نه در این PR.
8
+- **اقدام دقیق بعدی:** کنترل CI روی **SHA نهایی پس از ثبت مستندات**؛ سپس بازبینی مستقل و پیادهسازی درخواست پایدار در `js/journal-rpc.js` با آزمون بازیابی پاسخ نامطمئن، تغییر سازمان/شرکت، reload، rollback و replay واقعی. هر دو TODO باید بعد از اصلاح **PASS عادی** شوند؛ موفقیت CI یا حفظ آنها مجوز انتشار نیست.
9
+
10
+
11
### ۲۰۲۶-۱۱-۲۲ — آزمونهای موردانتظار RED برای Issue229
12
- **مبنای محفوظ:** PR228 SHA `ae6a0557d575389853c4545ca99ec57c8015a0e0` چهار گیت موفق (Quality `44986537956`، WP1 `44986538027`، WP2 `44986537948`، Security `44986537938`). مسیرهای آزمودهشده مستقیماً قطعی میکنند و draft-first را اثبات نمیکنند.
13
- **کاندیدای جدید:** افزودن دو تست `test.fail` صریح در اسکریپت Playwright موجود: یک کلیک واقعی خرید که نباید خودش سند قطعی ایجاد کند و باید منبع+سند حسابداری موقت را ذخیره کند؛ و یک کنترل وضعیت سند موقتِ دارای پیوند در فروش و خرید. هدف دریافت **شکست موردانتظار روی assertion مالی** است؛ قبولی کلی CI بهمعنی رفع نقص نیست. اگر خطای setup رخ دهد، باید fixture اصلاح شود و آن را RED مالی ننامیم.