refactor(core): make local constants crate-private

Decision K (spec §5): the local capacities and timings are defaults that
will become configuration, so they are `pub(crate)`. The wire constants
stay public.

- MAX_PEERS, SUMMARY_INTERVAL_MS, REASSEMBLY_TIMEOUT_MS, SEND_QUEUE_CAP,
  MIN_MTU, EVENT_QUEUE_CAP, DROP_TABLE_CAP, BCAST_SENT_CAP, ACK_BUFFER_CAP
  and PEER_IDLE_MS are now `pub(crate)`; a compile_fail doctest pins it.
- MIN_MTU's doc claimed it was the floor below which a fragment has no
  room. It is only the frag sweep's lower bound (BLE ATT's 23). The real
  floors are now stated on `Transport::mtu` and pinned by
  `consts::tests::mtu_floors`: 85 to carry every valid observation, 66 to
  fragment at all, 35 for an Ack, 26 for a summary.
- tines-bt caps live connections with its own MAX_PEERS (8).
- tines-sim's props mirror MAX_PEERS/SEND_QUEUE_CAP, checked against core
  through the hidden `conformance` module; the fuzz twin reads it there.
- node.rs: drain_events' rustdoc no longer links the now-private consts.

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 e2717a930d
commit 18e53b9bdd
6 changed files with 129 additions and 23 deletions
+7 -1
View File
@@ -53,7 +53,7 @@ use bluer::{
Adapter, Address, AddressType, Session, Uuid, UuidExt,
};
use tines_core::consts::{MAX_FRAME, MAX_PEERS};
use tines_core::consts::MAX_FRAME;
use tines_core::frame_sender;
use tines_core::observation::NodeId;
use tines_core::transport::{Event, FrameBuf, SendError, Transport};
@@ -230,6 +230,12 @@ impl Transport for BtTransport {
/// Smallest MTU we are willing to report (ATT's default minimum is 23).
const MIN_MTU: usize = 23;
/// Most live connections at once. Kept equal to tines-core's peer-table
/// capacity (8, a crate-private local constant since tines-core 1.0, decision
/// K): a connection beyond it would carry frames core's exchange has no slot
/// for. Both become configuration in a later release.
const MAX_PEERS: usize = 8;
/// L2CAP PSM the tines byte pipe runs on. Shared with the peer (agreed
/// out-of-band): both sides connect/listen on this PSM.
const TINES_L2CAP_PSM: u16 = 0x008D;