Skip to content

Quality Pass: IPC / Communication Layer #65

@dhilgaertner

Description

@dhilgaertner

Parent: #53

Scope

Unix socket IPC system enabling CLI-to-app communication via JSON-RPC 2.0 protocol. Covers the socket server, client, command routing, message framing, and error handling.

  • Refactoring — identify and address code quality improvements
  • Documentation — ensure adequate inline and user-facing docs
  • Code Review — thorough review for correctness, edge cases, security
  • Testing — add/improve tests for key functionality

Key Files

  • Packages/CrowIPC/Sources/CrowIPC/SocketServer.swift — Unix domain socket listener at ~/.local/share/crow/crow.sock
  • Packages/CrowIPC/Sources/CrowIPC/SocketClient.swift — client connection, send/receive
  • Packages/CrowIPC/Sources/CrowIPC/CommandRouter.swift — method name → async handler routing
  • Packages/CrowIPC/Sources/CrowIPC/Protocol.swift — JSON-RPC types (request, response, error codes, JSONValue)

Areas of Interest

  • Thread safety (DispatchSemaphore bridge for async handlers)
  • Message framing (newline-delimited JSON, 1 MB max)
  • Error codes (-32700 parse, -32600 invalid request, -32601 method not found, -32602 invalid params, -32000 app error)
  • Socket file permissions (0o600) and directory permissions (0o700)
  • Connection lifecycle and cleanup
  • JSONValue type-erased parameter handling

Metadata

Metadata

Assignees

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