History

feat: supervise custom box services

Ben Davis committed 3 months ago

Commit 407c6331 parent 4d1f99b17 files · +1008 −24Browse files

Showing the changes to docs (1 of 17 files). Show all

Unified · Split

docs/tx9-cli-design.md+15−1
@@ -52,7 +52,7 @@ Docker overview can be read. `tx9 help` remains Docker-independent. · 51 unmodified lines
5252 | `tx9 backup <box>` (aliases `export`, `save`) | Flags: `--path` (default `~/Downloads`), `--password`/env/prompt, `--no-encrypt`. Quiesce → archive agent /data → validate → (encrypt) → verify → `<box>-<timestamp>.tx9`. |
5353 | `tx9 import <file.tx9>` (aliases `load`, `restore`) | Flags: `--name`, `--password`/env/prompt. Validate before creating anything; restore staged; arrive quiesced + gateway-disabled + fresh token; fail on name collision. |
5454 | `tx9 mount <add\|list\|remove> ...` | Persist host-directory bind mounts for an agent and recreate only its disposable container. Targets must be below `/mnt`, outside the portable `/data` volume. `add` supports `--read-only` and `--require-mountpoint`. |
55−| `tx9 logs <box>` | Query durable agent, Executor, Hermes, Codex, and Claude events. Filters include source, age, text, severity (`--level`, this level and above; unleveled events count as info), count, and normalized JSONL. `tx9 logs export <box>` creates a mode-0600 portable log bundle from both isolated volumes. |
55+| `tx9 logs <box>` | Query durable agent, Executor, Hermes, Codex, Claude, and custom-service events. Filters include source, age, text, severity (`--level`, this level and above; unleveled events count as info), count, and normalized JSONL. Custom sources use `service-<name>`. `tx9 logs export <box>` creates a mode-0600 portable log bundle from both isolated volumes. |
5656 | `tx9 resources <box>` | Show actual container CPU/RAM limits and volume usage versus advisory budgets. `resources set` updates limits live and persists them; `resources reset` restores 4 CPU/8 GiB (agent) and 2 CPU/2 GiB (Executor). |
5757 | `tx9 gateway <status\|enable\|disable> <box>` | Inspect or control the container-supervised Hermes gateway. Enable requires `--confirm-single-writer`. |
5858 | `tx9 open <box>` | Print (or open) the authenticated dashboard URL (`?_token=`). |
@@ -108,6 +108,20 @@ the port: · 49 unmodified lines
108108 SQLite histories. Executor data is never mounted into the agent container.
109109 This provides complete tx9-owned runtime output, not an independent audit
110110 trail for operations that Executor does not emit to any durable sink.
111+- **Portable custom services**: direct executable regular-file children of
112+ `${XDG_CONFIG_HOME:-$HOME/.config}/hermes-box/services.d` are supervised as
113+ the agent. Names are limited to `[a-z0-9][a-z0-9_-]{0,62}`. The absolute
114+ file path is passed as argv directly, never sourced or evaluated; scripts
115+ stay foreground and should `exec` their daemon. Each service has an
116+ independent `tx9-logs` capture and bounded restart loop under source
117+ `service-<name>`. Runtime PID/lock state stays outside `/data`, while the
118+ definitions and logs remain on `/data` and therefore travel in backups.
119+ `hb services` reports status and ignored entries; `hb services-reload`
120+ reconciles immediately in addition to the normal 20-second loop. Quiesce
121+ synchronously stops every custom service and blocks restart until
122+ `hb up`/`hb resume`; Hermes gateway enable/disable is independent. Drop-ins
123+ run with the agent's ordinary access and are trusted executable code, not a
124+ sandbox boundary.
111125 - **Gateway single-writer**: restored boxes never auto-enable the Hermes
112126 gateway. `tx9 gateway enable <box> --confirm-single-writer` delegates to
113127 `hb gateway-enable` and stays the only host-side path.