michaelmelanson / michaelmelanson/panda-os

Service manager step 3: Service protocol framework

Open
#29 0 comments 0 reactions 0 assignees View on GitHub
enhancement ipc userspace
Dominant language
Rust
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Summary

Implement `Protocol` and `Service` traits in `panda-abi` with UUID identification and capability negotiation. Protocols are the primary interface abstraction — `keyboard`, `block`, `console`, `manager` are all protocols.

This is step 3 of the service manager implementation (#26).

## Desired behaviour

- `Protocol` trait in `panda-abi` with a UUID constant and version info
- `Service` trait that declares which protocols it implements
- `ProtocolChannel

` typed wrapper in `libpanda` for protocol-specific communication
- `ServiceClient` typed wrapper in `libpanda` for connecting to services
- Common handshake pattern: Hello → Welcome/Rejected
- Message framing: Kind byte + TLV (Type-Length-Value) encoding

## Key files

- `panda-abi/src/` — `Protocol` and `Service` traits, message framing types
- `libpanda/src/` — `ProtocolChannel

`, `ServiceClient` typed wrappers
- Existing IPC code in `libpanda/src/channel.rs` and `libpanda/src/mailbox.rs`

## Design notes

- Protocols are identified by UUID, not string names — this avoids naming collisions
- The handshake includes protocol UUID and version, so the server can reject incompatible clients
- Message framing uses a Kind byte (request/response/event) followed by TLV fields
- This builds on the existing channel infrastructure (4KB messages, bidirectional)

## Testing

- Unit tests for message serialization/deserialization
- Integration test: implement a simple echo protocol, connect client to server, exchange messages
- Test handshake rejection when protocol UUID mismatches
- Test version negotiation

## Documentation

- Doc comments on `Protocol` and `Service` traits with usage examples
- Document the handshake and message framing format
- Add a "Defining a Protocol" guide section

Part of #26

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the existing IPC implementation in libpanda/src/channel.rs and libpanda/src/mailbox.rs, then inspect panda-abi/src/ and libpanda/src/ to map the requested traits and wrappers. Define the test plan around serialization, echo communication, handshake rejection, and version negotiation. Done means the requested abstractions, tests, and documentation are present.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design, distributed-systems, documentation, operating-systems, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.