refactor(core): make Frame and WireError crate-private

Spec §3 (decision D-b) lists `Frame` and `WireError` as private; lib.rs
re-exported both. Only `frame_sender` stays public.

- The pinned vectors in tests/vectors.rs now compile in-crate as a
  `#[cfg(test)] #[path]` module (autotests = false keeps Cargo from also
  building them as an integration test). Every golden vector now checks
  `encode() == GOLDEN` as well as the decode, and new literal vectors pin a
  trailing-byte rejection and an addressed Obs with a nonzero age and an
  `observed_at`.
- A `#[doc(hidden)]` `conformance` module (behind the `conformance`
  feature) gives the fuzz harness byte-level frame encoders/decoders and
  core's local limits without exposing `Frame`. The fuzz_twin test target
  now requires `conformance`, which scripts/ci.sh enables.
- compile_fail doctests pin that `Frame`/`WireError` are unreachable.
- Remove the THROWAWAY gen_missing_golden_vectors test and fix stale
  wire.rs comments about the version/tag byte offsets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 08:44:09 -07:00
co-authored by Claude Opus 5.5
parent d91d7914fc
commit e2717a930d
6 changed files with 324 additions and 140 deletions
+12 -1
View File
@@ -7,6 +7,9 @@ extern crate alloc;
pub mod belief;
mod bloom;
#[cfg(feature = "conformance")]
#[doc(hidden)]
pub mod conformance;
pub mod consts;
mod exchange;
mod frag;
@@ -28,10 +31,18 @@ pub use observation::{
};
pub use store::{Store, StoreError, TrimPolicy, WallClockStore};
pub use transport::{Event, FrameBuf, SendError, Transport};
pub use wire::{frame_sender, Frame, WireError};
pub use wire::frame_sender;
#[cfg(feature = "alloc")]
pub use mem_store::MemStore;
#[cfg(test)]
extern crate std;
// The pinned wire vectors (spec §7) need the crate-private `Frame` and
// `WireError`, so they compile as a unit-test module rather than as an
// integration test (`autotests = false` in Cargo.toml keeps Cargo from also
// building them as one).
#[cfg(test)]
#[path = "../tests/vectors.rs"]
mod vectors;