Skip to content

Set up review-protocol client skeleton for roxyd #529

@sae-bom

Description

@sae-bom

Background

Based on the Manager <-> roxyd design discussed in #519
This issue sets up the review-protocol client-side connection skeleton for roxyd.

This is scaffolding-only.
No RequestCode handling or privileged operations are implemented in this issue.


Scope

In scope

  • Connection lifecycle structure (e.g. connect -> run)
  • A minimal mock Manager for tests (handshake-only)

Out of scope

  • Implementing any RequestCode-specific logic
  • Implementing or porting existing handlers
  • Performing privileged operations
  • Introducing retries, backpressure, or rate limiting
  • Feature-flag–based switching logic
  • Observability, metrics, or health endpoints

Tasks

1. Connection struct

  • Introduce a connection-managing struct.
  • The struct owns the review-protocol connection and related state.

2. Connect phase

  • Implement connect(...) -> Result<Self> (or equivalent) that:
    • establishes QUIC/mTLS connectivity
    • performs the initial handshake
    • returns a connected instance
  • Use review_protocol::client::ConnectionBuilder::new() as the single entrypoint for establishing the connection (no direct QUIC wiring in this issue).

3. Run loop

  • Implement run(self) -> Result<()> (or equivalent) that:
    • receives messages from Manager
    • delegates message handling to a separate function

4. Dispatch boundary

  • Add a function such as handle_request(...) -> Result<()> that:
    • logs the received message / RequestCode
    • includes an explicit match statement that enumerates exactly these RequestCodes:
      • Reboot
      • Shutdown
      • ResourceUsage
      • ProcessList
    • for every RequestCode arm, fail explicitly with unimplemented!() (scaffolding-only)
    • for all other RequestCodes, use a fallback arm (e.g. _ => ...) that also fails explicitly with unimplemented!()

5. Tests (mock Manager)

  • Add a test that spins up a minimal mock Manager (review-protocol server) and verifies:
    • QUIC/mTLS connection establishment using review_protocol::client::ConnectionBuilder::new(), and
    • completion of the initial handshake.
  • The mock Manager should implement only the minimum required for handshake (no RequestCode business logic).
  • Keep tests deterministic and self-contained (no external network dependencies).

Notes


Acceptance Criteria

  • A review-protocol client connection-managing skeleton exists for roxyd and compiles successfully.
  • connect() establishes connectivity and handshake.
  • Incoming RequestCodes are received and dispatched to handler (handle_request()).
  • All handler paths fail explicitly with unimplemented!().
  • No real handler logic or privileged operations are introduced.
  • A unit/integration test exists that uses a minimal mock Manager to validate QUIC/mTLS + handshake.
  • CI passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions