@davoodmehraban89 / Factor-easy / commits / 5dede62
Fork 0

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

docs(finora): record security tripwire QA scope before implementation

davoodmehraban89 committed Nov 22, 2026 at 20:59 UTC 5dede62ee5f21835aed958bd43c9150ce5ccfa8b
1 file changed +7
PROJECT_STATE.md
+7
@@ -694,3 +694,10 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
694 - **QA correctness correction in the same Draft PR236:** Node v22.16.0 `node:test` was independently probed: a **passing** `test.todo` callback still reports `TODO` with exit code 0, just as a failing callback does. Therefore the earlier pair of executed TODO callbacks alone does not force review if the product later fixes its retry identity. This is a real test-contract blind spot, not a new product defect.
695 - Added two **ordinary PASS, clearly named QA fingerprint sentinels** in `scripts/journal-rpc-adapter.test.mjs`, one for sale and one for purchase. Each independently runs the ambiguous-response/one-voucher replay harness and asserts the *currently known divergence only as a defect fingerprint*; if stable identity is ever observed, the normal PASS sentinel **fails CI** with the explicit demand to **remove the TODO and make equality an ordinary PASS assertion**. The TODO contract still asserts the actual desired stable ID and still records the known RED. This pattern is for safe xfail triage only; it must never be counted as product acceptance.
696 - This one small test-only change and append-only status documents form a **new SHA**: earlier Quality/WP1/WP2/Security on `1d5adf7...` belong only to the previous state. Validate all triggered final-HEAD workflows before claiming any new result; no finance runtime, SQL/RPC, permissions, main or production changes.
697 +
698 +
699 +### 2026-11-22 — FIN-QA-ID-RPC-TRIPWIRE / pre-code owner continuation
700 +- **New owner continuation scope:** strengthen the **existing** `scripts/accounting-history-migration-guard.mjs` and its existing test file, not build a new SQL/RPC implementation or a second financial lifecycle. Existing QA [PR236](https://github.com/davoodmehraban89/Factor-easy/pull/236) head `19a0e1dba4040266f811bad056ad1e5ed7daa1c9` already has four exact-SHA green gates and remains Draft. Start isolated QA-only child branch `qa/finora-identity-rpc-security-tripwire-20261122` from that exact SHA; base to PR236, never main.
701 +- **Evidence-triggering defect candidate:** static review of nonmerged [PR219](https://github.com/davoodmehraban89/Factor-easy/pull/219) at `ab14e46abec4b8ef1f36c4f219d9a9ba6d99bc6d` identified three independently reviewable hazards: (1) `SECURITY DEFINER` public identity RPCs directly GRANTed to authenticated with caller-controlled `p_actor` written to financial audit; (2) directly callable registry-only posted-state transition bypassing actual balanced/versioned fiscal journal posting; (3) publicly callable reservation of ATF to a voucher not verified against persisted org/company/fiscal draft. Existing [PR219 review](https://github.com/davoodmehraban89/Factor-easy/pull/219#issuecomment-7082845441) and [Issue216 handoff](https://github.com/davoodmehraban89/Factor-easy/issues/216#issuecomment-7082849834) are **source-only findings**, not proof of deployed exposure.
702 +- **Proposed bounded QA task:** add conservative, comment-stripping migration-diff heuristics that flag these *newly added/changed* public identity-RPC shapes and tests covering a PR219-shaped sample, safe private helper, legitimate ordinary journal posting, existing historic posted→draft tripwire, git base-to-head and fail-closed CLI. Reuse the **existing Security workflow invocation**; no workflow or migration changes expected. Avoid false claim of full SQL semantic proof. Explicitly label manual review required. If a test indicates accidental false positive on current code or fixture, correct the heuristic rather than masking the failure.
703 +- **Safety/acceptance:** no production DB access, SQL DDL/DML, server RPC code, auth/grants, historical data, `main`, merge or deployment. Validate actual new PR HEAD's Quality, WP1, WP2 and Security separately (Security tripwire on 0 changed migrations still must show PASS). Existing Issue216/229 product blockers stay OPEN and percentages unchanged.
\ No newline at end of file