run verb #59

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

Parent

#55

What to build

Add the run Verb: the Daemon executes a local script/command with evie's env context populated, fire-and-forget. The Daemon (not the CLI) spawns the process, so immediate and (later) scheduled run behave identically.

Env populated: EVIE_CHAT_ID (resolved target chat) and EVIE_SOCKET (control socket path), so the script's own evie … callbacks resolve the right chat and daemon with no config. (EVIE_SCHEDULE_NAME/EVIE_SCHEDULE_TIME are added by the scheduling slice, only when fired from a Schedule.)

Output handling is fire-and-forget: evie does not deliver stdout anywhere — the script calls evie send itself if it wants to message the chat. Logging: stdout at debug, exit code at info, errors (non-zero exit / spawn failure / stderr) at warn.

Demoable: evie run /tmp/x.sh runs the script with EVIE_CHAT_ID/EVIE_SOCKET set; a script that calls evie send "$EVIE_CHAT_ID …" can message the chat back.

Acceptance criteria

  • evie run <script> [args…] is spawned by the Daemon with EVIE_CHAT_ID + EVIE_SOCKET in its environment.
  • Execution is fire-and-forget: evie delivers no stdout to the chat.
  • Logging is stdout→debug, exit code→info, errors→warn.
  • A script invoked via run can successfully call back into evie (e.g. evie send) using the injected env.
  • Tests at the dispatch-core seam spawn a temp script and assert the injected env and exit-code handling.
  • Uses CONTEXT.md vocabulary (Run, Verb); respects ADR 0006.

Blocked by

## Parent #55 ## What to build Add the **`run`** Verb: the **Daemon** executes a local script/command with evie's env context populated, fire-and-forget. The Daemon (not the CLI) spawns the process, so immediate and (later) scheduled `run` behave identically. Env populated: `EVIE_CHAT_ID` (resolved target chat) and `EVIE_SOCKET` (control socket path), so the script's own `evie …` callbacks resolve the right chat and daemon with no config. (`EVIE_SCHEDULE_NAME`/`EVIE_SCHEDULE_TIME` are added by the scheduling slice, only when fired from a Schedule.) Output handling is fire-and-forget: evie does not deliver stdout anywhere — the script calls `evie send` itself if it wants to message the chat. Logging: stdout at debug, exit code at info, errors (non-zero exit / spawn failure / stderr) at warn. Demoable: `evie run /tmp/x.sh` runs the script with `EVIE_CHAT_ID`/`EVIE_SOCKET` set; a script that calls `evie send "$EVIE_CHAT_ID …"` can message the chat back. ## Acceptance criteria - [ ] `evie run <script> [args…]` is spawned by the Daemon with `EVIE_CHAT_ID` + `EVIE_SOCKET` in its environment. - [ ] Execution is fire-and-forget: evie delivers no stdout to the chat. - [ ] Logging is stdout→debug, exit code→info, errors→warn. - [ ] A script invoked via `run` can successfully call back into `evie` (e.g. `evie send`) using the injected env. - [ ] Tests at the dispatch-core seam spawn a temp script and assert the injected env and exit-code handling. - [ ] Uses CONTEXT.md vocabulary (Run, Verb); respects ADR 0006. ## Blocked by - #57
weiwen referenced this issue from a commit 2026-07-12 01:02:00 +08:00
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#59
No description provided.