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

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

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

Synced Dec 3, 19:30 UTC

docs: record exact-green PR226 and new source-immutability JWT QA scope

davoodmehraban89 committed Nov 22, 2026 at 07:56 UTC f991a8b0ff253d6a81af1229741b257debf92120
1 file changed +7
PROJECT_STATE.md
+7
@@ -497,3 +497,10 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
497 - **Source review / reuse decision:** Issue216 and `docs/adr/0216-draft-first-document-identity.md` require globally monotone immutable non-recyclable ATF per org/company, safe concurrent reservation and tombstones. Existing `supabase/candidates/0216_attachment_registry.sql` plus `supabase/tests/0216_attachment_candidate.sql` are **candidate only**, with a transaction-scoped single-session test already running in WP1. No duplicate allocator implementation is permitted. The narrower missing direct evidence is two live PostgreSQL sessions racing on the same and distinct voucher identities, stable retry ID, conflict across companies and rollback, separately from migration acceptance.
498 - **Approved narrow QA task:** branch `qa/attachment-allocator-two-session-20261122` based on PR225 green HEAD; add only a disposable test runner that loads a **copy of the existing candidate SQL** into a temporary uniquely named schema, drives two real `psql` sessions, asserts exactly-once numbering, company immutability, tombstone and rollback. Wire to existing WP1 local-stack job **after** the pre-existing allocator single-session test, without editing `supabase/migrations`, the candidate allocator, client financial code, RLS, Auth or hosted data. Update existing canonical docs and evaluate CI. Do not claim the isolated candidate is activated in product.
499 - **Exit condition:** WP1 actual success on exact QA SHA with two-session log marker; Quality/Security as distinct same-SHA runs and Codex-main independent review. WP2 is unchanged and should never be claimed tested on the new SHA unless explicitly run. Before merge Codex main must still design and approve permanent ATF integration with historical high-water marks, source linked draft-first lifecycle and deletion, two-phase numbers and migration/rollback. Retain PR225 green head unmodified.
500 +
501 +
502 +### 2026-11-22 — FIN-QA-POSTED-SOURCE-GUARD (owner "continue" request; decision before implementation)
503 +- **Final prior gated state:** PR226 HEAD `4f9a90c9a955800cd0ed83dc0184a5c2e8343a87` [Quality 44983973522](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44983973522) SUCCESS, 251/251 Chromium + 4/4 additional, all DB jobs; [WP1 44983973555](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44983973555) SUCCESS, real 2-session candidate-only ATF proof; [Security 44983973523](https://github.com/davoodmehraban89/Factor-easy/actions/runs/44983973523) SUCCESS (dependency review skipped); WP2 was *not triggered* on this SHA. PR225 earlier `9122b8b8` WP2 `44982300960` SUCCESS separately. PR226 remains Draft and unmerged.
504 +- **Next proved test gap and ownership:** PR225 `scripts/wp2-source-autopost-jwt-e2e.mjs` covers authorized JWT source autopost positive, concurrency, audit and link rollback, but does not attempt **malicious authenticated PostgREST mutation of posted source commercial fields, source deletion, canonical link/status forgery or posted journal line edits**. Supabase current `supabase/migrations/20261117120000_wp1_stage3_canonical_source_link_projection.sql` replaces earlier trigger and protects commercial fields with `private.finora_stage3_guard_posted_source` when guard mode `enforce`; `public.finora_guard_posted_source_records` is separate production guard. Need real E2E with synthetic tenant, JWT, frozen source, and unmodified existing trigger functions. If a requested mutation is denied by RLS only, do not falsely attribute it to the financial trigger.
505 +- **Authorized QA scope:** follow-on branch `qa/posted-source-immutable-jwt-20261122` from prior PR226 exact GREEN. Append exact negative user-JWT REST assertions to **existing** `scripts/wp2-source-autopost-jwt-e2e.mjs`, set isolated fixture mode `enforce` only after existing autopost proofs, require explicit financial guard error when possible, verify source/lines/counter/audit unchanged and owner has read access. Update only existing `PROJECT_STATE.md`, `docs/EXECUTION_STATUS.md`, `docs/ACCOUNTING_CORE_ROADMAP_V1.md`; WP2 path filters already cover this test script. Do not introduce a new equivalent financial engine, change existing migrations, owner-held `sync.js`/`organization-rbac.js`/`journal-ui.js`, touch hosted DB/production or merge/deploy.
506 +- **Acceptance:** exact PR SHA real local WP2 (JWT, authenticated REST negative, readback) with Quality/WP1/Security checking that same SHA; preserve prior SHA as validated fallback. False-positive rejection due to RLS without guard proof or a real 2xx mutation is a failure to investigate, not a PASS. This does not claim draft-first linked source deletion, fully integrated ATF, cheque or Issue216 completion. Codex main final reviewer/integration owner.