Files
ShellBook/.agents/mind/gotchas.md
T

20 lines
2.5 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.
- [2026-11-16] **CJS named imports in the bundle:** `import { utils } from "ssh2"` passes Vitest but crashes `node dist/main.js`; import CommonJS packages via default export. `test/bundle.test.ts` starts the real bundle.
## Archive