Commit b22e475
fix(007-mcp): add missing ToolRisk enum to Zig FFI (ABI drift, standards#92) (#102)
## Summary
Surfaced by the Phase 2 ABI drift gate spot-check (iseriser/PR #14):
`Oo7Mcp.SafeCli.ToolRisk` (5 tiers, `tierToInt` encoding 0–4) is
declared in the Idris2 ABI but absent from `oo7_mcp_ffi.zig`. Adds the
matching `pub const ToolRisk = enum(c_int)` with the encoding verified
by `iseriser abi-verify` (exit 0 after this fix; was DRIFT before).
## Scope
ABI parity only. Risk-tier *enforcement* (`categoryDefaultRisk` /
`riskPromotion` from SafeCli) is currently Idris2-only — the Zig
dispatcher does not yet gate on this enum. Wiring risk gates into the
dispatcher is a separate follow-up; this PR keeps the change minimal so
the Phase 2 gate can promote 007-mcp to its allowlist.
## Before / After
```
$ iseriser abi-emit-manifest --idris cartridges/007-mcp/abi/Oo7Mcp/SafeCli.idr \
--cartridge 007-mcp --source-path SafeCli.idr --out /tmp/007.json
abi-emit-manifest: wrote /tmp/007.json (2 enums, 0 transitions)
$ iseriser abi-verify --manifest /tmp/007.json \
--zig-ffi cartridges/007-mcp/ffi/oo7_mcp_ffi.zig
# BEFORE: [enum-missing-in-zig] manifest declares enum `ToolRisk` but the Zig FFI has no `pub const ToolRisk = enum(c_int)` declaration
# AFTER: abi-verify: OK — cartridge `007-mcp` ABI manifest agrees with `…/oo7_mcp_ffi.zig`
```
## Test plan
- [x] `iseriser abi-verify` → exit 0
- [x] `zig build test` (cartridges/007-mcp/ffi/) → 8/8 green
- [ ] reviewer: confirm the documentation in the new enum's
block-comment is accurate (mirrors `SafeCli.idr` lines 150-169 — 5
tiers, Tier 4 reserved-only-not-used)
Refs hyperpolymath/standards#92
Refs hyperpolymath/standards#89
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6d6e629 commit b22e475
1 file changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
54 | 77 | | |
55 | 78 | | |
56 | 79 | | |
| |||
0 commit comments