Files
filip131311 d010ead67e fix(scripts): verify downloaded dylib Mach-O platforms (#450)
## What

Adds a platform-verification gate to
`scripts/download-native-binaries.sh`: after downloading the native
binaries, assert every arch slice of each injection dylib has the
expected Mach-O platform (iOS = `IOSSIMULATOR`, tvOS = `TVOSSIMULATOR`),
and fail loudly otherwise.

## Why

The script pulled the flat iOS `libArgentInjectionBootstrap.dylib`
release asset on trust. When a mis-built release ships a
**tvOS-platform** binary in that slot, `dyld` silently refuses the
platform-mismatched `DYLD_INSERT_LIBRARIES` insert, so native-devtools
never connects — every `native-*` tool returns `restart_required`, with
**no error** at download, sign, or pack time. That is exactly what
happened (the `argent-main` / `argent-v0.14.0` flat bootstrap asset was
`TVOSSIMULATOR`).

This guard runs on both paths that ingest the binaries — local
`pack:mcp` (`pack-mcp.cjs`) and the publish CI (`publish.yml` /
`publish-next.yml`) — so a bad upstream release can no longer be bundled
into an npm publish silently. `vtool` is macOS-only, so the check is
skipped on hosts without it (matching the existing `codesign` guard).

Complements the producer-side fix in `argent-private`
(`build-native-binaries`: build the tvOS dylibs outside `build/dylibs/`
so the flatten can't collide, plus a platform gate).

Verified: flags a `TVOSSIMULATOR` bootstrap, passes an `IOSSIMULATOR`
one.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-07-01 19:31:15 +02:00
..