T-124: unix-domain IPC server, wired into Flutter app boot

First slice of T-99 (the D-56-path-a IPC server). What this lands:

* lib/src/ipc/paths.dart rewritten — `workspaceSocketPath(root)`
  returns the per-workspace path per D-70 (FNV-1a 64-bit hash, hex,
  no crypto dep — D-70 amended in this commit to record the hash
  choice). Old `defaultSocketPath()` removed; the lone fallback in
  facade.dart kept with a clear placeholder pending T-127.
* lib/src/ipc/server.dart — IpcServer class. ServerSocket.listen
  accept loop (D-72), 0600 socket + 0700 parent (D-71), stale-node
  probe + unlink on start, refuses to clobber a live listener.
* lib/main.dart — IpcServer started after the first dispatcher is
  built and swapped on project open (workspace path changes).
  Failure logged but non-fatal so the UI still works without IPC.
* 11 server tests + 5 path tests cover socket modes, multi-conn,
  stale unlink, live-conflict, idempotent start/stop.

T-99 children downstream of T-124 (T-125 / T-126 / T-127 / T-130)
are now unblocked.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-05-18 14:51:35 +02:00
co-authored by Claude
parent 2b93bb1cb2
commit c4bccd35a3
10 changed files with 542 additions and 37 deletions
+7
View File
@@ -18,6 +18,13 @@ heading, and (b) bumping `pubspec.yaml` `version:` in the same commit.
### Added
- Unix-domain IPC socket server in the Flutter app (T-99 / T-124).
Per-workspace path (D-70: `$XDG_RUNTIME_DIR/clide/<hash>.sock` on
Linux, `~/Library/Caches/clide/<hash>.sock` on macOS). 0600 socket
+ 0700 parent (D-71). Multi-connection accept loop with serial
dispatch through `DaemonDispatcher` (D-72). Foundation for the C
`clide` client (T-126) and MCP (T-130). No client yet — testable
via `socat - UNIX-CONNECT:$SOCK`.
- Startup project picker — clide now opens to the welcome screen by
default instead of auto-opening the last project. A per-row
"always open this project on launch" checkbox in welcome's RECENT