Skip to content

Commit 6895d36

Browse files
feat(ffi): Zig FFI consumer demo + CI lane (#6) (#23)
De-templates ffi/zig from the {{PROJECT}} skeleton and proves the C-ABI contract with a linking consumer. - build.zig: ported to the Zig 0.15.x module API (b.addLibrary / b.createModule), dropped the dead header/bench/docs/integration steps that referenced nonexistent files, link_libc (the FFI uses std.heap.c_allocator), and added `test` / `consumer` / `check` steps. - src/main.zig: added the OctadDimension + ProvenanceEntry extern structs and verisimdb_data_{octad,provenance}_{encode,decode} with a lossless wire format. Fixed two latent template bugs that blocked any build: `Handle` was `opaque` *with fields* (now a struct; still opaque to C behind ?*Handle), and `callconv(.C)` → `callconv(.c)` (0.15 rename). Added 5 round-trip/negative unit tests. - test/octad_consumer.zig: NEW standalone executable that linkLibrary()s the FFI and round-trips both structs across the boundary (incl. a short-buffer negative path); exits non-zero on any mismatch. Replaces test/integration_test.zig, which was an uncompilable {{project}} template stub. - .github/workflows/zig-ffi.yml: CI lane; Zig pinned by tarball sha256 (no third-party action — Scorecard pinned-deps clean) running `zig build check`. Local: `zig build check` → 7/7 unit tests pass; consumer prints "PASS: verisimdb-data FFI v0.1.0 — OctadDimension + ProvenanceEntry round-trip OK". Closes #6. Co-authored-by: hyperpolymath <hyperpolymath@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent d9d2ccd commit 6895d36

0 file changed

File tree

    0 commit comments

    Comments
     (0)