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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
name: CI
on:
push:
branches:
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
fmt:
name: Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust 1.95.0
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.95.0
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
clippy:
name: Clippy Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust 1.95.0
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.95.0
components: clippy
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v5
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-git-
- name: Cache target directory
uses: actions/cache@v5
with:
path: target
key: ${{ runner.os }}-target-clippy-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-target-clippy-
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust 1.95.0
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.95.0
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v5
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-git-
- name: Cache target directory
uses: actions/cache@v5
with:
path: target
key: ${{ runner.os }}-target-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-target-test-
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Run tests
# x0x_0041_synthetic_kill_restart is a documented timing-flaky test
# (500ms kill/restart bound) — filtered in CI as it is in local dev
# runs. Tracked separately; do not let it gate unrelated PRs.
# NB: `binary()` (test-binary name), not `test()` — `test()` would
# match the test function name, which is different from the binary.
run: cargo nextest run --all-features --workspace -E '!binary(x0x_0041_synthetic_kill_restart)'
- name: Upload test results
if: always()
uses: actions/upload-artifact@v5
with:
name: test-results
path: target/nextest/
coverage:
name: Coverage Gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust 1.95.0
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.95.0
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v5
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-git-
- name: Cache target directory
uses: actions/cache@v5
with:
path: target
key: ${{ runner.os }}-target-coverage-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-target-coverage-
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run line coverage gate
# Filter timing-flaky binaries that flake only under llvm-cov's ~3x
# instrumentation slowdown — a flake here must not abort the whole
# coverage computation:
# * x0x_0041_synthetic_kill_restart — documented, matches Test Suite.
# * x0x_0041_prefer_newest_test — sibling binary; the
# direct_send_reissues_on_replaced_connection_within_500ms test's 2s
# lifecycle_deadline is exceeded under coverage contention (#148).
# Same class as #139; excluded here only — keeps running in the Test
# Suite + integration tiers (binary()-scoped, not test()-scoped).
# * named_group_join_metadata_event — gossip-convergence forgery tests
# (e.g. forged_member_joined_*) poll a rejection counter that can
# exceed the wait window under coverage; the same code paths are
# covered by named_group_integration + the x0xd unit tests.
#
# Coverage ratchet (issue #124, plan WS1.3). The floor is the kill
# switch: it must sit just below *current* actual so a coverage
# regression fails CI before it merges. Bump cadence: raise this floor
# +3–5 percentage points every release toward the 70% target. Each
# ratchet bump MUST be accompanied by targeted tests (priority order:
# exec ACL denial paths → auth middleware → storage/identity error
# paths → shutdown ordering) or a documented entry in
# docs/coverage-exclusions.md — never lower the floor to make a red
# run green.
# tranche 1 (#140): 48 → 65.0 (auth-matrix; actual 66.46%)
# tranche 2 (#141): 65.0 → 65.6 (exec-ACL denials; actual 66.61%)
# tranche 3 (#124): 65.6 → 65.7 (storage/identity errors; actual 66.70%)
run: |
cargo llvm-cov clean --workspace
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info --fail-under-lines 65.7 nextest -E '!binary(x0x_0041_synthetic_kill_restart) & !binary(x0x_0041_prefer_newest_test) & !binary(named_group_join_metadata_event)'
python3 scripts/check-coverage-thresholds.py --lcov lcov.info --thresholds coverage-thresholds.toml --enforce-global
- name: Upload LCOV report
if: always()
uses: actions/upload-artifact@v5
with:
name: lcov-info
path: lcov.info
if-no-files-found: error
doc:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust 1.95.0
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.95.0
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v5
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-git-
- name: Cache target directory
uses: actions/cache@v5
with:
path: target
key: ${{ runner.os }}-target-doc-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-target-doc-
- name: Build documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --all-features --no-deps
parity:
# Phase 7 parity gate. Surfaces a focused subset of the test suite
# that proves the named-groups (and broader API) surface stays in
# sync across CLI, embedded GUI, REST, and the api-manifest. These
# tests are fast (<30 s) and need no daemon — they are deliberately
# separated from the broader `test` job so a parity regression
# surfaces immediately without waiting for the workspace nextest.
#
# Adding a new endpoint to `src/api/mod.rs::ENDPOINTS` will fail
# this job until:
# - tests/api_coverage.rs is updated (REST handler exists + tested)
# - the CLI handler exists in src/bin/x0x.rs (parity_cli)
# - the embedded GUI either calls it or lists it in
# tests/gui_named_group_parity.rs::DEFERRED with a reason
# - docs/design/api-manifest.json is regenerated
name: API + GUI Parity Gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust 1.95.0
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.95.0
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v5
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-git-
- name: Cache target directory
uses: actions/cache@v5
with:
path: target
key: ${{ runner.os }}-target-parity-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-target-parity-
- name: Install nextest
uses: taiki-e/install-action@nextest
# parity_cli spawns `x0x <cli_name> --help` so the binary must
# exist. Build only what's needed.
- name: Build x0x CLI binary
run: cargo build --bin x0x --all-features
- name: Run parity gate
run: |
cargo nextest run --all-features \
--test api_manifest \
--test parity_cli \
--test api_coverage \
--test gui_smoke \
--test gui_named_group_parity
- name: Upload GUI coverage report
if: always()
uses: actions/upload-artifact@v5
with:
name: gui-named-groups-coverage
path: tests/proof-reports/parity/gui-named-groups-coverage.txt
if-no-files-found: ignore