@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / 9f8f51d
Fork 0

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

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 4, 08:00 UTC

test(stage2.2): target correction-payment RPC failure by correctsPaymentId and record real-stack proof

davoodmehraban89 committed Oct 18, 2026 at 22:21 UTC 9f8f51d2d613509adfe775dcccaf4df507441b00
2 files changed +9 -1
PROJECT_STATE.md
+7
@@ -162,3 +162,10 @@
162 - PR #162 remains DRAFT [DO NOT MERGE]. Earlier real-stack Run 39149852105 Job 117741077133 Step 8 reached real GoTrue/JWT, local PostgREST, owner-mode RPC, create/post, direct-post and cross-org REST denials, and legacy audit, but FAILED final network assertion: it incorrectly treated **deliberate old-client audit-mode server-owned fields** as if sent by the new enforce client. Strengthened evidence now splits `enforce` (NO server-owned fields, non-vacuous network evidence) from `audit` (expected old-client offending payload **plus** recorded violation), without weakening either condition. New SHA must have green job/artifact before claiming success.
163 - Quality Run 39149855937 failed one 123-case DOM smoke on `accounting-document-workflow.spec.js:628`: failure injector consumed by unrelated autosync. Test-only injector now targets an existing payment **amend** record by CAS version; test assertions (no partial correction, unchanged original) remain intact. Retest required.
164 - Never use a synthetic harness PASS to claim real network/JWT coverage; no Stage 2.3, Production, main merge, Phase 1B or login-work authorization.
165 +
166 +
167 +### 2026-10-18 — Stage 2.2 real-stack proof; Quality corrective fixture gate
168 +- **REAL-STACK SUCCESS at 47d5053f5c1ea6d009c308542fbc6dadd513e5ad**: Run 39155696837, Job 117758347148, steps 5–10, artifact 12147007573. Built _site index (transient build-only local Supabase target), genuine GoTrue JWT + PostgREST + Chromium: password login, owner mode, draft, forged direct POST rejected HTTP 400, cross-org JWT write rejected HTTP 403, balanced posted voucher single number/audit under duplicate click, old-client audit with 3 violation rows, 31 local network requests. `enforce` sync has **no server-owned journal fields**; `audit` deliberately transmits legacy forbidden fields and records violations. Never conflate these modes.
169 +- **HARNESS separately**: Run 39155696761 Job 117758346678 PASS; real-stack does not replace its local SQL/Chromium tests. Stage2.1 canaries 39155696783 PASS, Security 39155701082 PASS (Dependency Review skipped by configuration).
170 +- Quality Run 39155701055 **FAIL** DOM test at `scripts/accounting-document-workflow.spec.js:633` (three DB jobs green). Fixture's amend-failure target mistakenly used existing-payment expected_version>0, whereas `js/payments.js:85–96` creates a NEW correction payment carrying `correctsPaymentId`. The isolated test injector is corrected to target that field without waiving checks. **Re-run Quality must pass before approval.**
171 +- PR #162 still Draft [DO NOT MERGE]. Stage 2.2 not accepted by owner. No Production write/enforce, no main merge, no Phase 1B, no Stage 2.3 and no login-resilience work.
scripts/accounting-document-workflow.spec.js
+2 -1
@@ -27,7 +27,8 @@ async function installHarness(page,server){
27 await page.exposeFunction('qaF0Write',async args=>{
28 server.rpcCount++;
29 // Fail exactly the payment AMEND transaction, never an unrelated autosync RPC.
30 - const paymentAmend=(args.p_upserts||[]).some(row=>row.collection==='payments'&&Number(row.expected_version)>0);
30 + const paymentAmend=(args.p_upserts||[]).some(row=>row.collection==='payments'&&
31 + typeof row.data?.correctsPaymentId==='string'&&row.data.correctsPaymentId.length>0);
32 if(server.failNext&&paymentAmend){
33 server.failNext=false;server.failCount++;
34 return {error:{message:'Network unavailable — isolated QA failure',code:'QA_NETWORK'}};