Package the native binding with a reversible compatibility gate
A package publish selects the native binary by platform name but ignores CPU features and libc compatibility.
- Focused work estimate
- 2h 30m + prerequisites
- Priority in the scenario
- Medium
- Engineering practice
- Packaging · Compatibility · Release engineering
Estimated field mix
- Systems programming70%
- DevOps30%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
A fictional desktop backup tool calls a small Rust compression library from Node.js. The binding leaks buffers on exceptions and treats ABI mismatches as corrupted input. Build against generated byte arrays and a local native library; no production archive format or user files are supplied.
Setup prerequisites
- FFI ownership
- Binary compatibility
- Error handling
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
- SFFI-101 · Write the buffer ownership table before exposing the binding
- SFFI-102 · Validate lengths before converting JavaScript buffers
- SFFI-103 · Map native errors without losing machine-readable causes
- SFFI-106 · Negotiate ABI capability before the first compression call
- SFFI-107 · Contain a native panic without pretending the process is safe
- SFFI-104 · Release native output after JavaScript cancellation
- SFFI-105 · Move blocking compression off the JavaScript event loop
- SFFI-108 · Compare native output against the compatibility oracle
- SFFI-109 · Unload a retired native revision only after callbacks drain
Acceptance criteria
- Artifact metadata binds OS, architecture, ABI, runtime, and required CPU features
- Installer rejects an incompatible binary before load
- Pure-language fallback selection is explicit and observable
Implementation constraints
- Do not download or execute binaries outside the generated local fixture set.
Verification to include
- Select each compatible fixture artifact and report its identity.
- Present wrong architecture, ABI, and feature metadata and verify safe fallback.
Deliverables
- Artifact selector, compatibility cases, and rollback note
Rollout and recovery
Publish metadata and fallback behavior before enabling native-by-default selection.
Value of the work
For the engineer: Practice language-boundary contracts, native resource safety and version negotiation.
For the team: Review a binding that fails safely and can be rolled back before native code enters additional application paths.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.