-
Notifications
You must be signed in to change notification settings - Fork 0
216 lines (196 loc) · 8.64 KB
/
Copy pathci.yml
File metadata and controls
216 lines (196 loc) · 8.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
economics:
name: Economic simulation gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# pnpm reads its version from `packageManager` in package.json. Passing a
# `version` here as well makes the action refuse to guess between them.
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
# These simulations import each other by package name (@sent/stockback and
# friends), so they need the workspace links even though they run no build.
# They used to work without an install because they reached across
# directories with relative paths — which is exactly the undeclared
# dependency graph that refactor removed.
- run: pnpm install --frozen-lockfile
# Masterplan 9/10: the simulation is a mandatory validation gate.
# A failure here is a BLOCKED escalation, never a tuning exercise.
- name: Reproduce section 8 reference outcomes
run: node --experimental-strip-types packages/economics/sim/reference.ts
- name: Graduation V3 geometry proof
run: node --experimental-strip-types packages/economics/sim/graduation-v3.ts
- name: Stockback TWAB and conservation
run: node --experimental-strip-types packages/stockback/sim/stockback.ts
- name: TWAB edge cases
run: node --experimental-strip-types packages/stockback/sim/twab-edges.ts
- name: Market lifecycle economic gate
run: node --experimental-strip-types packages/economics/sim/lifecycle.ts
- name: Reorg handling
run: node --experimental-strip-types services/indexer/sim/reorg.ts
- name: Freshness contract
run: node --experimental-strip-types packages/realtime/sim/freshness.ts
- name: Attestor determinism
run: node --experimental-strip-types services/stockback/sim/determinism.ts
- name: Realtime gateway
run: node --experimental-strip-types services/realtime/sim/gateway.ts
- name: API handlers
run: node --experimental-strip-types services/api/sim/handlers.ts
- name: Stockback finalizer
run: node --experimental-strip-types services/finalizer/sim/finalizer.ts
- name: Background workers
run: node --experimental-strip-types services/worker/sim/worker.ts
- name: Configuration and environment
run: node --experimental-strip-types packages/config/sim/env.ts
- name: Display formatting
run: node --experimental-strip-types apps/web/sim/format.ts
- name: Chart scale
run: node --experimental-strip-types apps/web/sim/chart.ts
- name: Approval intents
run: node --experimental-strip-types packages/sdk/sim/approve.ts
# §694's last link: the handoff to the wallet.
- name: Transaction handoff
run: node --experimental-strip-types apps/web/sim/tx.ts
# The Dockerfile copies each workspace manifest by name so the dependency
# layer can be cached. A new package that nobody adds there produces an
# image that installs a different graph than the repo declares, and the
# failure surfaces at run time in a container rather than here.
- name: Docker manifest list is complete
run: |
missing=0
for manifest in packages/*/package.json services/*/package.json; do
if ! grep -q "COPY $manifest" infra/docker/Dockerfile; then
echo "infra/docker/Dockerfile does not copy $manifest"
missing=1
fi
done
exit $missing
# The differential fixtures are committed. If TypeScript changed without
# regenerating them, or a regenerated set was not committed, this fails -
# which is exactly the drift 1064 forbids.
- name: Differential fixtures are current
run: |
node --experimental-strip-types packages/economics/sim/fixtures.ts
node --experimental-strip-types packages/stockback/sim/merkle-fixtures.ts
node --experimental-strip-types packages/sdk/sim/intent-fixtures.ts
node --experimental-strip-types packages/economics/sim/v3-fixtures.ts
git diff --exit-code contracts/test/fixtures/
workspace:
name: Typecheck / lint / build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
# Strict mode with noUncheckedIndexedAccess and exactOptionalPropertyTypes.
# This was not wired up until Day 4's audit, which is exactly the kind of
# gap an audit is for.
- run: pnpm typecheck
integration:
name: Projection against PostgreSQL
runs-on: ubuntu-latest
# Every other job runs against pure functions, which left the SQL itself
# entirely unexecuted: a wrong column name or a constraint that fires on the
# happy path is invisible to TypeScript and surfaces in production instead.
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: sent
POSTGRES_PASSWORD: sent
POSTGRES_DB: sent
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U sent -d sent"
--health-interval 5s
--health-timeout 3s
--health-retries 10
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Projection SQL
env:
DATABASE_URL: postgres://sent:sent@localhost:5432/sent
run: node --experimental-strip-types tests/integration/projection.ts
# The seam between the indexer's publisher and the realtime service. Both
# halves had unit coverage and the join between them had none, which is
# where this kind of wiring actually breaks.
- name: Realtime delivery
env:
DATABASE_URL: postgres://sent:sent@localhost:5432/sent
run: node --experimental-strip-types tests/integration/live.ts
# Correctness at scale, not throughput. Nothing is asserted about timing —
# a performance threshold in CI is a flaky test wearing a useful disguise.
- name: Scale
env:
DATABASE_URL: postgres://sent:sent@localhost:5432/sent
run: node --experimental-strip-types tests/load/scale.ts
# "Designed to be safe under contention" and "observed to be safe under
# contention" are different claims. Four workers against one queue.
- name: Contention
env:
DATABASE_URL: postgres://sent:sent@localhost:5432/sent
run: node --experimental-strip-types tests/load/concurrency.ts
# The largest seam in the system: real contracts, real chain, real indexer.
# Foundry supplies anvil; the artifacts come from the contracts job's own
# compiler, so this indexes the same bytecode the test suite ran against.
- uses: foundry-rs/foundry-toolchain@v1
- name: Build contracts
run: forge build --root contracts
- name: Full stack against anvil
env:
DATABASE_URL: postgres://sent:sent@localhost:5432/sent
RPC_URL: http://127.0.0.1:8545
run: |
anvil --silent &
for i in $(seq 1 30); do
if cast block-number --rpc-url http://127.0.0.1:8545 >/dev/null 2>&1; then break; fi
sleep 1
done
node --experimental-strip-types tests/e2e/stack.ts
contracts:
name: Foundry
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: foundry-rs/foundry-toolchain@v1
- name: Build
run: forge build --root contracts
# Informational only (D-008): every current hit is a test or a documented
# design decision. Reviewed as part of the Day 6 quality pass.
- name: Lint (non-blocking)
run: forge lint --root contracts || true
- name: Unit + fuzz
run: forge test --root contracts -vvv
- name: Invariants
env:
FOUNDRY_PROFILE: inv
run: forge test --root contracts -vvv
- uses: actions/setup-node@v4
with:
node-version: 22
# Replays the logs the Foundry run just captured through the production
# reducer, proving the projection reproduces on-chain state (138).
- name: Projection replay proof
run: node --experimental-strip-types services/indexer/sim/projection.ts