From b1b87860c415d98b90d080eeec49dc3c3879269c Mon Sep 17 00:00:00 2001 From: DeFiDude <59237470+DeFiDude@users.noreply.github.com> Date: Thu, 1 Oct 2026 13:05:54 -0600 Subject: [PATCH] api: record additive Codec2 packet contract --- api/snapshots/lxst-core.txt | 33 +++++++++++++++++++++++++++++++++ api/stability.json | 30 +++++++++++++++--------------- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/api/snapshots/lxst-core.txt b/api/snapshots/lxst-core.txt index 9ab7820..5695aed 100644 --- a/api/snapshots/lxst-core.txt +++ b/api/snapshots/lxst-core.txt @@ -21,6 +21,25 @@ impl lxst_core::Codec2Mode pub const fn lxst_core::Codec2Mode::bitrate(self) -> u16 pub const fn lxst_core::Codec2Mode::from_header(u8) -> core::result::Result pub const fn lxst_core::Codec2Mode::header(self) -> u8 +pub enum lxst_core::Codec2PacketError +pub lxst_core::Codec2PacketError::Backend(E) +pub lxst_core::Codec2PacketError::BackendModeMismatch +pub lxst_core::Codec2PacketError::BackendModeMismatch::actual: lxst_core::Codec2Mode +pub lxst_core::Codec2PacketError::BackendModeMismatch::expected: lxst_core::Codec2Mode +pub lxst_core::Codec2PacketError::Failed +pub lxst_core::Codec2PacketError::ModeHeader +pub lxst_core::Codec2PacketError::ModeHeader::actual: u8 +pub lxst_core::Codec2PacketError::ModeHeader::expected: u8 +pub lxst_core::Codec2PacketError::NonCodec2Profile(lxst_core::Profile) +pub lxst_core::Codec2PacketError::OutputCapacity +pub lxst_core::Codec2PacketError::OutputCapacity::actual: usize +pub lxst_core::Codec2PacketError::OutputCapacity::required: usize +pub lxst_core::Codec2PacketError::PayloadLength +pub lxst_core::Codec2PacketError::PayloadLength::actual: usize +pub lxst_core::Codec2PacketError::PayloadLength::expected: usize +pub lxst_core::Codec2PacketError::SampleCount +pub lxst_core::Codec2PacketError::SampleCount::actual: usize +pub lxst_core::Codec2PacketError::SampleCount::expected: usize #[repr(u8)] pub enum lxst_core::CodecKind pub lxst_core::CodecKind::Codec2 = 2 pub lxst_core::CodecKind::Null = 255 @@ -205,6 +224,15 @@ pub lxst_core::TelephonyAction::StartDialTone pub lxst_core::TelephonyAction::SwitchProfile(lxst_core::Profile) pub lxst_core::TelephonyAction::TeardownLink pub lxst_core::TelephonyAction::Terminate(core::option::Option) +pub struct lxst_core::Codec2PacketCodec +impl lxst_core::Codec2PacketCodec +pub fn lxst_core::Codec2PacketCodec::decode_into(&mut self, &[u8], &mut [i16]) -> core::result::Result::Error>> +pub fn lxst_core::Codec2PacketCodec::encode_into(&mut self, &[i16], &mut [u8]) -> core::result::Result::Error>> +pub const fn lxst_core::Codec2PacketCodec::mode(&self) -> lxst_core::Codec2Mode +pub fn lxst_core::Codec2PacketCodec::new(lxst_core::Profile, B) -> core::result::Result::Error>> +pub const fn lxst_core::Codec2PacketCodec::payload_bytes(&self) -> usize +pub const fn lxst_core::Codec2PacketCodec::profile(&self) -> lxst_core::Profile +pub const fn lxst_core::Codec2PacketCodec::sample_frames(&self) -> usize pub struct lxst_core::Frame pub lxst_core::Frame::codec: lxst_core::CodecKind pub lxst_core::Frame::payload: alloc::vec::Vec @@ -328,4 +356,9 @@ pub const lxst_core::OPUS_ENCODED_PACKET_MAX_BYTES: usize pub const lxst_core::OPUS_MONO_DECODE_SAMPLE_RATE_HZ: u32 pub const lxst_core::TELEPHONY_DESTINATION_NAME: &str pub const lxst_core::TELEPHONY_PRIMITIVE_NAME: &str +pub trait lxst_core::Codec2Backend +pub type lxst_core::Codec2Backend::Error +pub fn lxst_core::Codec2Backend::decode_native(&mut self, &[u8], &mut [i16]) -> core::result::Result<(), Self::Error> +pub fn lxst_core::Codec2Backend::encode_native(&mut self, &[i16], &mut [u8]) -> core::result::Result<(), Self::Error> +pub fn lxst_core::Codec2Backend::mode(&self) -> lxst_core::Codec2Mode pub fn lxst_core::opus_packet_duration_samples_48k(&[u8]) -> core::result::Result diff --git a/api/stability.json b/api/stability.json index e78f541..ad1dc43 100644 --- a/api/stability.json +++ b/api/stability.json @@ -19,14 +19,13 @@ "sourceCommit": "af89a03094605dbdf7264d06fdc546526ec6980b" }, "snapshotSource": { - "commit": "68df3223773a9553ea458fc10b4b939915986aad", - "capturedOn": "2026-08-17", + "commit": "719ec1edb62458149a96222d3249e8dd4c3abedc", + "capturedOn": "2026-10-01", "review": { "areas": [ - "LXST codecs, profiles, signalling, and streams", - "Reticulum Link media transport", - "telephony service ownership and lifecycle", - "Opus transmit and receive streams" + "Bounded fixed-profile Codec2 packet processing and caller-owned PCM/output buffers", + "Native Codec2 backend contract and failure-state ownership", + "Existing Opus and telephony APIs retained" ], "canonicalPath": "lxst_telephony::TelephonyService", "canonicalConstruction": [ @@ -40,19 +39,20 @@ "TelephonyService::new", "TelephonyService::with_config" ], - "classification": "existing experimental service boundary", + "classification": "additive experimental Codec2 backend boundary; no bundled native backend or telephony activation", "publicApiDiff": { - "added": 0, + "added": 33, "removed": 0 }, - "semver": "no version consequence; documentation and consumer migration only", + "semver": "additive experimental API in the unreleased 0.2 line; no existing signatures removed or changed", "deprecations": "none", - "wirePersistenceRuntimeImpact": "none", + "wirePersistenceRuntimeImpact": "Existing wire IDs, profiles, persistence and live streams unchanged. New opt-in packet adapter validates fixed-profile Codec2 payloads and latches backend failures.", "platformEvidence": [ - "host service tests and compiled example", + "68 lxst-core tests including existing Python wire/raw parity", "stable and Rust 1.87 strict Clippy", - "Android and Apple compile gates", - "Python Telephone interoperability" + "compiled external Codec2 consumer", + "24 actual Rust Codec2 packet-boundary cases against native frames and C reference data; codec quality and allocation qualification remain separate", + "separate Rust candidate no_std compile on pinned ESP32-S3 toolchain; no on-device runtime claim" ] } }, @@ -63,8 +63,8 @@ "tier": "experimental", "compatibility": "reviewed-snapshot", "snapshot": "api/snapshots/lxst-core.txt", - "itemCount": 331, - "sha256": "87cc451d6da48cc06cd2bae9b26bae523407a20f66e842f04844ceecb8c5867d" + "itemCount": 364, + "sha256": "2c272021cc340af7f779d944bebb336ae1804938239a8ead3cbf11a8074022e4" }, { "name": "lxst-rns",