Commit dd49dd3
chore: port the ABI-FFI gate from Python to Julia (RSR-H4: no Python) (#174)
## Summary
Clears the one pre-existing red on the estate's `governance / Language /
package anti-pattern policy` check. `scripts/abi-ffi-gate.py` was the
repo's **last Python file** (RSR-H4 bans Python — Julia for
scripts/data, Rust for systems), and the whole-tree scanner flags it.
Rather than suppress the scanner, this **ports the gate to Julia** and
removes the `.py`, so the check goes green *and* the ABI↔FFI conformance
gate keeps doing its job.
(Follow-up to #173 — this is the cleanup of the lone pre-existing
failure carried on #172/#173.)
## Changes
- **`scripts/abi-ffi-gate.jl`** (new) — a 1:1 Julia port of the former
Python gate (Julia PCRE maps directly onto Python `re`). Same three
checks, same messages, same exit codes:
1. the Zig FFI carries no unrendered `{{...}}` template tokens;
2. every `%foreign "C:<name>"` symbol in the ABI `.idr` sources is
`export fn`-ed by the Zig FFI;
3. the Idris `resultToInt` map and the Zig `Result = enum(c_int)` agree
on **names and values** (`Error`/`err` unified).
- **`.github/workflows/abi-ffi-gate.yml`** — the `ABI ↔ FFI structural
conformance` job now installs the pinned **Julia 1.11.5** release
tarball (mirroring the adjacent `zig-build` job's pinned-tarball
pattern) and runs `julia scripts/abi-ffi-gate.jl`.
- **`scripts/abi-ffi-gate.py`** (removed) — the last Python file in the
repo.
## RSR Quality Checklist
### Required
- [x] Tests pass — gate runs clean locally (julia 1.11.5);
`cargo`/Zig/Idris surfaces untouched
- [x] Code is formatted — idiomatic Julia
- [x] Linter is clean
- [x] **No banned language patterns — this PR *removes* the last Python
file** (RSR-H4)
- [x] No `unsafe` blocks without `// SAFETY:` — n/a
- [x] No banned functions
- [x] SPDX license header present on `abi-ffi-gate.jl` (MPL-2.0)
- [x] No secrets, credentials, or `.env` files
### As Applicable
- [x] ABI/FFI changes validated — the conformance gate's behaviour is
preserved (verified below)
- [ ] State files / CHANGELOG — no released-version change
## Testing
Verified locally with **julia 1.11.5** against this tree:
```
# OK path is byte-identical to the Python it replaces:
$ diff <(python3 abi-ffi-gate.py) <(julia abi-ffi-gate.jl) → identical
ABI-FFI GATE: OK (verisimiser) — 24 ABI functions exported, 8 result codes match (exit 0)
```
Adversarial (the gate must **fail** on drift) — each returns exit 1 with
the right diagnosis:
| Injected drift | Result |
|---|---|
| `null_pointer = 4` → `9` in the Zig enum | ❌ "Result-code map differs
(name or value)" |
| remove an `export fn` | ❌ "1 ABI function(s) not exported by the Zig
FFI" |
| add a `{{PROJECT_NAME}}` token to the Zig | ❌ "Zig FFI has unrendered
template tokens" |
So the port is behaviour-equivalent **and** non-vacuous.
## Screenshots
n/a (script + workflow)
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JdqVWGSSv36Ph8ZWvizGMp)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent b53a4c8 commit dd49dd3
3 files changed
Lines changed: 122 additions & 104 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | | - | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
This file was deleted.
0 commit comments