The mac side of the unified migration is done and verified (doom sync,
eglot/expert for elixir-ts and heex-ts, flycheck, code actions). The
note now records:
- agent-environment lessons: pi sandbox blocks writes to ~/.emacs.d
(humans must run doom sync/env), sandbox PATH lacks /opt/homebrew/bin,
eglot is lazy on the mac (checks need (require 'eglot) first), doom is
a fork at ~/.emacs.d/sources/doom+.
- STT facts gathered this session: whisper.el server modes, brew's
whisper-server serving only /inference, live-dictate's ws /v1/realtime
requirement, GGML model provenance, sox/ffmpeg present.
- updated known-defects list, including that config-local.el now really
loads (1e1ad31) and Linux must check for a stale one.
7.3 KiB
Agent start here: handoff note (v2)
Rewritten 2025-11-05 after the mac session finished the unified migration.
Read this before touching anything. The previous version (mac after first
pull) is obsolete; its pending mac work is done.
Where things stand
Both machines share one branch: unified. The Linux side brought its
config up; the mac side has now pulled, synced, and verified. Commits from
the mac session (local on the mac, pushed only if the human asks):
2e21324 fix(config): actually load config-local.el
c1ec048 feat(mac): port whisper/live-dictate speech-to-text from Linux
aadc326 fix(mac): configure the elixir server that actually exists
08ec9f5 docs: add agent-start-here.md for the mac after pull (v1 of this note)
6df0d5b fix(packages): declare whisper and websocket (from Linux)
0b3cf5b fix(elixir): let the OS files own eglot-server-programs (from Linux)
9bff435 refactor(treesit): drop unused typescript grammars (from Linux)
Verified working on the mac (runtime, human-confirmed): doom sync
(whisper.el + emacs-websocket installed), eglot connecting to expert for
elixir-ts-mode AND heex-ts-mode, flycheck, eglot code actions.
Verified static only (mac): check-parens on all config files; grep
checks; the alist-get/setf pattern unit-tested in vanilla Emacs 30.2.
Ground rules
- Work on
unified. Do not switch tomaster, and do not push unless the human asks. - Never run
git clean. The rootinit.elis an untracked, gitignored symlink;git clean -xfddeletes it. Recreate with./bin/link-machine.sh. - Never commit
init.el,custom.el,config-local.el, or*.elc. config.elandpackages.elare shared by both machines. Preferconfig-mac.el/config-linux.elfor machine-specific work.- Do not "reconcile"
mac/init.elwithlinux/init.el. They differ on purpose (mac: no+eglot, elixir module without+lsp, vertico-era module list; Linux:(elixir +lsp), etc.). config.elends with apcasedispatch loading the OS leaf, and NOW ALSO loadsconfig-local.ellast (see below), so: shared < OS leaf < local.
What each file owns
| File | Ownership |
|---|---|
config.el |
shared settings, loaded first |
packages.el |
shared package declarations |
config-linux.el |
loaded on GNU/Linux only |
config-mac.el |
loaded on macOS only |
linux/init.el, mac/init.el |
per-machine Doom module lists |
config-local.el |
gitignored overrides; actually loaded since 2e21324, after everything else. Template: config-local.example.el |
Agent environment lessons (cost us time; read these)
- pi's sandbox blocks all writes to
~/.emacs.d.doom sync,doom env, anything that writes caches/logs fails withOperation not permitted, andsandbox-execcannot escape it. Humans must rundoom sync/doom envin a normal terminal. Reads of~/.emacs.dwork fine. - The sandbox PATH lacks
/opt/homebrew/bin.command -v expertsaid "not found" while/opt/homebrew/bin/expertexisted. Alwaysexport PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"first in bash calls. - eglot is lazy on the mac. No
+eglotmodule; eglot is Emacs 30's built-in, first loaded by theeglot-ensurehook (config.el) when an elixir/heex buffer opens. Before that,eglot-server-programsis void-variable. The correct check:Expect(progn (require 'eglot) (alist-get '(elixir-mode elixir-ts-mode heex-ts-mode) eglot-server-programs nil nil #'equal))("expert" "--stdio"). Note Emacs 30's built-in default entry for that key is a dynamiceglot-alternativesclosure (language_server.sh/start_lexical.sh), which our entry replaces in place. - Emacs is 30.2 (emacs-plus, homebrew); doom is a fork at
~/.emacs.d/sources/doom+. Check the fork's modules before assuming upstream Doom behavior.
Open work: speech-to-text on the mac
config-mac.el now has the ported whisper/live-dictate block (keys under
SPC A). whisper and websocket are installed. What is missing is a
backend. Facts established this session, so the next agent need not
re-derive them:
whisper.elserver modes:nil(run whisper-cli as subprocess),local/remote(whisper.cpp native HTTP server,/inference),openai(POST to<whisper-openai-api-baseurl>+v1/audio/transcriptions).- The mac block currently uses
openaimode → needs a Lemonade-style OpenAI-compatible server onlocalhost:13305(that is what Linux runs). - Homebrew's
whisper-serverserves only/inference(no OpenAI-compat endpoint in the installed build). So for whisper.cpp the mac block should switch towhisper-server-mode 'remotewithwhisper-server-baseurlpointing at its port, or use modenil(subprocess, no server). Verify the exact knob in whisper.el before editing. live-dictate(SPC A d) streams overws://host/v1/realtime(OpenAI Realtime-style websocket). whisper.cpp cannot serve that. Streaming dictation on the mac therefore needs a Lemonade-style backend — e.g. the Linux box's, vialive-dictate-server-url— or a new streaming backend. Record-and-transcribe (SPC A w) works with whisper.cpp.- whisper.cpp uses GGML model files (same ecosystem as the human's
source-built llama.cpp). Models come from HuggingFace
(
ggml-org/whisper.cpp, e.g.ggml-large-v3-turbo.bin); the human is picking one.whisper-server --port 13305 --model <path>(defaults 127.0.0.1:8080).soxandffmpegare already installed. live-dictateon darwin needslive-dictate-ffmpeg-input-device ":0"(already set in config-mac.el). First use triggers the macOS mic permission prompt.- If the human prefers not to commit the backend choice, the URLs
(
whisper-openai-api-baseurl,live-dictate-server-url) can move toconfig-local.el— which finally loads now.
Known shared defects (still open; out of scope unless the human asks)
config.el'suse-package! pi-coding-agentblock is awkward::commands piplus an:initdefalias do overlapping jobs; a:customline is commented out. Balanced parens, loads fine, but should be cleaned up.- Dead/commented leftovers in
config.el:linum-format(mode gone in Emacs 29), duplicatedisplay-line-numbers-typeandenable-local-variablessettings, commenteddoom-fontblock. - Org paths are mac-shaped in shared
config.el(~line 42):org-directory/org-roam-directorypoint at~/MyDocuments/..., which does not exist on Linux. Fix on the Linux side by adding Linux values toconfig-linux.el, not by changing the mac path. - LaTeX fonts are mac-only in shared
config.el(~line 128): ETBembo RomanOSF / Raleway / Fira Code inorg-latex-classes. Linux PDF export fails until that block moves toconfig-mac.el. - Duplicated blog roots in shared
config.el(~line 318) and in both leaves. Harmless (leaf wins) but should be removed from the shared file. config-local.elnow actually loads (2e21324). If a stale one exists on the Linux machine, its settings wake up on the next restart there. The Linux session should check for its existence before anything else.
When done
Report: git log --oneline and git status --short; what changed file by
file and why; static vs runtime checks, explicitly; any machine-specific
values still leaking from shared files. Then update or delete this note.