سامانه صدور فاکتور و حسابداری
docs: record reversed-source projection preflight correction before code
davoodmehraban89 committed
Nov 22, 2026 at 09:47 UTC
03cd2a0ba1512e6d1eac9a74c37691e825a9026d
1 file changed
+2
PROJECT_STATE.md
+2
@@ -535,3 +535,5 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
535
- **Acceptance:** exact saved SELECT executes on disposable PostgreSQL; original journal-graph cases retain PASS, new synthetic counters detect missing/orphan/duplicate and ignore cross-org lookalikes, financial fingerprints/read-only behavior unchanged. Require a new exact-head Quality + WP1 + Security verdict (WP2 only if genuinely triggered). A safe preflight is NOT authorization to backfill, convert historical posted records, integrate ATF or declare Issue229 fixed. Maintain PR230 Draft and parent SHA immutable.
536
537
- **2026-11-22 pre-implementation integration refinement:** The first SELECT+isolated test candidate `717b0ebbf71fd76813e3bfb1724c567f3dcc950c` passed the real GitHub Quality step `Draft conversion inventory on isolated PostgreSQL` (Quality run 44992593097; full suite still running at this checkpoint). The existing operator CLI `scripts/draft-conversion-preflight.mjs` currently prints only journal aggregates and its scope text falsely says no source-only coverage. Complete this SAME narrow preflight task by adding a strictly allowlisted aggregate-only sourceIdentityAudit projection to that existing CLI, fail closed with exit=2 for absent/unsafe/problematic source-audit metrics (never mark cutover executable), and test those exits in the existing inventory test. Historical private snapshot compatibility: missing new source counts must be flagged as requiring a refreshed snapshot, not silently called ready. Do not introduce alternate auditor, product SQL migration, production connection, financial code or source data.
538
+
539
+- **2026-11-22 safety review before acceptance:** A legitimately reversed sale/purchase source can have `documentStatus=accountingStatus='reversed'` even when its original historical journal voucher stays `status='posted'` (compensating reversal preserves the original). The new posted-source projection audit must accept this matched reversed pair rather than produce a false orphan/status incident. Revise only the aggregate `postedProjectionMismatches` predicate and add a synthetic reversed-source regression before accepting the final QA SHA; source/tombstone/posted history unchanged.