Review 001 remediation (tasks/tunnels/fix-udp-framed-adapter): - U-1 [major]: UdpHalf now composes the ADR-003 codec at the substrate boundary — poll_write de-frames channel bytes (incremental DatagramReader) and sends each payload as one raw datagram; poll_read frames raw target datagrams and hands frame bytes to the pump. Targets see payload-only bytes; empty datagrams round-trip (the F-2 fix end-to-end); >8 KiB datagrams arrive as ONE datagram. Mechanics the verification gates forced beyond the sketch: poll_write accepts all offered bytes (tokio copy re-offers a full window unsatisfied — partial-frame holds deadlock >8 KiB frames), backpressure is an accepted-byte high-water mark, socket drain pumps on write/flush/shutdown; >caller-buffer frames stage across reads (the truncation probe's assertion surface updated per the re-validation correction). - U-2 [minor]: connect_udp resolves the target and binds the unspecified address of the matching family (v6 targets dial from [::]:0); bind_tcp gains the wildcard-exposure doc warning. - U-3 [minor]: the 65535 recv scratch allocates lazily on first recv (full-size read kept — try_recv truncates silently; the MTU-shrink idea confirmed unsafe in re-validation). - N-1: the module/connect_udp/UdpHalf docs now describe the composed codec truthfully. Gates (permanent tests in tests/local_halves.rs): recording-target suite (payload-only at the target, empty-datagram round-trip, 9000- byte single datagram, unframed-target resolution), the 65507-byte max-datagram staging probe, and the v6 dial gate. Docs: ADR-003 §Amendment (the boundary mechanics), wire.md truncation bullet, consumer.md adopt sketch (substrate param). Review 001 resolution notes on U-1/U-2/U-3/N-1; task marked completed. Verified: 63 default / 76 local tests ×3 repeat runs; clippy -D warnings (all-targets + wasm32), fmt --check, doc --no-deps (warning-free), wasm check, publish dry-run.
alktunnels
Arbitrary bidirectional tunnels over alkcall
channels: TCP, UDP, unix sockets, and other stream or datagram
substrates — in the ssh -L / ssh -D / ssh -R sense, without SSH.
A producer/consumer protocol crate riding alkcall channels the same
way alktty does (alk/tty is the
sibling precedent): the producer half registers the alk/tunnel open
op and pumps bytes between the channel and the substrate; the consumer
half is the typed session (TunnelSession) that opens tunnel channels
and owns teardown.
A tunnel is a resource, not an address
Open-op params identify a produced resource + substrate:
{ "resource": "postgres-primary", "substrate": "tcp" }
The producer owns the backing — the consumer never learns an address.
Rich addressing (SOCKS5 ATYP, per-datagram remotes) enters only
through the -D/dynamic composition path, inside the tunnel payload,
never in the wire (ADR-001).
- Wire format:
docs/architecture/wire.md(+ the BAST document atdocs/architecture/bast.md) - Open-op params: ADR-001; codec: ADR-003; ALPN: ADR-002
- Producer shapes: ADR-004; consumer session: ADR-005; ACL: ADR-006
- The full spec set:
docs/architecture/(overview, wire, producer, consumer, six ADRs, OQ tracker)
Status
v0.1.0 — the v1 protocol implementation, Phase-2 complete (spec:
docs/architecture/; reviews: docs/reviews/). The wire surface
(params, ALPN, codec) is one-way-door stable from this point; the
API surface becomes ABI-stable at the first external consumer.
Features
| Feature | Contents | wasm |
|---|---|---|
| (default) | params, wire codec, open-op spec, establisher shapes, TunnelSession — protocol only |
yes |
local |
TCP/UDP/unix dial + listen helpers (real sockets) | no |
Verification
cargo test # default crate (wasm-clean)
cargo test --features local # + real-socket suites
cargo clippy --all-targets -- -D warnings
cargo fmt --check
cargo check --target wasm32-unknown-unknown # the wasm-clean guard
License
MIT OR Apache-2.0