Skip to content

feat(kerykeion): crate scaffold with mesh types, config, and protobuf codegen#52

Merged
forkwright merged 2 commits intomainfrom
p2-01/kerykeion-scaffold
Mar 19, 2026
Merged

feat(kerykeion): crate scaffold with mesh types, config, and protobuf codegen#52
forkwright merged 2 commits intomainfrom
p2-01/kerykeion-scaffold

Conversation

@forkwright
Copy link
Owner

Summary

  • New kerykeion crate for Meshtastic mesh networking
  • Protobuf code generation from 8 vendored Meshtastic .proto files via prost-build
  • Core types: NodeNum, PacketId, ChannelIndex newtypes with validation
  • MeshConfig with TOML deserialization (serial/TCP/BLE connections, channel PSKs)
  • MeshConnection async trait for transport abstraction (implementations in P2-02)
  • NodeDb for in-memory node tracking with insert/get/remove/iter
  • Collector trait + MeshCollector stub
  • snafu Error enum with 14 variants, all with implicit Location tracking
  • New workspace deps: prost, tokio-serial, btleplug, aes, ctr, x25519-dalek, petgraph, mdns-sd, rusb, tokio-util, bytes, proptest, nix, uuid, prost-types

Test plan

  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace — 28 kerykeion tests + 385 workspace total, 0 failures
  • cargo test --workspace --doc passes
  • Protobuf encode/decode roundtrip (MeshPacket, ToRadio, FromRadio)
  • Config TOML deserialization (MeshConfig from inline TOML string)
  • NodeDb CRUD: insert, get, remove, iter, replace
  • ChannelIndex out-of-range validation
  • snafu error chain formatting and display
  • Frame constants (FRAME_MAGIC, MAX_PACKET_SIZE, BROADCAST_ADDR)

Observations

Observation 1 — Debt (src/collector.rs:1): koinon::Collector does not exist as a trait. The Collector trait is defined locally in kerykeion::collector as a placeholder. Before P2-05 (gateway bridge), either koinon should be extended with a Collector trait (preferred — shared contract across all crates) or the local definition should be moved to a dedicated akroasis-core crate.

Observation 2 — Idea (crates/kerykeion/proto/meshtastic/): Vendored proto files are pinned to a snapshot derived from Meshtastic firmware knowledge as of 2026-03-18. A proto/VERSION file noting the upstream protobufs release tag (e.g. v2.5.18) would make upgrade diffs clearer and help CI detect drift.

Observation 3 — Missing test (src/config.rs): The ChannelPsk with non-empty PSK bytes (16-byte AES-128 key) has no test. The existing config test uses an empty PSK slice. A roundtrip test with a 16-byte PSK would catch accidental base64/binary encoding regressions when the TOML layer changes.

Observation 4 — Doc gap (src/connection.rs): MeshConnection has no crate-level example showing how a concrete implementation is expected to be wired up. The first implementor (P2-02 serial) will need to discover the Send + Sync constraint on the associated future types through the compiler rather than documentation.

🤖 Generated with Claude Code

… codegen

- New kerykeion crate for Meshtastic mesh networking
- Protobuf codegen from 8 vendored Meshtastic .proto files via prost-build
- Core types: NodeNum, PacketId, ChannelIndex newtypes with validation
- MeshConfig with TOML deserialization (serial/TCP/BLE connections, channel PSKs)
- MeshConnection async trait for transport abstraction (implementations in P2-02)
- NodeDb for in-memory node tracking with insert/get/remove/iter
- Collector trait + MeshCollector stub
- snafu Error enum with 14 variants, all with implicit Location tracking
- 28 tests covering types, errors, config, node_db, collector, proto roundtrips
- New workspace deps: prost, tokio-serial, btleplug, aes, ctr, x25519-dalek,
  petgraph, mdns-sd, rusb, tokio-util, bytes, proptest, nix, uuid, prost-types

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

⚠️ Large PR detected — 19 files, 1697 lines changed.

Consider splitting into smaller PRs for easier review. Not a blocker, just a signal.

@forkwright forkwright merged commit 23da372 into main Mar 19, 2026
12 checks passed
@forkwright forkwright deleted the p2-01/kerykeion-scaffold branch March 19, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant