Control Plane socket + send verb (spine) #57

Closed
opened 2026-07-08 02:11:43 +08:00 by weiwen · 0 comments
Owner

Parent

#55

What to build

The spine of the Control Plane, proven end-to-end with the simplest Verb. The Daemon binds a local Unix-domain socket and speaks a JSON-lines request/response protocol; a new evie <verb> CLI connects to it, issues one Verb, prints the result, and exits. Introduce a transport-agnostic dispatch(verb, resolved_chat) → response core (the socket is a thin adapter over it, mirroring how http.rs sits over SessionManager) with its first verb: send — deliver verbatim text to a chat, no pi, no Session.

Includes the shared infrastructure every later verb needs:

  • Socket path resolution: --socket flag → $EVIE_SOCKET$XDG_RUNTIME_DIR/evie.sock~/.config/evie/evie.sock fallback; overridable via a new [rpc] socket_path config key. Socket created mode 0600, never network-exposed. Set RuntimeDirectory=evie in the NixOS module so it lands at /run/evie/evie.sock.
  • Targeting chain: every verb resolves its target chat as --chat$EVIE_CHAT_ID → the sole configured Telegram chat → error if ambiguous/none, using the existing ChatId grammar.

The existing HTTP API is untouched. Demoable: with evie daemon running, evie send "hi" posts "hi" to the Telegram chat.

Acceptance criteria

  • evie daemon binds the Control Plane socket at the resolved path with mode 0600; the NixOS module places it at /run/evie/evie.sock.
  • evie send "text" delivers verbatim text to the resolved chat with no pi invocation.
  • Target resolution follows --chat$EVIE_CHAT_ID → sole Telegram chat → error; the ambiguous/none case returns a clear error and non-zero exit.
  • [rpc] socket_path and --socket override the default path; the CLI resolves --socket$EVIE_SOCKET → default.
  • The HTTP API continues to work unchanged.
  • Tests at the dispatch-core seam cover send delivery and targeting resolution incl. the ambiguity error (fake bot/session, per session.rs prior art); CLI-parse tests cover the send grammar.
  • Uses CONTEXT.md vocabulary (Control Plane, Verb, Daemon, CLI); respects ADR 0006.

Blocked by

## Parent #55 ## What to build The spine of the Control Plane, proven end-to-end with the simplest **Verb**. The **Daemon** binds a local Unix-domain socket and speaks a JSON-lines request/response protocol; a new `evie <verb>` **CLI** connects to it, issues one Verb, prints the result, and exits. Introduce a transport-agnostic `dispatch(verb, resolved_chat) → response` core (the socket is a thin adapter over it, mirroring how `http.rs` sits over `SessionManager`) with its first verb: **`send`** — deliver verbatim text to a chat, no `pi`, no Session. Includes the shared infrastructure every later verb needs: - **Socket path resolution:** `--socket` flag → `$EVIE_SOCKET` → `$XDG_RUNTIME_DIR/evie.sock` → `~/.config/evie/evie.sock` fallback; overridable via a new `[rpc] socket_path` config key. Socket created mode 0600, never network-exposed. Set `RuntimeDirectory=evie` in the NixOS module so it lands at `/run/evie/evie.sock`. - **Targeting chain:** every verb resolves its target chat as `--chat` → `$EVIE_CHAT_ID` → the sole configured Telegram chat → error if ambiguous/none, using the existing `ChatId` grammar. The existing HTTP API is untouched. Demoable: with `evie daemon` running, `evie send "hi"` posts "hi" to the Telegram chat. ## Acceptance criteria - [ ] `evie daemon` binds the Control Plane socket at the resolved path with mode 0600; the NixOS module places it at `/run/evie/evie.sock`. - [ ] `evie send "text"` delivers verbatim text to the resolved chat with no `pi` invocation. - [ ] Target resolution follows `--chat` → `$EVIE_CHAT_ID` → sole Telegram chat → error; the ambiguous/none case returns a clear error and non-zero exit. - [ ] `[rpc] socket_path` and `--socket` override the default path; the CLI resolves `--socket` → `$EVIE_SOCKET` → default. - [ ] The HTTP API continues to work unchanged. - [ ] Tests at the dispatch-core seam cover `send` delivery and targeting resolution incl. the ambiguity error (fake bot/session, per `session.rs` prior art); CLI-parse tests cover the `send` grammar. - [ ] Uses CONTEXT.md vocabulary (Control Plane, Verb, Daemon, CLI); respects ADR 0006. ## Blocked by - #56
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
weiwen/evie#57
No description provided.