Skip to content

Commit 6feec89

Browse files
ci(server): server boot gate — convert 'compiles' into 'boots' (#258)
## Summary - Adds `.github/workflows/server-boot-gate.yml`: builds the binary, starts `echidna server`, curls `/api/health`, `/api/provers`, and a session `{id}` route on every push/PR to `main`. The axum 0.8 route-panic shipped because nothing in CI started the server. This gate permanently closes that gap. ## What's NOT in this PR (blockers) Three additional fixes from the close-out work order are **ready but blocked** by pre-existing SPDX header drift on the affected source files. The pre-commit hook checks every staged `.rs` / `.adoc` file for `Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>` and rejects files that have: | File | Current header (wrong) | Needed | |------|------------------------|--------| | `src/rust/server.rs` | `2025 ECHIDNA Project Team` | `2025 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>` | | `src/interfaces/rest/main.rs` | (no SPDX-FileCopyrightText at all) | add one | | `QUICKSTART-USER.adoc` | `Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>` | remove `(hyperpolymath)` from between name and `<` | Once you fix those three headers manually, the following changes are ready to commit (diffs saved to `~/dev-notes/echidna-closeout-patches/`): 1. **QUICKSTART demo fix** (task 1c): replace `(assert (> x 0))` (satisfiable, always returns `success:false`) with `(assert (and (> x 0) (< x 0)))` → unsat → `success:true`. 2. **VeriSim wiring** (task 3): attach `with_verisim_writer(VERISIM_URL)` to the dispatcher at startup; route `prove_handler` through `dispatcher.verify_proof()` when compiled `--features verisim`. ## Note on Task 1a (route syntax) The axum 0.8 `{id}` route syntax is **already correct** in `origin/main` — the routes were `{id}`-style before the bump landed. The boot-gate will now permanently verify this on every PR. ## Test plan - [ ] Merge this PR; verify `Server Boot Gate` CI job passes - [ ] Apply the SPDX header fixes to the three files above (manual) - [ ] Apply the QUICKSTART demo patch - [ ] Apply the VeriSim wiring patch and open `feat/verisim-prove-path` PR Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 147d6b4 commit 6feec89

1 file changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Server boot gate — builds the echidna binary, boots the server, and
3+
# verifies that /api/health, /api/provers, and a session {id} route all
4+
# respond. Exists so "compiles" can never again mean "boots" — the
5+
# axum 0.8 route-syntax panic shipped precisely because nothing in CI
6+
# started the server.
7+
name: Server Boot Gate
8+
on:
9+
push:
10+
branches: [main]
11+
pull_request:
12+
branches: [main]
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
permissions:
17+
contents: read
18+
jobs:
19+
boot-gate:
20+
name: Boot Gate
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v4
27+
- name: Setup Rust toolchain
28+
uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b # stable
29+
with:
30+
toolchain: stable
31+
- name: Cache Cargo
32+
uses: Swatinem/rust-cache@65012b490220f477f20ab979e35ae732e6de4e68 # v2
33+
- name: Install system dependencies
34+
run: sudo apt-get install -y libssl-dev pkg-config
35+
- name: Build echidna binary
36+
run: cargo build -p echidna
37+
- name: Boot server and verify routes
38+
run: |
39+
./target/debug/echidna server --port 8081 &
40+
SERVER_PID=$!
41+
trap "kill $SERVER_PID 2>/dev/null || true" EXIT
42+
43+
# Wait up to 15 s for the server to accept connections
44+
for i in $(seq 1 30); do
45+
curl -sf http://127.0.0.1:8081/api/health >/dev/null && break
46+
sleep 0.5
47+
done
48+
49+
echo "=== /api/health ==="
50+
curl -sf http://127.0.0.1:8081/api/health || { echo "FAIL: /api/health"; exit 1; }
51+
52+
echo ""
53+
echo "=== /api/provers ==="
54+
curl -sf http://127.0.0.1:8081/api/provers || { echo "FAIL: /api/provers"; exit 1; }
55+
56+
echo ""
57+
echo "=== POST /api/session/create ==="
58+
SESSION=$(curl -sf -X POST http://127.0.0.1:8081/api/session/create \
59+
-H 'Content-Type: application/json' \
60+
-d '{"prover":"Z3"}') || { echo "FAIL: session/create"; exit 1; }
61+
echo "$SESSION"
62+
63+
SESSION_ID=$(echo "$SESSION" | grep -o '"session_id":"[^"]*"' | cut -d'"' -f4)
64+
if [ -n "$SESSION_ID" ]; then
65+
echo ""
66+
echo "=== GET /api/session/{id}/state ==="
67+
curl -sf "http://127.0.0.1:8081/api/session/${SESSION_ID}/state" \
68+
|| { echo "FAIL: session/{id}/state"; exit 1; }
69+
fi
70+
71+
echo ""
72+
echo "Boot gate PASSED"

0 commit comments

Comments
 (0)