Manual peer addition (deterministic discovery without mDNS multicast)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Blocks #24 (End-to-end multi-instance test harness).
Goal
Allow a peer to be added explicitly, without relying on mDNS multicast, so two instances can connect deterministically — over 127.0.0.1 and in CI environments where multicast is unavailable or unreliable.
Today peers are discovered only via mDNS, and the mDNS adapter skips loopback addresses (addr.is_loopback() at app/src/infra/network/mdns.rs) and depends on multicast over a real network interface. As a result, two instances on the same host over loopback cannot find each other, which blocks the deterministic e2e harness in #24.
Proposed surface
- A repeatable
--peer <HOST:PORT>CLI flag inapp/src/cli.rs(alongside the existing--config-dir/--http-port/--presence-port/--transport-port). - And/or a
[[peer]]block inconfig.toml(theConfigstruct inapp/src/domain/cfg/config.rs).
Wiring
- Add a small task in
Synchronizer(app/src/application/sync.rs) that periodically injectsTransportChannelData::HandshakeSyn(endpoint)for each configured peer that has not yet been "seen" (a redial loop), bypassing the mDNS adapter's loopback filter. - This reuses the existing handshake path —
PresenceServicealready turns aPinginto aHandshakeSynon the transport sender channel.
Design wrinkle to resolve
PresenceService::handle_ping (app/src/application/network/presence/service.rs) only sends a SYN when local_id < peer_id, but a manually configured peer's UUID is not known up front. The SYN/ACK exchange must converge when one or both sides dial (e.g. both sides allowed to send SYN, with the receiver deduping). The #52 self-handshake guard already protects against a same-id collision.
Acceptance criteria
- A peer added via CLI flag and/or config connects and syncs without any mDNS discovery.
- Works over
127.0.0.1(two instances on one host with distinct--config-dirand ports). - Docs updated (
AGENTS.md,README.md, and/ordocs/). - Unblocks #24.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with app/src/cli.rs, app/src/domain/cfg/config.rs, app/src/application/sync.rs, and app/src/application/network/presence/service.rs; trace the existing handshake and mDNS paths first. Resolve how configured endpoints converge when peer UUIDs are unknown, then verify loopback connection and syncing with two config directories and ports. Update AGENTS.md, README.md, and/or docs and confirm the setup supports the #24 harness.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, distributed-systems, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100