noCV
SFFI-103 · Establish the machine contract

Map native errors without losing machine-readable causes

Practice briefStoryIntermediate

Every nonzero native status becomes 'compression failed', hiding whether the caller supplied bad input or the allocator exhausted its cap.

Focused work estimate
2h 30m + prerequisites
Priority in the scenario
Medium
Engineering practice
Error contracts · Boundary validation

Estimated field mix

  • Systems programming70%
  • API design30%

Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.

Your next step

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.

Acceptance criteria

  • Stable public codes distinguish input, capacity, version, cancellation, and internal faults
  • Native diagnostic text is bounded and treated as untrusted
  • Unknown statuses map to one safe internal category

Implementation constraints

  • Do not include raw input bytes or native addresses in errors.

Verification to include

  • Trigger and map each declared native status.
  • Return an unknown status with oversized text and verify bounded safe mapping.

Deliverables

  • Versioned error map and contract tests

Rollout and recovery

Callers must stop branching on old free-form messages before migration.

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.