Commit a644b03
fix(abi-verify): tolerate non-canonical Zig switch arm
`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>false shorthand (#22)1 parent 17c7ca7 commit a644b03
1 file changed
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
249 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
250 | 264 | | |
251 | 265 | | |
252 | 266 | | |
| |||
338 | 352 | | |
339 | 353 | | |
340 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
341 | 397 | | |
0 commit comments