Skip to content

Commit 6b4a2a8

Browse files
fix(abi-verify): tolerate non-canonical Zig switch arm false shorthand (#36)
`abi-verify`'s Zig FFI parser bombed on 5 cartridges' `isValidTransition` switch arms because their terminal-state arm body is the literal `false` (no outgoing transitions allowed) rather than the canonical `to == .<v>` chunk form: fn isValidTransition(from: BspState, to: BspState) bool { return switch (from) { ... .exited => false, // <-- parser bombed here }; } The Zig is well-formed and the semantics ("empty allowed-set") are clear; the verifier just didn't accept the shorthand. `parse_arm_targets` now detects this form (body trimmed of trailing `,`/`;` and whitespace equals `false`) and returns the empty vec — equivalent to the "this state has no allowed outgoing transitions" manifest semantics, which is exactly what the cartridges intend. End-to-end verified against the 5 cartridges named in the issue (after a fresh `cargo build --release`): bsp-mcp → parses cleanly; surfaces real drift on BspCapability container-mcp → abi-verify OK dap-mcp → parses cleanly; surfaces real drift on StepGranularity lsp-mcp → parses cleanly; surfaces real drift on CompletionKind vault-mcp → parses cleanly; surfaces real drift on IdentityType All 5 now produce either exit 0 (clean) or a real drift diagnosis, which is precisely the acceptance criterion in iseriser#19. The post-parse drift findings are separate per-cartridge issues — not verifier defects — and out of scope for this PR. 44 lib tests + 9 integration tests pass. Refs hyperpolymath/standards#92 (Phase 2 allowlist expansion). Refs #19. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fc496da commit 6b4a2a8

0 file changed

File tree

    0 commit comments

    Comments
     (0)