سامانه صدور فاکتور و حسابداری
docs: record Stage 1 autopost governance approval gate and separate login P1
davoodmehraban89 committed
Oct 17, 2026 at 09:29 UTC
b9482332d37d5aa81c110b79aa4a99146f51be4e
1 file changed
+9
PROJECT_STATE.md
+9
@@ -98,3 +98,12 @@
98
- GitHub Actions run 38999356580 on exact branch SHA 8ff8357e12f772188e2f7c818778ae2447bbcdc6 concluded SUCCESS. Logs verify deterministic 1000 event seed 20261016 / 2 organizations / 238 full+114 partial reversals, all ledger and tenant property checks; 2-year counter baseline 40->41 and 11->12 with rollback; true 2-connection simultaneous duplicate draft and gapless posts plus same-line partial reversal race (one winner), conservative UP/DOWN/UP (audit/counters/posted original retained), every public/private SECURITY DEFINER searched and none with unsafe path/effective anon/PUBLIC grants, 1069 matching baseline objects and 154 lexical-equivalent function sources.
99
- IMPORTANT QA limitation: scripts/phase1a-positive-client-contract.mjs was PASS 3/3 only because fixture guard was implicitly OFF; that pass CANNOT establish real client compatibility with enforce. Test fixture now sets disposable org to enforce, re-executes same real psql 3 scenarios, and should expose known Stage2 legacy JS incompatibility. Do not remove or mark compatibility green if it fails. Exact new SHA run is PENDING.
100
- Stage 1 server SQL foundation has positive evidence, but source autopost currently guarantees persisted source identity/type, amount and journal sum, NOT fully canonical source-account mappings for each module (Stage 3 risk); full Production readiness, staging browser E2E, actual encrypted backup/restore and Production guard enforce all NOT VERIFIED. Owner-approved work STOP before Stage2 and Stage3, main merge, Production DDL/DML, deployment.
101
+
102
+
103
+### 2026-10-17 — Owner decisions: Stage 1 autopost semantic gates; separate login P1 (approval gate)
104
+- Owner approves Stage 1-only fail-closed design restricted to sale -> purchase checkpoint, then STOP for review; receipt/payment and remaining types are NOT authorized for implementation yet. Server must derive authoritative journal lines from committed source and versioned approved contract; client lines comparison-only. Unknown/unapproved sources reject with FINORA_AUTOPOST_CONTRACT_UNSUPPORTED. No fallback to guessed account codes or JS-derived ledgers. Seeded independent oracle and enforce-asserting red-before-green tests required; no synthetic 900-series accounts in positive tests.
105
+- **HARD PAUSE before implementing postingProfiles / mapping controls:** owner explicitly requires prior report and separate approval of who can configure records, immutable versioned audit and role authorization. Security discovery: postingProfiles currently lives in public.records/accounting module and ordinary authenticated sync insert/update privileges apply through module create/edit policies; no dedicated versioned posting-profile audit proven. Do NOT implement sale/purchase semantics until approved contract governance is resolved.
106
+- Read-only Production aggregate 2026-10-17: nine posted/reversed journal records: six sale and three reversal. Among six sale vouchers, five have same-org/company persisted source and one has no matching source; total canonical semantic-account mismatch remains UNDETERMINED until source-contract version is defined. Historical vouchers must not be revalidated or edited.
107
+- Baseline exact SHA `4f45335aaf20662c6c86bb9e5e74ac6301121ddf`: Actions run 39000286807, job 117301585152, Stage 1 steps 12-28 PASS; legacy positive-client compatibility step 29 RED (three failures), so whole workflow FAILURE. Stage 2 blocked until owner formally accepts Stage 1, regardless of any expected-red split.
108
+- The branch-only Stage 1 guards do NOT protect Production. Until completion/approval of Stage 3 source integration, verified backup and staging tests, separately authorized deployment and Production guard `enforce`, no Production financial protection is claimed. No Production DDL/DML, no main merge, no Phase 1B.
109
+- **پایداری ورود P1 در مسیر جدا.** Login resilience is strictly read-only analysis/design on separate proposed branch `fix/login-resilience-20261017`; do not commit login changes to Stage 1 or deploy without independent owner approval.