@davoodmehraban89 / VELYQOR / commits / e036210
Fork 0

Intelligence, Advanced Charting & Trading Platform

docs(db): capture two-session PostgreSQL race test proof and remaining live gates

davoodmehraban89 committed Oct 22, 2026 at 23:21 UTC e0362102260ff130c348633cbcafb51ce0c861a4
1 file changed +2 -1
docs/operations/chartnova-atomic-outbox-2026-10-22.md
+2 -1
@@ -34,7 +34,8 @@ Persistent row authorization must be enforced by an approved server-only Neon ro
34
35 - \`db/tests/notification_outbox_invariants.sql\` runs inside \`BEGIN/ROLLBACK\` against a **fresh GitHub Actions PostgreSQL service**. It tests unique enqueue, invalid metadata, claim exclusion, wrong lease token, completion receipt, no duplicate completion, cross-user ACK, early ACK, retry-delay and attempt caps, ambiguous result, expired lease, late worker response, unauthorized SQL state edits, and user isolation.
36 - The existing [CI workflow](../../.github/workflows/ci.yml) already applies \`db/migrations/*.sql\` and runs \`db/tests/*.sql\` in an ephemeral PostgreSQL 18 database. No database connection string or account-level secrets are used.
37 -- Only the CI outcome for the **exact final head SHA** can be recorded as a passed test. Database-level cross-session race tests and real concurrency/load behavior are not inferred from a single-session invariant suite; a separate two-connection stress test is required before production.
37 +- **Two actual concurrent PostgreSQL client sessions passed** in [GitHub Actions run 39843468112](https://github.com/davoodmehraban89/VELYQOR/actions/runs/39843468112), job **120050433647**, using [scripts/check-outbox-concurrency.mjs](../../scripts/check-outbox-concurrency.mjs). The log reported `OUTBOX_CROSS_SESSION_VERIFIED`: two independent enqueues returned the same event ID, exactly one database row was stored, a second Worker-style connection skipped the locked row, no second claim followed commit, and attempt count remained 1. The test **refuses to run outside `CI=true`, `velyqor_test`, `localhost`**. This is stronger than the single-connection invariant suite but **NOT** a high-volume/live-Neon proof or guarantee of recipient delivery.
38 +- Only the CI outcome on the **exact final head SHA** should be declared as final. Further production safety checks require actual tenant authorization, source licensing, an independent reviewer and measured failover; no live-data testing was conducted.
39 - Main workflow is unchanged, so the migration remains isolated in this PR until authorized.
40
41 ## Deployment, rollback and incomplete items