Skip to content

Commit b792eac

Browse files
committed
feat(verify): provable CI for the type-checker + render the Zig FFI
Slice 3 — propagate the chapeliser "provably-real + honest" pattern to typedqliser (the #1 -iser priority). Provable — add .github/workflows/provable.yml: - golden-check: the SQL type-checker ACCEPTS valid queries and REJECTS invalid ones (blog-api example; verified locally — good pass, bad fail at L1/L2/L3). The headline value, machine-checked. - zig-ffi: `zig build test` the C-ABI FFI (Zig 0.14, SHA-pinned action). Make the Zig FFI real — it shipped as an UNRENDERED RSR template: - render {{project}}/{{PROJECT}} -> typedqliser across build.zig, src/main.zig, test/integration_test.zig. - build.zig: drop `lib.version` (versioned .so panics in Zig 0.14's InstallArtifact) and add linkLibC() (main.zig uses std.heap.c_allocator) — the same fixes proven on chapeliser. Honest docs — the README sold an "Idris2 type kernel" as "the core", but there are zero .idr files (src/abi/ is 54 lines of Rust): - reframe the level model as proof OBLIGATIONS enforced in Rust today, with the Idris2 kernel specified-but-unimplemented. - fix the Zig FFI path and the Status paragraph. Rust layer unchanged (116 tests). The golden type-checker is verified locally; the Zig build is CI-gated (no zig mirror reachable in the sandbox). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mbq6yKF9RhFai6EQ7WqKhQ
1 parent 7232886 commit b792eac

6 files changed

Lines changed: 504 additions & 86 deletions

File tree

.github/workflows/provable.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Provable — machine-checks the claims TypedQLiser makes beyond unit tests.
3+
#
4+
# 1. golden-check — the type-checker ACCEPTS valid SQL and REJECTS invalid SQL
5+
# (the blog-api example: good-queries pass, bad-queries fail at L1/L2/L3).
6+
# 2. zig-ffi — the Zig C-ABI FFI builds and its unit tests pass.
7+
#
8+
# The Rust layer itself is covered by rust-ci.yml.
9+
name: Provable
10+
11+
on:
12+
push:
13+
branches: [main, master, "claude/**"]
14+
pull_request:
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
golden-check:
21+
name: TypedQL — accepts good SQL, rejects bad
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 15
24+
steps:
25+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
26+
- name: Build
27+
run: cargo build --quiet
28+
- name: Positive — a valid query type-checks (exit 0)
29+
working-directory: examples/blog-api
30+
run: >-
31+
../../target/debug/typedqliser check
32+
-q 'SELECT id, username, email FROM users WHERE id = $1' --ci
33+
- name: Negative — invalid queries are rejected (exit non-zero)
34+
working-directory: examples/blog-api
35+
run: |
36+
set -x
37+
# syntax error (L1) must be rejected
38+
! ../../target/debug/typedqliser check -q 'SELEC * FORM users' --ci
39+
# nonexistent column (L2) must be rejected
40+
! ../../target/debug/typedqliser check -q 'SELECT id, full_name FROM users' --ci
41+
- name: Full example — good passes, bad fails
42+
working-directory: examples/blog-api
43+
run: |
44+
out=$(../../target/debug/typedqliser check 2>&1 || true)
45+
echo "$out"
46+
echo "$out" | grep -q '2 queries checked, 1 passed, 1 failed'
47+
48+
zig-ffi:
49+
name: Zig — build + test FFI
50+
runs-on: ubuntu-latest
51+
timeout-minutes: 15
52+
steps:
53+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
54+
- uses: mlugg/setup-zig@53fc45b17fe98b52f92ee5ea08ff48a85a3e7eb7 # v1.2.2
55+
with:
56+
version: 0.14.0
57+
- name: zig build + test
58+
working-directory: src/interface/ffi
59+
run: |
60+
zig version
61+
zig build test

0 commit comments

Comments
 (0)