Files
ShellBook/.agents/mind/gotchas.md
T
Florian Schmidt 4fe64ee110 docs: record UI-first rule and deploy/integration lessons
AGENTS.md gains the invariant that servers, credentials, notebooks, chat and setup are all doable from the web UI. Project mind records #7-#10 status and the pct exec, TUN, path-convention and watcher-timing gotchas.
2026-11-16 10:32:37 +01:00

19 lines
2.3 KiB
Markdown

# Gotchas
- [2026-11-16] **CRLF notebooks:** step scripts must be LF-normalized in the parser, or bash sees `cmd
`. Covered by a core test.
- [2026-11-16] **Host key flow:** server emits `run.hostKeyUnknown` then `run.finished` (exit -1) for the aborted attempt; the web reducer must keep the prompt open (`status: hostKey`).
- [2026-11-16] **tmux under systemd:** default KillMode=control-group kills the tmux server on restart; unit uses `KillMode=process` so Claude sessions survive (spec §6).
- [2026-11-16] **Env names:** single data dir variable is `SHELLBOOK_DATA_DIR` (server config, auth, CLI, installer). SSH key: `SHELLBOOK_SSH_KEY`.
- [2026-11-16] **Exit codes vs errors:** a non-zero script exit is a normal result (check ❌) and goes only in run.finished; run.error is for transport/setup failures.
- [2026-11-16] **Notebook root symlinks (#9):** validating only child components after realpath(root) permits a symlinked notebooks root. Notebook reads and mutations validate the root itself before walking children; regression-covered. Workspace CLI/filesystem writers remain trusted against concurrent path swaps.
- [2026-11-16] **Chat CLI permissions (#8):** allowedTools only auto-approves; tools + restricted mode (2.1.248+) enforce the file/tool boundary. Synthetic fixture tests never invoke the real CLI; deployment must verify installed-version/login compatibility.
- [2026-11-16] **`pct exec` PATH** is `/sbin:/bin:/usr/sbin:/usr/bin` (no /usr/local/bin) and root `tar` keeps archive uids; install/update scripts set PATH and use `tar --no-same-owner`. Deploy tests in `deploy/test/`.
- [2026-11-16] **CT TUN passthrough:** a CT with manual `lxc.mount.entry` for /dev/net/tun fails to start if `devN: /dev/net/tun` is added too (autodev hook status 17); `ct-config.sh has_tun_passthrough` detects both forms.
- [2026-11-16] **Path conventions:** web/API notebook paths are relative to `notebooks/`; chat protocol paths are workspace-relative (`notebooks/...`). Convert at the ChatPanel boundary.
- [2026-11-16] **Watcher timing tests:** full parallel test run on Windows delays fs events >100 ms; keep watcher test debounce/quiet windows generous.
- [2026-11-16] **HTTP errors:** server httpError messages (4xx/502/503) are user-facing and shown by the web client; 500 messages are not. Keep 4xx/502 messages free of secrets.
## Archive