@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / 69846ba
Fork 0

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

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

Synced Dec 3, 23:15 UTC

docs: pre-record ADR216 source identity preflight evidence scope

davoodmehraban89 committed Nov 22, 2026 at 09:39 UTC 69846ba31ea217bc099474186b30f24f28b6516a
1 file changed +6
PROJECT_STATE.md
+6
@@ -527,3 +527,9 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
527 - **Exact QA SHA:** PR230 `dec68c030189b0d6733443f8f3a6e1715844346f`, stacked on immutable PR228 `ae6a0557d575389853c4545ca99ec57c8015a0e0`. [Quality 44988270042](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44988270042) SUCCESS (253/253 browser tests, 4/4 generated Pages checks, three DB jobs); the two Issue229 cases were invoked and intentionally reported expected failures at their financial assertions through `test.fail`. [WP1 44988270066](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44988270066) SUCCESS (both jobs); [Security 44988270049](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44988270049) SUCCESS (CodeQL + release-safety; conditional Dependency Review SKIPPED). WP2 was not triggered by this spec/docs-only change.
528 - **WP1 inspectable artifact:** `wp1-disposable-ledger-evidence` (artifact 14741081943). Isolated source-derived PostgreSQL 17 applied 22 staged migrations; all 19/19 WP1 SQL tests and two-session concurrency passed. Seeded property suite created 1,000 events across two organizations, verified balanced originals/reversals, and no cross-org leakage. Correction UP/DOWN/UP, reversal-dimension, manual-guard, NULL-revision, graph-read, two-session graph-snapshot, and conservative full-candidate DOWN/UP checks passed. Full candidate rollback restored baseline functions/ACLs/triggers and retained synthetic rows. Scope caveats: this is **not** a production clone or real Auth/JWT/PostgREST acceptance; correction-only DOWN retains new counters/helpers and is not a pristine schema rollback; the ATF allocator tested in local stack is still a candidate, not proof of production integration.
529 - **Product decision unchanged:** Issue229 and ADR216 remain OPEN; PR228 and PR230 remain Draft/unmerged; main remains `dab1a45fcfc4f12e675cfe055e477138cd3e99fa`. No product JS, migration, hosted database, production data, merge or deployment changed. The two expected-RED tests are acceptance evidence, not a fix. Codex-main must implement the single atomic source-linked draft CRUD/tombstone + independent authorized finalize contract, then remove `test.fail` and prove normal browser + real-JWT acceptance. Preserve existing manual-only guards and atomic posted-source autopost; do not build a parallel engine.
530 +
531 +### 2026-11-22 — FIN-ADR216-SOURCE-IDENTITY-PREFLIGHT (decision BEFORE implementation)
532 +- **Verified existing exact HEAD:** Draft PR230 `0f0368a302e9a33487caeb0c677c61a9165a5b36` Quality `44989388200`, WP1 `44989388213`, Security `44989388210` all completed SUCCESS; WP2 not triggered on this SHA (PR228 earlier WP2 `44986537948` SUCCESS). Main `dab1a45fcfc4f12e675cfe055e477138cd3e99fa`; PR230 and PR228 unmerged, Issue229 and ADR216 still OPEN.
533 +- **New specifically proven PRE-MIGRATION coverage hole, not another posting engine:** Existing read-only `scripts/sql/draft-conversion-inventory.sql` + isolated PostgreSQL test cover voucher graph but not source-only `invoices`/`purchases`, stale forged source links, source-linked draft status disagreement, duplicated generated draft identities (currently posted-only uniqueness), or generated vouchers with missing sources. The existing inventory's source join and child joins also correlate some records by `owner_id` alone without `organization_id` — a potential cross-org audit mismatch if one owner belongs to two orgs. No production defect or production-row counts claimed.
534 +- **Bounded implementation:** extend only the EXISTING read-only inventory SELECT to include **aggregate-only** `sourceIdentityAudit` counts for the two supported financial source kinds, and scope all source/child matches by organization, owner and source identity. Extend the EXISTING isolated PostgreSQL inventory test with synthetic source-only, dangling/wrong-link, duplicate draft, orphan journal and multi-org same-owner collision cases. Keep existing `journals` item shape, opaque keys and `financialFingerprint` stable for private compatibility; never emit source IDs, owner IDs or commercial payload in the additional aggregate. No schema migration, DDL/DML in application, Auth/RLS/grants, production reads/writes, or owner-held JS changes.
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.