Intelligence, Advanced Charting & Trading Platform
ci(risk): verify real PR33 domain modules plus atomic PR34/35 SQL on isolated PostgreSQL
davoodmehraban89 committed
Oct 22, 2026 at 23:39 UTC
17d9694dbc8450deae363c6e46f5d22823d67888
1 file changed
+74
.github/workflows/chartnova-alert-coordination.yml
new
+74
@@ -0,0 +1,74 @@
1
+name: ChartNova staged alert-state coordinator
2
+on:
3
+ pull_request:
4
+ paths:
5
+ - 'db/migrations/0006_alert_runtime_atomic.sql'
6
+ - 'db/tests/alert_runtime_invariants.sql'
7
+ - 'packages/market-domain/src/alert-postgres-coordinator.mjs'
8
+ - 'packages/market-domain/test/alert-postgres-coordinator.test.mjs'
9
+ - 'scripts/check-alert-runtime-concurrency.mjs'
10
+ - 'scripts/test-alert-coordinator-with-pr33.test.mjs'
11
+ - '.github/workflows/chartnova-alert-coordination.yml'
12
+ - 'docs/operations/chartnova-alert-runtime-staging-2026-10-22.md'
13
+ workflow_dispatch:
14
+permissions:
15
+ contents: read
16
+jobs:
17
+ integrated-postgres-and-domain:
18
+ runs-on: ubuntu-latest
19
+ timeout-minutes: 12
20
+ services:
21
+ postgres:
22
+ image: postgres:18
23
+ env:
24
+ POSTGRES_USER: postgres
25
+ POSTGRES_PASSWORD: postgres
26
+ POSTGRES_DB: velyqor_test
27
+ ports: ['5432:5432']
28
+ options: >-
29
+ --health-cmd "pg_isready -U postgres -d velyqor_test"
30
+ --health-interval 5s
31
+ --health-timeout 5s
32
+ --health-retries 10
33
+ env:
34
+ PGHOST: 127.0.0.1
35
+ PGPORT: '5432'
36
+ PGUSER: postgres
37
+ PGPASSWORD: postgres
38
+ PGDATABASE: velyqor_test
39
+ VELYQOR_TEST_DATABASE: velyqor_test
40
+ CHARTNOVA_PINNED_PR33_MODULE_DIR: ${{ github.workspace }}/.tmp-pr33-pinned
41
+ steps:
42
+ - uses: actions/checkout@v4
43
+ with:
44
+ fetch-depth: 0
45
+ persist-credentials: false
46
+ - uses: actions/setup-node@v4
47
+ with:
48
+ node-version: '22'
49
+ - name: Read exact unmerged PR #33 pure-domain module revision without changing repository
50
+ run: |
51
+ git fetch --no-tags --depth=1 origin 52ebe040d661d67d447d20afe5f49769ec7a095b
52
+ test "$(git rev-parse FETCH_HEAD)" = "52ebe040d661d67d447d20afe5f49769ec7a095b"
53
+ mkdir -p .tmp-pr33-pinned
54
+ git show 52ebe040d661d67d447d20afe5f49769ec7a095b:packages/market-domain/src/alert-data-gate.mjs > .tmp-pr33-pinned/alert-data-gate.mjs
55
+ git show 52ebe040d661d67d447d20afe5f49769ec7a095b:packages/market-domain/src/informational-alert-engine.mjs > .tmp-pr33-pinned/informational-alert-engine.mjs
56
+ test -s .tmp-pr33-pinned/alert-data-gate.mjs
57
+ test -s .tmp-pr33-pinned/informational-alert-engine.mjs
58
+ - name: Unit and exact pinned PR33-to-outbox domain integration
59
+ run: node --test packages/market-domain/test/alert-postgres-coordinator.test.mjs scripts/test-alert-coordinator-with-pr33.test.mjs
60
+ - name: Apply schema on ephemeral CI PostgreSQL only; 0005 excluded by policy
61
+ run: |
62
+ for file in db/migrations/*.sql; do
63
+ case "$file" in
64
+ *0005_navasan_private_daily_ohlc.sql) echo 'Blocked migration 0005 cannot run'; exit 1;;
65
+ esac
66
+ psql -X -v ON_ERROR_STOP=1 -f "$file" >/dev/null
67
+ done
68
+ - name: PostgreSQL atomic transaction and consent invariant tests
69
+ run: |
70
+ for file in db/tests/*.sql; do
71
+ psql -X -v ON_ERROR_STOP=1 -f "$file" >/dev/null
72
+ done
73
+ - name: Separate-session CAS race between two simulated Workers
74
+ run: node scripts/check-alert-runtime-concurrency.mjs