Skip to content

v0.3.0-rc3: bincode 1→2 migration + RUSTSEC suppression + wire-format gate#4

Merged
shieldofsteel merged 1 commit into
masterfrom
feat/v0.3.0-rc3
May 1, 2026
Merged

v0.3.0-rc3: bincode 1→2 migration + RUSTSEC suppression + wire-format gate#4
shieldofsteel merged 1 commit into
masterfrom
feat/v0.3.0-rc3

Conversation

@shieldofsteel

Copy link
Copy Markdown
Owner

Summary

orp-E delivered the bincode hygiene work. Single commit c7075a2 cherry-picked + Cargo.toml conflict resolved.

What this ships

  • bincode 1.3 → 2.0.x workspace-wide. Wire format is incompatible with v0.2.0; production drain procedure documented in docs/upgrades/v0.3.0.md.
  • Important pivot from spec: bincode 3.0.0 on crates.io is compile_error!("https://xkcd.com/2347/") — a doxx-incident response, not a real release. RUSTSEC-2025-0141 has patched = [] (the bincode team announced permanent cessation of development). NO version bump clears the advisory. Stayed at bincode 2 + suppressed via audit.toml with documented exit ramp (postcard / bitcode / rkyv evaluation queued for v0.4).
  • Wire-format gateFederationOutbox::open stamps a 0xFFFF __orp_outbox_wire_version__ marker on first open, refuses to start if the marker is missing or wrong. Prevents bincode-2 trying to decode v0.2.0 (bincode-1) bytes. Operator drain procedure in docs.
  • ISOLATION_FOREST_SCHEMA_VERSION bumped 1→2 so stale serialised IF models surface as MlError::ModelVersionMismatch instead of mis-decoding.
  • http.rs fail-fast on DlqError::IncompatibleOutboxVersion at startup with clear error pointing to upgrade docs.

Files

9 changed, +344 / -22:

  • Cargo.toml — bincode = "2" workspace dep (with serde feature)
  • crates/orp-stream/src/dlq.rs — bincode-2 calls + version-marker gate + manual Debug impl + 5 new tests
  • crates/orp-stream/Cargo.toml, crates/orp-ml/Cargo.toml — bincode = workspace
  • crates/orp-ml/src/lib.rs — IF model serialiser switched to bincode::serde; SCHEMA_VERSION bump
  • crates/orp-core/src/server/http.rs — fail-fast on outbox version mismatch
  • NEW audit.toml — ignores RUSTSEC-2025-0141 with exit-ramp comment
  • NEW docs/upgrades/v0.3.0.md — operator drain procedure for production users
  • CHANGELOG.md — Unreleased / Dependencies block explaining the wire-format break

Tests

  • 5 new in dlq.rs: bincode-2 roundtrip, fresh-store marker stamp, legacy-store rejection, mismatched-marker rejection, marker invisible to pending_count
  • Workspace test: 1275 passed, 0 failed, 2 ignored (per E's local run)
  • cargo audit: exit 0 (RUSTSEC-2025-0141 suppressed via audit.toml)

Production migration story

v0.3.0 will refuse to start if ORP_FED_OUTBOX_PATH points at an unmarked or wrongly-marked RocksDB store. Error message is explicit and points to docs/upgrades/v0.3.0.md.

Procedure:

  1. Stop on v0.2.x, restart on v0.2.x, let outbox drain to peers
  2. Stop, rm -rf $ORP_FED_OUTBOX_PATH
  3. Start v0.3.0

Or accept loss of buffered entries and just delete the dir. Empty stores upgrade transparently — marker stamped on first open.

Test plan

  • cargo fmt --all -- --check — clean
  • cargo clippy --all --all-features --tests -- -D warnings — clean
  • cargo check --workspace --all-features --tests — clean (13.20s)
  • Full workspace test (running locally; CI will confirm cross-platform)
  • cargo audit exit 0 with RUSTSEC-2025-0141 suppressed

Closes

  • E (bincode 2.x migration) — last of the v0.3.0-rc1 deferred Wave 1 retries that's now ready to land

Still deferred (future PRs)

  • S5 rate limiter, C federation outbox push-path wiring
  • F2 audit signing key persistence, F5 CSRF HMAC, F6 SMTP STARTTLS, F7 at-rest encrypt, F8 sanctions sig, F9 TLS unify
  • H capability priorities (MIL-STD-2525, SBOM, classification, Kalman, CesiumJS, schema evolution)

🤖 Generated with Claude Code

`bincode` is unmaintained (RUSTSEC-2025-0141, `patched = []` — the v3
release on crates.io is a `compile_error!` placeholder). v0.2.x shipped
on the legacy 1.3 line; this gets us onto the latest line that actually
exists, off the deprecated `bincode::serialize`/`deserialize`/`Error`
API and onto the `bincode::serde` adapter with `config::standard()`.
Migrating off bincode entirely to `postcard` is the v0.4 exit ramp.

Wire-format break (intentional):

- `orp-stream::dlq::FederationOutbox` and `OutboxEntry` (RocksDB-backed
  federation buffer): old bytes are bincode-1, new bytes are bincode-2.
  On `open`, the outbox now looks for a reserved version-marker key
  (`0xFFFF __orp_outbox_wire_version__`) holding `b"v2"`. Empty stores
  get the marker stamped automatically; stores with data but no marker
  (or a mismatched marker) refuse to open with `IncompatibleOutboxVersion`
  and the binary fails fast in `start_server`. The reserved key cannot
  collide with any real `(peer_id_len, peer_id, seq)` key — `make_key`
  / `peer_prefix` now reject any `peer_id` whose length would equal
  `u16::MAX`, the only way a key prefix could begin `[0xFF, 0xFF]`.

- `orp-ml::IsolationForestModel`: serialised model wire format is bumped
  to `ISOLATION_FOREST_SCHEMA_VERSION = 2`. Stale embedded models surface
  as `MlError::ModelVersionMismatch { got: 1, expected: 2 }` rather than
  silently mis-decoding.

Operator action: the v0.3.0 binary refuses to start against a v0.2.x
outbox. Drain with the v0.2.x binary first, then upgrade — full procedure
in docs/upgrades/v0.3.0.md.

Validation:

- `audit.toml` ignores RUSTSEC-2025-0141 with a documented exit ramp;
  the advisory has `patched = []` so a version bump cannot resolve it.
  `cargo audit` passes (exit 0). Cargo.lock is bincode-2.0.1 only;
  bincode 1 is gone.
- Tests: 1275 passed, 0 failed across the workspace, including 5 new
  outbox tests covering bincode-2 roundtrip, fresh-store marker stamp,
  legacy-store rejection, mismatched-marker rejection, and that the
  marker is invisible to `pending_count`.
- `cargo fmt` clean; `cargo clippy -p orp-stream -p orp-ml --tests
  -- -D warnings` clean. (Workspace-wide clippy hits three pre-existing
  master lint failures in klv.rs / notifications.rs / commands.rs from
  rustc 1.91 — out of scope for this PR.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shieldofsteel shieldofsteel merged commit a6e8c87 into master May 1, 2026
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant