libertaria-stack/core/l0-transport
Markus Maiwald 0f0f1a4d57
fix(build): resolve module import issues post-refactor
Fix circular and missing module imports across L0-L2 layers:
- Add l0_transport import to QVL and PoP modules in build.zig
- Fix gateway test to use DhtService parameter
- Convert l0_transport imports to direct time imports in L1
- Fix soulkey to use module import (@import("pqxdh"))
- Fix policy.zig to use module import (@import("lwf"))
- Refactor mod.zig exports to avoid circular dependencies
- Update service.zig and utcp/socket.zig to use module imports
- Fix all QVL test files to import time directly

Results: 254+ tests passing (was 124), 1 module conflict remaining
in service tests (opq/store.zig in both lwf and opq modules).

Refs: Night Sprint 2026-02-05
2026-02-05 22:17:11 +01:00
..
ipc refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
opq refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
utcp fix(build): resolve module import issues post-refactor 2026-02-05 22:17:11 +01:00
README.md refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
dht.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
gateway.zig fix(build): resolve module import issues post-refactor 2026-02-05 22:17:11 +01:00
lwf.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
mimic_dns.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
mimic_https.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
mimic_quic.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
mod.zig fix(build): resolve module import issues post-refactor 2026-02-05 22:17:11 +01:00
noise.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
opq.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
png.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
quarantine.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
relay.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
service.zig fix(build): resolve module import issues post-refactor 2026-02-05 22:17:11 +01:00
time.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
transport_skins.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
utcp.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00

README.md

L0 Transport Layer

Layer: L0 (Transport)
Purpose: Wire protocols, frame encoding, time primitives
RFCs: RFC-0000 (LWF), RFC-0105 (Time L0 component)


Overview

The L0 Transport layer provides low-level wire protocol implementations for the Libertaria network. It handles packet framing, serialization, and transport-layer timestamps.

Components

LWF (Libertaria Wire Frame) - lwf.zig

RFC: RFC-0000
Wire protocol implementation for fixed-size headers and variable payloads. Supports CRC32-C and Ed25519.

Time - time.zig

RFC: RFC-0105
Nanosecond precision transport-layer time primitives.

UTCP (Unreliable Transport Protocol) - utcp/socket.zig

RFC: RFC-0010
Fast-path UDP wrapper for LWF frames. Features rapid entropy validation (DoS defense) before deep parsing.

OPQ (Offline Packet Queue) - opq/

RFC: RFC-0020
High-resilience store-and-forward mechanism using a Segmented WAL (Write-Ahead Log) for 72-96 hour packet retention.

L0 Service - service.zig

The integrated engine that orchestrates Network -> UTCP -> OPQ -> Ingestion. Handles automated maintenance and persona-based policies.


Usage

const l0 = @import("l0_transport.zig");

// Create LWF frame
var frame = try l0.lwf.LWFFrame.init(allocator, 1024);
defer frame.deinit(allocator);

// Set header fields
frame.header.service_type = 0x0700; // Vector message
frame.header.timestamp = l0.time.nowNanoseconds();

// Encode for transport
const encoded = try frame.encode(allocator);
defer allocator.free(encoded);

Testing

Run L0 tests:

zig test l0-transport/lwf.zig
zig test l0-transport/time.zig

Dependencies

  • std.mem - Memory management
  • std.crypto - CRC32, hashing
  • std.time - System time access