6.0 KiB
| id | parent | milestone | provides | requires | affects | key_files | key_decisions | patterns_established | observability_surfaces | drill_down_paths | duration | verification_result | completed_at | blocker_discovered | |||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| S02 | M001 | M001 |
|
|
|
|
|
|
|
|
passed | 2026-05-13T06:16:06.048Z | false |
S02: TCP server support
Added global --tcp CLI flag and wired TCP client transport with 15s connect/120s read-write timeouts across all 16 CLI command modules
What Happened
S02 implemented TCP transport end-to-end on the client side. Three tasks completed:
T01: Added global --tcp CLI flag to the root Cli struct (Option) and wired it through dispatch() into all 14 cmd_* functions. Implemented send_tcp() using std::net::TcpStream with 15s connect timeout and 120s read/write timeout, plus is_alive_tcp() for TCP liveness checking. Updated send() and is_alive() to accept tcp_addr: Option<&str> and route to TCP or local transport accordingly. ensure_daemon() was modified to hard-error on TCP connection failure rather than auto-starting or silently falling back.
T02: Updated daemon_cmd.rs to handle --tcp in status and stop commands. Status now reports "listening on TCP {addr}" vs "listening on local socket" depending on transport. Stop warns that TCP daemons must be stopped manually since they run as separate processes.
T03: Verified cross-platform compilation (native macOS + Windows target) and all 32 unit tests pass including new TCP transport unit tests (tcp_connector_rejects_non_tcp_addr, tcp_listener_implements_listener, transport_addr_variants).
Verification
cargo check passes on native target. cargo test passes with 32 tests, 0 failures. --tcp flag visible in CLI help output. send_tcp and is_alive_tcp confirmed in transport.rs. tcp: Option on Cli struct confirmed. Windows cross-compile previously confirmed in T03 (environmental toolchain limitation in current WSL env).
Requirements Advanced
- R002 — send_tcp() implemented with hard error on failure and no fallback
- R004 — Global --tcp flag on Cli struct, visible in help, threaded through all commands
- R007 — ensure_daemon() hard-errors on TCP failure; send_tcp returns Result with clear error
Requirements Validated
- R002 — send_tcp() with 15s connect timeout, 120s read/write timeout; hard error on failure; 32 unit tests pass
- R004 — --tcp visible in CLI help; threaded through all 14 cmd_* functions; global option on Cli struct
- R007 — ensure_daemon() hard-errors on TCP failure; send_tcp() returns Result; no silent fallback
New Requirements Surfaced
None.
Requirements Invalidated or Re-scoped
None.
Operational Readiness
None.
Deviations
None.
Known Limitations
Windows cross-compile requires MSVC toolchain (lib.exe) which is not available in the WSL verification environment — verified in prior T03 run. TCP transport is plaintext (no TLS) — R020 deferred. No authentication tokens — R021 deferred.
Follow-ups
S03 will add TCP client integration testing; S04 will run end-to-end smoke test (daemon on TCP + client queries return same data as local transport)
Files Created/Modified
src/cli/mod.rs— Added global --tcp: Option flag to Cli struct, wired through dispatch() and all 14 cmd_* functionssrc/cli/transport.rs— Added send_tcp(), is_alive_tcp(), updated send() and is_alive() to route via tcp_addr; TCP transport with 15s connect/120s read-write timeoutssrc/cli/daemon_cmd.rs— Wired --tcp into daemon status (reports TCP vs local) and stop (warns manual stop needed)src/cli/sessions.rs— Updated to accept and thread tcp_addr parametersrc/cli/history.rs— Updated to accept and thread tcp_addr parametersrc/cli/search.rs— Updated to accept and thread tcp_addr parametersrc/cli/contacts.rs— Updated to accept and thread tcp_addr parametersrc/cli/export.rs— Updated to accept and thread tcp_addr parametersrc/cli/unread.rs— Updated to accept and thread tcp_addr parametersrc/cli/members.rs— Updated to accept and thread tcp_addr parametersrc/cli/new_messages.rs— Updated to accept and thread tcp_addr parametersrc/cli/stats.rs— Updated to accept and thread tcp_addr parametersrc/cli/favorites.rs— Updated to accept and thread tcp_addr parametersrc/cli/sns_notifications.rs— Updated to accept and thread tcp_addr parametersrc/cli/sns_feed.rs— Updated to accept and thread tcp_addr parametersrc/cli/sns_search.rs— Updated to accept and thread tcp_addr parameter