aboutsummaryrefslogtreecommitdiff
path: root/todo.org
diff options
context:
space:
mode:
Diffstat (limited to 'todo.org')
-rw-r--r--todo.org4142
1 files changed, 2417 insertions, 1725 deletions
diff --git a/todo.org b/todo.org
index 5245f3fe9..82a889f5e 100644
--- a/todo.org
+++ b/todo.org
@@ -55,115 +55,136 @@ Tags are additive. For example, a small wrong-behavior fix can be
=:bug:quick:=, and a feature that requires internal restructuring can be
=:feature:refactor:=.
* Emacs Open Work
-** TODO [#C] todo.org org-lint follow-ups :refactor:
-From the 2026-06-15 lint-org sweep. Each needs a human read — these are judgment items, not mechanical fixes, and the line numbers will drift as todo.org changes.
-- obsolete-properties-drawer — incorrect PROPERTIES drawer contents (lines 8392, 4201, 4023, 65, 55).
-- misplaced-heading — possibly misplaced heading (line 8116).
-
-** VERIFY [#A] calendar-sync drops final occurrences, resurrects cancelled meetings :bug:solo:next:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-13
-:END:
-Needs from Craig: a real .ics fixture (or two) that reproduces both symptoms — a recurring event missing its final occurrence, and a cancelled meeting that reappears. This is RFC-5545 recurrence handling (RRULE/UNTIL/EXDATE/STATUS:CANCELLED); I won't guess-patch the parser without a failing case to test against. Drop a sanitized .ics and I'll write the characterization test + fix.
-RFC 5545 conformance holes in =modules/calendar-sync.el=, all agenda-visible (from the 2026-06 config audit):
-- =:973,1015,1024= — UNTIL treated as exclusive (strict =calendar-sync--before-date-p=); RFC and Google make it inclusive, so the LAST instance of every UNTIL-bounded series vanishes. Tests assert loose count ranges, so it's unpinned. Allow equality.
-- =:578= — comma-separated EXDATE lists (Google emits them) never parse; the exclusion drops silently and cancelled occurrences reappear on the agenda. Split on "," before parsing; no comma-case test exists.
-- =:902= — timed events without DTEND render as all-day (time lost); multi-day all-day spans collapse to one day (end date unused, exclusive-DTEND unhandled). Emit start-time-only stamps and org date ranges.
-
-** VERIFY [#A] Native compilation disabled config-wide; GC at stock 800KB :bug:next:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-13
-:END:
-Needs from Craig: re-enabling native-comp config-wide is a stability/perf judgment, not a mechanical fix. Was it disabled deliberately (a crash, a build without native-comp, async-warning noise)? If you want it back on, confirm and I'll re-enable + raise the GC threshold and verify a clean full launch; otherwise this stays parked. I won't flip it blind.
-From the 2026-06 config audit (verified against the live daemon). =early-init.el:69= =(setq native-comp-deferred-compilation nil)= — the obsolete alias of =native-comp-jit-compilation= — turns JIT native compilation OFF entirely, not "synchronous" as the comment claims: 19 .eln files exist for 184 packages, ~100 of 121 modules run interpreted for the daemon's lifetime, and system-defaults.el:42-44's speed-3/8-jobs/always-compile settings are dead. Plus =early-init.el:113-116= restores =gc-cons-threshold= to the captured STOCK default (800000, verified) post-startup — frequent small GC pauses forever. Together these plausibly feed the filed org-capture 15-20s task more than anything in the capture path itself. Actions: retest the old "Selecting deleted buffer" race on 30.2 and re-enable JIT (or AOT sweep); set a deliberate 16-64MB threshold (or gcmh). Check both before burning time on the capture-perf debug task.
-
-** VERIFY [#B] calendar-sync robustness: atomic writes, curl --fail, zero-event false errors :bug:solo:next:
-Deferred, pairs with the calendar-sync recurrence VERIFY above. The mechanical parts (write to a temp file + rename, add curl --fail, guard the zero-event case) are doable, but any calendar-sync change needs verification against a real .ics feed to avoid masking a genuine empty/failed sync. Do this together with the recurrence fix once you provide a fixture / confirm the live feed.
-From the 2026-06 config audit, =modules/calendar-sync.el=:
-- =:1309= — agenda file written via =with-temp-file= directly on the target (truncate-in-place); org-agenda/chime reading mid-write sees a partial calendar, hourly. Write temp + =rename-file= (atomic same-fs). Same for =--save-state= :258.
-- =:1284= — curl runs without =--fail=: an HTTP 404/500 error page exits 0 and the HTML proceeds into conversion.
-- =:1229-1233= — =--parse-ics= returns nil for both garbage and a valid calendar with zero in-window events, so healthy near-empty calendars report "parse failed" in =calendar-sync-status=. Distinguish the cases.
-
-** VERIFY [#B] org-roam :config triggers the 15-20s refile scan synchronously at first idle :bug:solo:next:
-Needs from Craig: this is measurement-first (perf), not a blind fix — it's the same bottleneck as the "optimize org-capture target building" debug task. Run /debug with debug-profiling to measure what actually costs the 15-20s (file count? regex? agenda rebuild?), then fix from the data. I won't restructure the refile/agenda scan without a profile. Say "let's debug it" and I'll profile + fix.
-=modules/org-roam-config.el:78-79= — org-roam is =:defer 1=, so its :config calls =cj/build-org-refile-targets= at 1s idle, BEFORE the 5s background timer (=org-refile-config.el:144-151=); on a cold cache the 30k-file scan runs inline and freezes Emacs at first idle. Drop the call — org-roam is loaded long before the 5s timer fires. Likely a player in the filed org-capture 15-20s perf task (=[#B] Optimize org-capture target building performance=) — check both together. From the 2026-06 config audit.
-
-** VERIFY [#B] transcription: stderr never reaches the log, video transcripts stranded in /tmp :bug:solo:next:
-Deferred from the batch (no blocker; needs a focused pass with live verification). Plan: (1) transcription-config.el:210 — make-process :stderr with a file path creates a buffer, not a file; route stderr into the process buffer and write the captured text out in the sentinel, then drop the leaked buffer. (2) :370-374 — derive the txt/log base from the VIDEO path, not the temp mp3's /tmp path, so transcripts land alongside the source. The path-derivation half is cleanly unit-testable; the stderr half needs a real transcription run to verify, which is why I held it for a focused session rather than the batch.
-From the 2026-06 config audit, =modules/transcription-config.el=:
-- =:210= — =make-process :stderr= with a file PATH creates a BUFFER named like the path (verified by probe); the "Errored. Logs in <file>" notification points at a log without the error text, and the hidden stderr buffer leaks per transcription. Route stderr into the process buffer or write it out in the sentinel.
-- =:370-374= — video path derives txt/log from the temp mp3's /tmp path; the transcript lands in /tmp and dies on reboot, contradicting the "alongside the source" docstring. Pass the video's path as the output base.
-
-** VERIFY [#C] Dirvish: free D for hard-delete, move duplicate :feature:quick:next:
-Needs from Craig: two confirmations before I wire this. (1) Which key for the moved duplicate command (your note said "duplicate on 2" — confirm 2)? (2) Binding D to sudo rm -rf is genuinely dangerous; confirm you want a forced hard-delete on a single capital key, and whether it should prompt (yes-or-no-p naming the target) before running. I won't bind an unguarded sudo rm -rf autonomously.
-In dirvish, keep =d= = delete (=dired-do-delete=), move duplicate (=cj/dirvish-duplicate-file=, currently =D=) to another key, and bind =D= = =sudo rm -rf= for a forced hard delete — capital for the more destructive op. Craig's note says "duplicate on 2"; confirm that's the intended key, and guard the sudo path carefully before wiring. From the roam inbox.
-
-** VERIFY [#C] page-signal pager account deregistered — re-registration needs your hands
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-12
-:END:
-Reported by .emacs.d 2026-06-12 01:01: the dedicated pager number (+15045173983, the Claude Pager Google Voice number on signal-cli) returns "User ... is not registered" on every send — Signal appears to have deregistered it (GV numbers get periodically re-verified). Re-registration requires captcha/SMS, which only you can do. Until then every page-signal call fails; .emacs.d's config-audit page fell back to email. Wrapper lives at claude-templates/bin/page-signal.
-
-** VERIFY [#C] Pull a fullscreen terminal window away with C-; b + arrow :feature:next:
-Needs from Craig: confirm the intended behavior. When a terminal fills the frame, C-; b + arrow should "pull a window away" — split off a new window in the arrow's direction and move focus there? Or pop the terminal out and restore the prior layout? The C-; b window family exists (resize lives there); I need the exact gesture + target before wiring it.
-When a terminal fills the frame, =C-; b= then a right or down arrow should shrink the window from that edge, reducing its width or height so another buffer can share the screen without leaving the terminal. Relates to the ai-term adaptive placement and unified-popup tasks. From the roam inbox.
+** PROJECT [#A] Manual testing and validation
+Exercised once the phases above land.
+*** DONE F12 opens the eshell-through-EAT terminal (dock, visual, colors, prompt, z)
+CLOSED: [2026-06-27 Sat 12:50]
+What we're verifying: F12 now opens and toggles eshell run through EAT (eat-eshell-mode), docked with the remembered geometry; F12 + C-; reach Emacs from inside it; and the eshell-in-eat features land. Wiring verified live; this is the hands-on check only Craig can run.
+- Press F12 in a normal frame. Expected: an eshell docks (bottom or right per the column rule), prompt shows the git branch when in a repo, focus in it.
+- Run a visual command (=htop= / =vim FILE= / =less FILE=). Expected: it renders full-screen in EAT, behaves like a real terminal.
+- Run a colored command (=ls --color= / =git log --color=). Expected: colors look right, not doubled or garbled (the xterm-color-removal check).
+- Run a failing command (=false=). Expected: the next prompt shows =[1]= (the exit-status segment).
+- Run =z <dir-fragment>=. Expected: jumps to a zoxide-remembered directory.
+- Press F12 again from inside. Expected: hides. Press F12 again. Expected: returns at the remembered size.
+- From inside, press =C-; b= (a window-family leaf). Expected: the global prefix works, not typed into the shell.
+Expected: F12 docks/hides/redocks one eshell-through-EAT terminal; visual commands render, colors are clean, the prompt shows branch + exit status, =z= jumps, and F12/C-; reach Emacs.
+*** DONE ai-term agents run through EAT (launch, swap, detach/reattach)
+CLOSED: [2026-06-27 Sat 12:50]
+What we're verifying: agents now spawn in EAT instead of ghostel, with the tmux persistence intact. The spike + 157 unit tests pass; this is the live agent launch only Craig can run.
+- =C-; a a= (or =C-; a s= to pick a project). Expected: an agent launches in an EAT terminal (buffer =agent [<project>]=) running the AI tool over tmux.
+- With two agents open, press =M-SPC= repeatedly. Expected: it swaps to the next agent (M-SPC reaches Emacs from inside the EAT agent buffer).
+- Kill an agent buffer (not the session), then re-open the same project. Expected: it reattaches the live tmux session (output intact), not a fresh agent.
+- After an Emacs restart with =aiv-*= sessions alive, re-open a project. Expected: reattaches the detached session.
+Expected: agents launch and render in EAT, M-SPC swaps from inside, and detach/reattach works exactly as it did on ghostel.
+*** DONE ai-term next steps into and attaches a detached session
+CLOSED: [2026-06-27 Sat 12:50]
+What we're verifying: =C-; a n= (or =M-SPC=) cycles into a detached ai-term (alive in tmux, no Emacs buffer) and attaches it, not just live buffers. The pure logic is unit-tested; this is the live attach-on-landing check only Craig can run.
+- Start agents in two projects so two ai-terms exist, then leave one detached (kill its Emacs buffer while the tmux session stays alive, or after an Emacs restart that leaves =aiv-*= sessions running).
+- Confirm one is attached (a live =agent [...]= buffer) and one is detached (its =aiv-= tmux session is alive but has no buffer).
+- Press =C-; a n= repeatedly to cycle through the agents.
+Expected: the rotation includes the detached agent; landing on it recreates its terminal buffer and reattaches the tmux session (its live output appears), instead of skipping it. Order is stable (by buffer name) and wraps after the last.
+*** VERIFY wttrin appears as a themeable app in theme-studio
+What we're verifying: wttrin's four faces (=wttrin-instructions=, =wttrin-key=, =wttrin-mode-line-stale=, =wttrin-staleness-header=) now show up in the studio's package dropdown and render in a generic preview, after being added to =package-inventory.json= and the studio regenerated. Inventory + regen are verified mechanically (40 packages, all studio gates green); this is the visual confirm.
+- Open the studio: =make -C scripts/theme-studio open= (or open =scripts/theme-studio/theme-studio.html= in Chrome).
+- In the application/package dropdown, pick =wttrin=.
+Expected: wttrin is listed, and its four faces are shown as editable rows in a generic preview. (If you later want the other local-checkout packages captured too, restart Emacs and re-run the inventory regen against the clean daemon.)
+*** VERIFY EAT diff backgrounds read dark enough (Claude Code diffs)
+What we're verifying: the added/removed line backgrounds in Claude Code diffs (=eat-term-color-22= / =-52=) now render at about half their former brightness (=#002f00= / =#2f0000=, down from =#005F00= / =#5F0000=) and read as comfortably dark while still clearly green/red. Themed via WIP.json + regenerated WIP-theme.el; live in the daemon. This is the darkness judgment only Craig can make.
+- In a live agent (EAT) buffer, have Claude show a colored diff with both added and removed lines (e.g. ask it to edit a file).
+- Look at the added-line green background and the removed-line red background.
+Expected: both backgrounds read as dark/muted, not bright, with green and red still distinct. If still too bright or now too dark, say a direction and I retune the two hex values. If the brighter within-line word-highlight shades are still too bright, those are different eat-term-color indices I'd need to sample live (=C-h F= on a highlighted word) before darkening.
+*** VERIFY transcription error log captures stderr on a failed run
+What we're verifying: a failed transcription now writes the backend's stderr into the .log file the "Errored. Logs in <file>" notification points at, and no hidden " *transcribe-stderr-*" buffer is left behind. The buffer-not-path fix and the drain-and-kill are unit-tested (39/39 green); this is the live failing-run check only Craig can run.
+- Trigger a transcription that will fail — e.g. feed a corrupt/zero-byte audio file, or point the backend at a missing model — via the normal transcribe command.
+- When the "Errored. Logs in <file>" notification fires, open that .log file.
+- Run =C-x C-b= (list-buffers) and scan for any buffer named like " *transcribe-stderr-...*".
+Expected: the .log file contains the backend's actual error text (not just the header), and no " *transcribe-stderr-...*" buffer remains.
+*** VERIFY Opening a video from dirvish plays it on repeat (mpv)
+What we're verifying: a video opened from dirvish launches mpv with --loop-file=inf so it plays on repeat; non-video external files are unaffected. The routing, predicate, and arg list are unit-tested (15/15) and verified live; this is the visual playback only Craig can confirm.
+- In dirvish, put point on a video file (.mp4 / .mkv / .webm) and press RET to open it.
+Expected: mpv opens the video and loops it continuously (restarts at the end), detached so Emacs is not blocked.
+- Open a non-video external file (a .pdf or .docx) from dirvish.
+Expected: it opens in the OS default handler as before, not mpv.
+Expected: videos open in mpv on repeat; other external files keep their normal handler.
+*** VERIFY Google Keep v1 live setup and first fetch
+What we're verifying: read-only v1 fetches real Keep notes and renders =data/keep.org= once the one-time gkeepapi + master-token setup is done. The code and 27 tests (12 Python + 15 ERT) are green; this is the live-credential step only Craig can run.
+- Install the client into the interpreter =cj/keep-python= uses: =pip install gkeepapi= (or pipx).
+- Obtain a Google master token (one-time, via gkeepapi's current login/gpsoauth flow against your account).
+- Set your email:
+#+begin_src emacs-lisp
+(setq cj/keep-email "you@gmail.com")
+#+end_src
+- Add the token to =~/.authinfo.gpg= (line: =machine google-keep login you@gmail.com password <master-token>=), then clear the auth cache so the daemon sees it:
+#+begin_src emacs-lisp
+(auth-source-forget-all-cached)
+#+end_src
+- Fetch (or press =C-c k r=):
+#+begin_src emacs-lisp
+(cj/keep-refresh)
+#+end_src
+- Open the result with =C-c k o=.
+Expected: =data/keep.org= lists your Keep notes, pinned first, each a header with title/body, labels as org tags, a property drawer (=:KEEP_ID:= / =:UPDATED:= / ...), and an "open in Keep" link. A missing piece (gkeepapi / token / auth) shows a clear =*Warnings*= message naming it, not a crash.
+*** TODO theme-studio preview-locate discoverability read
+What we're verifying: the locate hover/flash actually feels discoverable in a live frame — the subjective read the deterministic gates can't make.
+- Open theme-studio in Chrome (=make theme-studio-open=, or open theme-studio.html).
+- Hover several preview elements across the UI mock and a package pane.
+- Click an on-pane element, then click an off-pane element.
+Expected: hovering updates the preview-label info line immediately with "section > face — value" (no wait on the native tooltip); an on-pane click scrolls to and flashes the right assignment row; off-pane elements don't respond and their title explains why. The flow reads like a legend you can interrogate. If it feels broken or unclear, note where and reopen the relevant phase.
+*** TODO reconcile-open-repos includes dot-named repos
+What we're verifying: M-P (reconcile open repos) now visits repos whose directory name has a dot (mcp.el, capture.el, etc.), which the old "^[^.]+$" filter silently skipped. Fix in modules/reconcile-open-repos.el, live in the daemon; live-daemon check already confirmed discovery, this is the through-the-command spot-check.
+- Run M-P (or M-x cj/reconcile-open-repos)
+- Watch the per-repo progress / final summary
+Expected: dot-named repos under ~/code (mcp.el, gptel-mcp.el, capture.el, google-contacts.el, …) appear in the reconciliation pass, not just dot-free ones.
+*** TODO Safe-lightness guidance reads clearly
+What we're verifying: the L_max marker and unsafe-band shade are legible and land in the right place when editing a covered face.
+- Open the picker in OKLCH mode on region (or hl-line), with syntax colors assigned
+- Read the L_max marker and the shaded unsafe band on the lightness slider
+- Drag lightness up toward and past the marker
+Expected: the marker is visible and correctly placed, the band above it reads as "unsafe," and crossing it is obvious; an out-of-scope face shows no marker.
+*** TODO Safe tint actually reads in real Emacs
+What we're verifying: a background tint the tool calls safe really keeps every token readable behind real syntax-colored text — the whole point of the worst-case floor.
+- In the tool, set a covered face (e.g. region) to a tint at or just below its L_max with the worst-case readout showing PASS
+- Build the theme and load it in Emacs, open a code buffer with varied syntax, and select a region spanning many token colors
+- Read every token through the region highlight, paying attention to the limiting foreground the tool named
+Expected: every token stays readable over the tint, including the limiting one; a tint pushed just past L_max (readout FAIL) shows a visibly strained or unreadable token, confirming the floor matches reality.
+*** TODO Regenerate-replace reads as deliberate
+What we're verifying: the count control clearly signals it rewrites the whole family, so replacing hand-added same-hue colors isn't a surprise.
+- Add two unrelated colors at a similar hue so they share a strip
+- Set that strip's count to 2
+- Watch what happens to the two colors
+Expected: the strip becomes a clean base±2 ramp, the two loose colors are gone, and the control made it obvious that's what it would do before you committed.
+*** TODO Calibre curated ? menu and docked description
+What we're verifying: the curated ? transient, the docked description, and the full dispatch all work in a live calibredb buffer.
+- In a calibredb search buffer, press ? and confirm the curated menu (library / filter / sort / open / describe) appears.
+- Press d or v to dock the selected book's description in a bottom-30% buffer; press q to dismiss it.
+- Press H and confirm calibredb's full dispatch opens.
+Expected: ? shows the curated menu, d/v dock the description (q dismisses), H opens the full calibredb dispatch.
-** VERIFY [#C] Remove unused system-power keybindings :refactor:quick:next:
-Needs from Craig: the task says "confirm the exact set to keep before unbinding." Under C-; ! the bindings are shutdown (s), reboot (r), restart-Emacs (e), and friends. Tell me which to keep bound and which to drop (the completing-read menu still reaches the rare ones), and I'll unbind the rest.
-=modules/system-commands.el= binds shutdown (=C-; ! s=), reboot (=C-; ! r=), restart-Emacs (=C-; ! e=) and friends under the =C-; != prefix. Craig rarely uses them and wants the key real-estate back. Drop the bindings he doesn't use; the completing-read menu can still reach the rare ones. Confirm the exact set to keep before unbinding. From the roam inbox.
+*** TODO Signel: real incoming message raises a toast through the notify script
+What we're verifying: the full receive path (signal-cli → signel --handle-receive → cj/signel--notify → notify script) fires on a real message.
+- Make sure you are NOT viewing the sender's chat buffer.
+- Have a real message sent to you on Signal (or send one from your phone to a second device thread that lands here).
+Expected: a transient info toast titled "Signal: <sender>" with the message text (one line, truncated if long), no sound.
-** DOING [#B] mu4e: cmail can't trash, no account can refile :bug:quick:solo:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-13
-:END:
-=modules/mail-config.el:217-220= — the cmail context (primary account) sets only drafts/sent, so D falls back to default "/trash" which doesn't exist under ~/.mail (=/cmail/Trash= does); and NO context sets =mu4e-refile-folder=, so r targets nonexistent "/archive" everywhere. Accepting mu4e's offer to create the maildir strands mail in a directory mbsync never syncs — messages silently vanish from the server's view. Add =mu4e-trash-folder= to cmail + per-context =mu4e-refile-folder=. From the 2026-06 config audit.
-Fixed 2026-06-13: cmail gets =mu4e-trash-folder= "/cmail/Trash"; refile is a per-message function (=cj/mu4e--refile-folder=) instead of a per-context string — mu4e context :vars are sticky, so a per-context refile leaks one account's archive folder into another. cmail → "/cmail/Archive"; gmail/dmail signal a =user-error= rather than move mail into an unsynced phantom folder (Craig chose the fail-safe over syncing [Gmail]/All Mail — the All Mail option means a multi-GB pull + cross-folder duplicates; revisit if local Gmail archiving is wanted). Applies on next mu4e open; pure dispatch helper covered by tests.
+*** TODO Signel: actively-viewed chat stays quiet
+What we're verifying: the suppression predicate gates the toast when you're reading that chat.
+- Open the sender's chat buffer (=C-; M m=) and keep it the selected window in a focused frame.
+- Have the same sender message you again.
+Expected: the message renders in the buffer, but no desktop toast appears.
-** DOING [#C] Lock screen silently fails — slock is X11-only :bug:quick:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-13
-:END:
-=modules/system-commands.el:105= binds the lockscreen command to =slock=, which can't grab a Wayland session; =cj/system-cmd= launches it detached with output silenced, so C-; ! l does nothing and the screen never locks. Security issue: Craig believes the screen locks when it doesn't. Fix: =hyprlock= (or =swaylock=), ideally resolved per session type via =env-wayland-p= so an X11 fallback survives for other machines. From the 2026-06 config audit.
-Fixed 2026-06-13: lockscreen-cmd resolves to =loginctl lock-session= on Wayland (logind Lock → hypridle → hyprlock, the path idle/sleep locking already uses), =slock= on X11; also added the missing =(require 'host-environment)=. Live in the daemon; manual lock test under the Manual testing parent.
-** PROJECT [#A] Manual testing and validation
-Exercised once the phases above land.
-*** VERIFY mu4e buffers are themed (headers, main, message view)
-What we're verifying: with the mu4e modes excluded from global font-lock, mu4e's manual face properties survive, so the buffers pick up the theme. The headers + main + view-headers are the ones global font-lock was stripping.
-- Restart Emacs (cleanest), or kill and reopen the mu4e buffers
-- Open mu4e, look at the headers list and the main menu
-- Open a message and read the body
-Expected: headers list shows unread/flagged/date/subject in their theme colors (mu4e-unread-face gold, mu4e-header-face green, etc.); the main menu and the message-view headers (From/To/Subject) are themed; the message body still renders correctly (gnus does the body, so it's unaffected). NOTE: a plain "g" refresh in an already-open *mu4e-headers* won't fix it on its own unless font-lock is off there; a restart is the reliable check.
+*** DONE Project-aware capture files into the right todo.org
+CLOSED: [2026-06-24 Wed 11:48]
+What we're verifying: C-c c t and C-c c b file into the current projectile project's todo.org under its "<Project> Open Work" header, and fall back to the global inbox outside a project.
+- Inside a projectile project that has a todo.org, run C-c c t (Task), capture a test entry, and confirm it lands under "<Project> Open Work".
+- Run C-c c b (Bug) similarly and confirm it lands as "* TODO [#C] ..." under the same header.
+- Run a capture from outside any project (or a project with no todo.org) and confirm the global-inbox fallback with a warning.
+Expected: in-project captures land in that project's Open Work; out-of-project captures fall back to the global inbox with a warning.
*** VERIFY C-c ; reaches the custom command family in a real terminal frame
What we're verifying: the TTY mirror prefix C-c ; reaches the same cj/custom-keymap as the GUI C-; prefix, so the whole command family works in a terminal. The unit tests + a live daemon eval already confirm both prefixes resolve to the one keymap; this is the end-to-end in an actual TTY frame, which the batch harness can't drive.
- Open a terminal Emacs frame: emacsclient -nw (or emacs -nw, or Emacs inside vterm/tmux)
- Press C-c ; L (pearl), C-c ; a (AI), C-c ; g (calendar) — the same leaf keys you use under C-; in GUI
- Confirm which-key shows the custom prefix under C-c ;
Expected: each C-c ; <leaf> runs the same command its C-; <leaf> counterpart runs in GUI; which-key lists the family under C-c ;. C-; itself stays working in GUI frames (unchanged).
-*** VERIFY theme-studio gnus view package themes the article headers
-What we're verifying: gnus is now its own view package in theme-studio (it drives the mu4e article view), so the bright-green article headers can be themed and exported. #gnustest confirms the package is registered and its preview emits only real gnus faces; this is the visual read plus the live-green retirement.
-- Reload theme-studio (or make theme-studio-open)
-- Pick "gnus (mu4e article view)" from the view dropdown (sits among the g entries)
-- Confirm the preview shows a header block, an emphasized body, an 11-level quoted reply chain, and a signature
-- Theme a few gnus faces (e.g. gnus-header-name, gnus-header-from, gnus-cite-1) to obvious colors, export to WIP.json, then deploy
-#+begin_src sh :results output
-make -C /home/cjennings/.emacs.d deploy-wip
-#+end_src
-- Restart Emacs (or reload the theme), reopen a mu4e message
-Expected: the studio preview renders each gnus face in its theme color; after export + deploy, the *mu4e-article* From/Subject/To/Date headers show the themed colors instead of the gnus green defaults.
-*** VERIFY theme-studio markdown preview reads like a real README
-What we're verifying: selecting markdown-mode in the view dropdown shows a realistic README (not the generic face-name list), and the markdown faces render legibly in context. #mdtest already confirms the wiring + that every element's face is real; this is the visual read.
-- Reload theme-studio (or make theme-studio-open)
-- Pick "markdown-mode" from the view dropdown
-Expected: a README preview with headers, bold/italic, code, links, lists/checkboxes, blockquote, table, etc., each in its theme face. Clicking an element flashes its row in the faces table.
-*** VERIFY dashboard theming — banner gold, headings themed, items show per-filetype icons
-What we're verifying: with the dashboard out of global font-lock (Fix A) and file icons on (Fix C), the live dashboard shows the theme colors and icons. Eyeball it.
-- Open the dashboard (F1)
-Expected: the "Emacs:" banner title is gold, the "Projects:/Bookmarks:/Recent Files:" headings are themed blue, and the project/recent-file rows each show a colored per-filetype icon (org files greenish, dirs yellow; bookmarks a plain icon).
-*** VERIFY gptel C-; a B switches model without the modeline hang
-What we're verifying: cj/gptel-switch-backend (C-; a B) now sets gptel-model to an interned symbol, so the switch completes without the wrong-type-argument-symbolp redisplay hang. Unit tests + a live helper eval already cover the coercion; this is the interactive end-to-end.
-- Invoke cj/gptel-switch-backend (C-; a B)
-- Pick a backend, then a model from its list
-Expected: the modeline updates to the chosen model and Emacs stays responsive — no "Querying ..." hang, no wrong-type-argument backtrace.
*** VERIFY org-faces color set in theme-studio reaches the agenda
What we're verifying: editing an org-faces-* row in theme-studio, exporting, and deploying lands the new color on the real agenda's keyword/priority. The build-theme -> deftheme half and the live org-todo-keyword-faces / org-priority-faces wiring are already verified mechanically; this confirms the visual end-to-end with a human eye.
- Open theme-studio in Chrome and pick "org-faces" from the application dropdown (it sits beside elfeed and mu4e)
@@ -174,75 +195,75 @@ make -C /home/cjennings/.emacs.d deploy-wip
#+end_src
- Open the org agenda (or any todo.org buffer) and look at a TODO keyword
Expected: the TODO keyword renders in the color just set; the priority cookies and other keywords keep their own colors; an unfocused window shows the dimmed variants.
-*** VERIFY slack keys are safe before slack loads
-What we're verifying: the C-; S slack keys don't error before slack has started, and the prefix shows in which-key. Fixed in modules/slack-config.el; restart to apply (not reloaded into the live session).
-- Restart Emacs but do NOT run cj/slack-start
-- Press C-; S Q (close all), and C-; S w / @ / # (these previously void-function'd or void-variable'd before load)
-- Press C-; S and check which-key shows the "slack" prefix
-Expected: C-; S Q reports "Closed 0 Slack buffers" with no error; w/@/# either run or autoload slack cleanly (no void-function); the which-key popup lists the slack prefix.
*** VERIFY ERC fires one mention notification and lists real servers
What we're verifying: a mention pops a single desktop notification (not two), and cj/erc-connected-servers lists only live server connections. Fixed in modules/erc-config.el; takes effect after an Emacs restart (not reloaded into the live IRC session).
- Restart Emacs and reconnect ERC
- Have someone mention your nick in a channel (or trigger erc-text-matched-hook)
- Run M-x cj/erc-connected-servers with one server connected and a few channels open
Expected: exactly one desktop notification per mention; cj/erc-connected-servers reports just the connected server(s), not every channel/query buffer.
-*** VERIFY modeline still shows the git branch and state
-What we're verifying: the VC-cache simplification didn't change what the modeline shows on a normal repo. Fixed in modules/modeline-config.el (live in the daemon after reload).
-- Open a file inside a git repo
-- Glance at the mode-line VC segment
-Expected: the branch name and state still render as before (e.g. "main" with the usual state face). The change only drops a per-render stat and guards against git errors; normal display is unchanged.
-*** VERIFY info-mode open is non-destructive and cancels cleanly
-What we're verifying: opening a .info file no longer auto-kills the buffer, and the explicit cj/open-with-info-mode prompt cancels cleanly on decline. Fixed in modules/help-config.el; stale daemon state already cleared, so this also survives a fresh restart.
-- find-file a .info file (e.g. one under elpa) — it should open as an ordinary buffer, not vanish into Info
-- In that buffer, edit something, then M-x cj/open-with-info-mode; at the save prompt answer no
-- Repeat M-x cj/open-with-info-mode on an unmodified .info buffer
-Expected: find-file leaves the buffer intact (no auto-kill); declining the save prompt prints "Operation canceled" with no "No catch for tag" error; on an unmodified buffer it opens the file in Info.
*** VERIFY dwim-shell zip/backup/menu-key behave
What we're verifying: single-file zip makes a valid <name>.zip, the dated backup gets a real timestamp, and the dwim-shell menu is reachable on M-D in plain dired. Fixed in modules/dwim-shell-config.el, reloaded into the daemon.
- In dired, mark a single file, run the dwim-shell menu (M-D), pick Zip
- Mark a file, run the menu, pick "Backup with date"
- Open a plain dired buffer (not dirvish) and press M-D
Expected: zip produces foo.zip (a valid archive, openable); backup produces foo.ext.YYYYMMDD_HHMMSS.bak with a real date; M-D opens the dwim-shell command menu in plain dired (before the fix it did nothing there).
-*** VERIFY markdown live preview renders in the browser
-What we're verifying: F2 in a markdown buffer runs the custom cj/markdown-preview (not markdown-mode's own command) and the impatient-mode strapdown preview actually renders. Fixed in modules/markdown-config.el, reloaded into the daemon.
-- Open a .md file with some markdown content
-- M-x cj/markdown-preview-server-start (starts simple-httpd on :8080)
-- Press F2 in the markdown buffer
-Expected: a browser opens http://localhost:8080/imp showing the rendered markdown, and edits to the buffer update the preview live. Pressing F2 before starting the server gives a user-error telling you to start it.
*** VERIFY orderless matching works inside a vertico session
What we're verifying: vertico-prescient no longer overrides completion-styles, so orderless's space-separated, out-of-order matching is live in the minibuffer (prescient still sorts). Fixed in modules/selection-framework.el, applied live in the daemon.
- Run a command with a vertico minibuffer (e.g. M-x, or C-x b)
- Type two space-separated fragments out of order, e.g. "mode buf" to match "switch-to-buffer-other-... mode" style candidates
Expected: candidates match on both fragments regardless of order (orderless), and the ordering still reflects prescient frecency. Before the fix, space-separated out-of-order input would not match.
-*** VERIFY C-; b d diffs, C-; b D deletes
-What we're verifying: the buffer-and-file keymap now puts diff on the easy lowercase key and the destructive delete on the capital. Swapped in modules/custom-buffer-file.el and re-bound live in the daemon.
-- Open a file buffer and edit it without saving
-- Press C-; b d
-- Press C-; b D, then cancel at the delete confirmation
-Expected: C-; b d runs the diff (buffer vs saved file); C-; b D starts delete-buffer-and-file (offers to delete the file). Before the swap these were reversed.
-*** TODO C-s C-s repeats the last search
-What we're verifying: the second consecutive C-s repeats the previous consult-line search instead of erroring "No Vertico session". Fix in modules/selection-framework.el (vertico-repeat-save now on minibuffer-setup-hook), live in the daemon.
-- Press C-s, type a search term, RET to dismiss (or just narrow then exit)
-- Press C-s again, then C-s a second time without any command in between
-Expected: the second C-s reopens the last search (vertico-repeat) rather than signalling "No Vertico session".
-*** TODO reconcile-open-repos includes dot-named repos
-What we're verifying: M-P (reconcile open repos) now visits repos whose directory name has a dot (mcp.el, capture.el, etc.), which the old "^[^.]+$" filter silently skipped. Fix in modules/reconcile-open-repos.el, live in the daemon; live-daemon check already confirmed discovery, this is the through-the-command spot-check.
-- Run M-P (or M-x cj/reconcile-open-repos)
-- Watch the per-repo progress / final summary
-Expected: dot-named repos under ~/code (mcp.el, gptel-mcp.el, capture.el, google-contacts.el, …) appear in the reconciliation pass, not just dot-free ones.
+*** VERIFY face-name buttons open describe-face
+What we're verifying: the face names in the Face Diagnosis report are live buttons. The button text properties (action + face data) are confirmed in the daemon; this is the click/RET confirmation.
+- Put point on themed text and run =C-h F= (=cj/describe-face-at-point=).
+- In the *Face Diagnosis* buffer, move onto a face name (e.g. in the face stack or provenance) and press RET; also try mouse-1.
+Expected: RET or a click on a face name opens that face's =describe-face= help. Non-face entries (anonymous specs) stay plain text. If a name isn't clickable, note which group it's in and reopen.
+*** VERIFY latexmk compiles from C-c C-c
+What we're verifying: the two activation fixes make the latexmk workflow usable end to end. A live .tex buffer already reports =TeX-command-default= "latexmk" and "LatexMk" in =TeX-command-list=; this is the actual compile.
+- Open a small .tex document.
+- Press C-c C-c (it should default to LatexMk without prompting through the other commands first), then RET to run it.
+- Press C-c C-v to view the PDF.
+Expected: C-c C-c runs latexmk and produces a PDF; C-c C-v opens it in the selected viewer. If C-c C-c still defaults to LaTeX or latexmk is missing from the command list, capture it and reopen.
+*** VERIFY mu4e trash and refile land in synced maildirs
+What we're verifying: the cmail trash-folder + per-message refile fix (shipped 2026-06-13, applies on next mu4e open) actually moves mail into folders mbsync syncs, and the gmail/dmail fail-safe blocks instead of stranding mail.
+- Open mu4e (restart it if it was running before the fix) and enter the cmail account.
+- On a cmail message, press =d= (mark for trash), then =x= to execute; confirm it lands in cmail/Trash and survives a sync (not a phantom /trash).
+- On a cmail message, press =r= (refile) then =x=; confirm it lands in cmail/Archive.
+- On a gmail (or dmail) message, press =r=.
+Expected: cmail trash → cmail/Trash, cmail refile → cmail/Archive, both real maildirs mbsync syncs. Refile on gmail/dmail signals a user-error (no move) rather than offering to create an unsynced phantom folder. If any move targets a folder mbsync doesn't sync, capture it and reopen.
+*** STALLED markdown live preview renders in the browser
+What we're verifying: F2 in a markdown buffer runs the custom cj/markdown-preview (not markdown-mode's own command) and the impatient-mode strapdown preview actually renders. Fixed in modules/markdown-config.el, reloaded into the daemon.
+- Open a .md file with some markdown content
+- M-x cj/markdown-preview-server-start (starts simple-httpd on :8080)
+- Press F2 in the markdown buffer
+Expected: a browser opens http://localhost:8080/imp showing the rendered markdown, and edits to the buffer update the preview live.
+Pressing F2 before starting the server gives a user-error telling you to start it.
+
+#+begin_src cj: comment
+ we should simply have the server start if it's not already started.
+#+end_src
+
+*** STALLED ai-term wrap-teardown + shutdown end-to-end
+What we're verifying: the three headless functions drive the rulesets wrap-it-up workflow correctly, including the real tmux/shutdown side effects the ERT tests can't exercise. The .emacs.d functions are in and unit-verified; the rulesets half (workflow + Stop hook) is already built. Test the countdown with a stubbed shutdown command first — do not power off during the check.
+#+begin_src emacs-lisp
+;; temporarily stub the shutdown so the countdown can't power off:
+(setq cj/ai-term-shutdown-command "echo SHUTDOWN-WOULD-FIRE")
+#+end_src
+- "wrap it up" in an agent: the valediction renders fully, then that agent's buffer + its =aiv-<proj>= session + the claude process are gone and the window layout is restored.
+- "wrap it up with summary" / "and summarize": wrap completes but the buffer stays.
+- "wrap it up and shutdown" with a second =aiv-*= session alive: it refuses, names the other session, does a normal wrap (no countdown).
+- "wrap it up and shutdown" as the sole session: the echo area counts 10→1 one per second; press C-g mid-count and confirm "Shutdown cancelled."; then let one run to zero and confirm it would fire the (stubbed) command.
+#+begin_src emacs-lisp
+;; restore the real command when done:
+(custom-reevaluate-setting 'cj/ai-term-shutdown-command)
+#+end_src
+Expected: teardown removes exactly the right session/buffer and restores layout; the with-summary variants keep the buffer; the multi-session shutdown refuses; the sole-session countdown renders, cancels on C-g, and fires only at zero. If any step misbehaves, capture it and reopen. Once the stubbed run looks right, a single real shutdown test confirms the live path.
+
+#+begin_src cj: comment
+ I would like to test this in separate steps naturally as I need them across sessions. please add one child task for each item to test above.
+#+end_src
+
*** 2026-06-15 Mon @ 12:10:06 -0500 org-capture popup single-Task into inbox verified
Craig confirmed: Super+Shift+N pops straight into a Task capture (no menu), single full-frame window, files under "Inbox" in ~/org/roam/inbox.org, and the frame closes cleanly. Passed.
-*** TODO Lock screen actually locks on Wayland
-What we're verifying: C-; ! l locks the screen on Wayland. slock (X11-only) never worked here; the locker now runs loginctl lock-session, which logind turns into a Lock signal that hypridle handles by running hyprlock — the same path idle/sleep locking already uses. Fix in modules/system-commands.el, live in the daemon.
-- Press C-; ! l (or run M-x cj/system-cmd-lock)
-- The screen should lock with hyprlock
-- Unlock with your password
-Expected: the screen locks immediately and unlocks with your password. (Before the fix it printed "Running lockscreen-cmd..." and nothing happened.)
-*** TODO Irreversible actions require a typed "yes" after a daemon restart
-What we're verifying: the strong-confirm tier is restored for irreversible actions. The global (fset 'yes-or-no-p 'y-or-n-p) was removed and those sites now call cj/confirm-strong, which forces a typed "yes"/"no". The fset is baked into the running daemon and can't be cleared from Lisp, so this only takes effect after a restart. Ordinary yes-or-no-p prompts stay single-key (use-short-answers t).
-- Restart the Emacs daemon (clean state)
-- Trigger an irreversible action, e.g. M-x cj/system-cmd-shutdown (then abort), or attempt to overwrite a file via the rename/move commands
-Expected: the irreversible prompt requires typing the full word "yes" (not a single y); a benign yes-or-no-p prompt elsewhere still accepts a single keystroke.
*** 2026-06-11 Thu @ 18:29:39 -0500 Verified UI-face preview and contrast survive a ground bg change
Craig walked the repro: mode-line with its own fg/bg kept its preview bg and ratio through a ground change; ground-dependent rows re-rated; package-faces contrast column updated. Pass. Closed the [#A] contrast-cell and [#B] preview-bg parents.
*** 2026-06-11 Thu @ 18:29:39 -0500 Verified seeded package-face defaults, with steel tuning
@@ -253,108 +274,214 @@ Craig scrolled the org table, filtered on "agenda", reassigned a face — groupi
Craig validated the readouts against computed reference values (default fg #f0fef0 on ground #000000: APCA Lc -104.7 / WCAG 20.14; keyword blue #67809c: Lc -33.7 / WCAG 5.14 — negative polarity correct for light-on-dark). Legible, uncrowded. Pass. Side find filed separately: the picker panel itself blends into the page background ([#C] picker-visibility task).
*** 2026-06-11 Thu @ 18:29:39 -0500 Verified ΔE warnings read clearly
Craig built a near-duplicate pair and a well-spread palette: the close pair was named with its ΔE, sorted closest-first with the cap behaving; no warning on the spread palette. Pass.
-*** TODO OKLCH editor feels right
+*** 2026-06-20 Sat @ 22:11:00 -0400 F9 agent toggle no longer shrinks after a C-; b pull-away
+Craig confirmed in his live GUI frame: the agent window keeps its height across repeated F9 toggles after a C-; b pull-away, even under the WIP theme's near-zero mode-line-inactive. The total-height capture/replay fix holds (dbee95ae).
+*** 2026-06-20 Sat @ 22:11:00 -0400 F9 toggle preserves all windows in a 3-window layout
+Craig confirmed in his live GUI frame: toggling the agent off then on in a 3-window layout returns the same three windows — both working windows survive and the agent re-splits its own bottom strip. The reversible-toggle fix holds (64916462).
+*** 2026-06-24 Wed @ 00:37:18 -0400 C-<up> copy-mode scroll verified in a real terminal
+Craig confirmed in a live terminal: C-<up> enters copy-mode and scrolls up, repeated C-<up> keep scrolling without resetting, the other modified arrows are left alone (C-<left>/C-<right> still do readline word-motion at the prompt). The C-<up>-only fix + already-in-copy guard (commit 7696ff76) holds.
+*** DONE theme-studio markdown preview reads like a real README
+CLOSED: [2026-06-24 Wed 11:47]
+What we're verifying: selecting markdown-mode in the view dropdown shows a realistic README (not the generic face-name list), and the markdown faces render legibly in context. #mdtest already confirms the wiring + that every element's face is real; this is the visual read.
+- Reload theme-studio (or make theme-studio-open)
+- Pick "markdown-mode" from the view dropdown
+Expected: a README preview with headers, bold/italic, code, links, lists/checkboxes, blockquote, table, etc., each in its theme face. Clicking an element flashes its row in the faces table.
+*** DONE C-s C-s repeats the last search
+CLOSED: [2026-06-24 Wed 11:37]
+What we're verifying: the second consecutive C-s repeats the previous consult-line search instead of erroring "No Vertico session". Fix in modules/selection-framework.el (vertico-repeat-save now on minibuffer-setup-hook), live in the daemon.
+- Press C-s, type a search term, RET to dismiss (or just narrow then exit)
+- Press C-s again, then C-s a second time without any command in between
+Expected: the second C-s reopens the last search (vertico-repeat) rather than signalling "No Vertico session".
+*** DONE Irreversible actions require a typed "yes" after a daemon restart
+CLOSED: [2026-06-24 Wed 11:36]
+What we're verifying: the strong-confirm tier is restored for irreversible actions. The global (fset 'yes-or-no-p 'y-or-n-p) was removed and those sites now call cj/confirm-strong, which forces a typed "yes"/"no". The fset is baked into the running daemon and can't be cleared from Lisp, so this only takes effect after a restart. Ordinary yes-or-no-p prompts stay single-key (use-short-answers t).
+- Restart the Emacs daemon (clean state)
+- Trigger an irreversible action, e.g. M-x cj/system-cmd-shutdown (then abort), or attempt to overwrite a file via the rename/move commands
+Expected: the irreversible prompt requires typing the full word "yes" (not a single y); a benign yes-or-no-p prompt elsewhere still accepts a single keystroke.
+*** DONE Calibre bookmark default name is "Author, Title"
+CLOSED: [2026-06-24 Wed 10:56]
+What we're verifying: a new nov bookmark takes the "Author, Title" form parsed from the filename, not the raw EPUB filename.
+- Open an EPUB in Calibre (nov buffer).
+- Hit m to set a bookmark.
+Expected: the default bookmark name is "Author, Title" (underscores stripped, colon restored), e.g. "Agatha Christie, The A.B.C. Murders".
+
+*** DONE theme-studio gnus view package themes the article headers
+CLOSED: [2026-06-24 Wed 11:29]
+What we're verifying: gnus is now its own view package in theme-studio (it drives the mu4e article view), so the bright-green article headers can be themed and exported. #gnustest confirms the package is registered and its preview emits only real gnus faces; this is the visual read plus the live-green retirement.
+- Reload theme-studio (or make theme-studio-open)
+- Pick "gnus (mu4e article view)" from the view dropdown (sits among the g entries)
+- Confirm the preview shows a header block, an emphasized body, an 11-level quoted reply chain, and a signature
+- Theme a few gnus faces (e.g. gnus-header-name, gnus-header-from, gnus-cite-1) to obvious colors, export to WIP.json, then deploy
+#+begin_src sh :results output
+make -C /home/cjennings/.emacs.d deploy-wip
+#+end_src
+- Restart Emacs (or reload the theme), reopen a mu4e message
+Expected: the studio preview renders each gnus face in its theme color; after export + deploy, the *mu4e-article* From/Subject/To/Date headers show the themed colors instead of the gnus green defaults.
+*** DONE dashboard theming — banner gold, headings themed, items show per-filetype icons
+CLOSED: [2026-06-24 Wed 11:29]
+What we're verifying: with the dashboard out of global font-lock (Fix A) and file icons on (Fix C), the live dashboard shows the theme colors and icons. Eyeball it.
+- Open the dashboard (F1)
+Expected: the "Emacs:" banner title is gold, the "Projects:/Bookmarks:/Recent Files:" headings are themed blue, and the project/recent-file rows each show a colored per-filetype icon (org files greenish, dirs yellow; bookmarks a plain icon).
+*** DONE info-mode open is non-destructive and cancels cleanly
+CLOSED: [2026-06-24 Wed 11:41]
+What we're verifying: opening a .info file no longer auto-kills the buffer, and the explicit cj/open-with-info-mode prompt cancels cleanly on decline. Fixed in modules/help-config.el; stale daemon state already cleared, so this also survives a fresh restart.
+- find-file a .info file (e.g. one under elpa) — it should open as an ordinary buffer, not vanish into Info
+- In that buffer, edit something, then M-x cj/open-with-info-mode; at the save prompt answer no
+- Repeat M-x cj/open-with-info-mode on an unmodified .info buffer
+Expected: find-file leaves the buffer intact (no auto-kill); declining the save prompt prints "Operation canceled" with no "No catch for tag" error; on an unmodified buffer it opens the file in Info.
+*** DONE C-; b d diffs, C-; b D deletes
+CLOSED: [2026-06-24 Wed 11:43]
+What we're verifying: the buffer-and-file keymap now puts diff on the easy lowercase key and the destructive delete on the capital. Swapped in modules/custom-buffer-file.el and re-bound live in the daemon.
+- Open a file buffer and edit it without saving
+- Press C-; b d
+- Press C-; b D, then cancel at the delete confirmation
+Expected: C-; b d runs the diff (buffer vs saved file); C-; b D starts delete-buffer-and-file (offers to delete the file). Before the swap these were reversed.
+*** DONE nerd-icons colors are theme-driven (legend + live icons)
+CLOSED: [2026-06-24 Wed 11:35]
+What we're verifying: the nerd-icons v1 feature reads right end to end. The Python/Node/browser gates pass; this is the visual confirmation the gates can't make — the legend pane and the real per-filetype icon colors after the tint removal.
+- In theme-studio, open the nerd-icons pane: the legend should show each filetype's real nerd-font glyph in its mapped color (el purple, py dark-blue, dir yellow, …), with the 34 color faces editable on the left.
+- Recolor a face (e.g. nerd-icons-purple) and confirm every legend row mapped to it repaints immediately.
+- Restart Emacs (the running daemon still has the old darkgoldenrod tint baked into the faces until restart).
+- In a fresh frame, look at icons in completing-read (find-file), dirvish, the dashboard, and ibuffer.
+Expected: the legend renders glyphs in their assigned colors and recolor repaints live; after restart, file/dir/buffer icons show nerd-icons' per-filetype multicolor palette driven by the theme (not a uniform darkgoldenrod), and directory icons are yellow. If icons are still uniform or uncolored, capture it and reopen.
+*** DONE ai-term keybindings land on C-; a + M-SPC
+CLOSED: [2026-06-24 Wed 10:36]
+What we're verifying: the relocated ai-term keys work in a live frame, including from inside an agent buffer, and the no-agent fallback launches the picker.
+- Press M-SPC from a normal buffer with at least one agent open.
+- Press M-SPC again from inside an agent buffer (ghostel).
+- With no agent running, press M-SPC.
+- Walk C-; a a, C-; a s, C-; a n, C-; a k (which-key should show the ai-term menu under C-; a).
+- Press F9, C-F9, s-F9, M-F9.
+Expected: M-SPC swaps to the next agent (rotating, wrapping) both from a normal buffer and from inside an agent. With no agent running, M-SPC opens the project picker rather than erroring. C-; a a toggles the most-recent agent, s opens the picker, n swaps, k closes. The F9 family does nothing (unbound). Note: the running daemon still has gptel in memory from before the archive, so a full Emacs restart is the clean confirmation that nothing regressed at startup.
+*** DONE deferred game commands still work after a restart (load-graph Phase 4)
+CLOSED: [2026-06-24 Wed 10:37]
+What we're verifying: with games-config no longer eagerly required, malyon and 2048-game still launch from a fresh Emacs, and games-config loads on first use rather than at startup. Batch tests cover the autoload chain; this is the interactive confirmation the spec asks for after each deferral batch.
+- Restart Emacs (daemon or standalone) so games-config is no longer pre-loaded from this session.
+- Confirm it's not loaded at startup:
+#+begin_src emacs-lisp
+(featurep 'games-config)
+#+end_src
+- M-x malyon — it should load games-config and the malyon package, then start interactive fiction (stories under ~/sync/org/text.games/).
+- M-x 2048-game — should start the 2048 puzzle.
+- Re-check (featurep 'games-config) — now non-nil.
+Expected: at startup (featurep 'games-config) is nil; both commands launch normally; after invoking one, games-config is loaded. If a command errors instead of launching, capture it and reopen the deferral as a TODO.
+*** DONE native-comp + gcmh survive a daemon restart cleanly
+CLOSED: [2026-06-24 Wed 10:37]
+What we're verifying: re-enabling JIT native compilation and switching GC to gcmh holds up across a full daemon restart and a real work session. The fix is live in the current daemon and a throwaway daemon launched clean, but the already-loaded modules only get natively compiled on a fresh start (a background async burst), and the old "Selecting deleted buffer" race needs a real GUI session to rule out on 30.2.
+- Restart the Emacs daemon (clean state): kill it and start fresh, or reboot.
+- Use Emacs normally for a while — the first session after restart triggers background native compilation of ~100 modules. Watch for any "Selecting deleted buffer" errors or compilation crashes (check the *Async-native-compile-log* buffer and comp-warnings.log).
+- After things settle, confirm the settings are live:
+#+begin_src emacs-lisp
+(list :jit native-comp-jit-compilation
+ :gcmh gcmh-mode
+ :gcmh-high gcmh-high-cons-threshold)
+#+end_src
+- Edit normally (completion, agenda, AI buffers) and notice whether the periodic GC jank is gone.
+Expected: restart is clean (no backtrace); the background native-comp burst finishes without "Selecting deleted buffer" errors; the form returns (:jit t :gcmh t :gcmh-high 1073741824); editing feels smoother with no frequent GC pauses. If the async race recurs on 30.2, capture the error and reopen as a TODO — the fallback is an AOT sweep or going back to JIT-off.
+*** DONE mu4e buffers are themed (headers, main, message view)
+CLOSED: [2026-06-24 Wed 10:38]
+What we're verifying: with the mu4e modes excluded from global font-lock, mu4e's manual face properties survive, so the buffers pick up the theme. The headers + main + view-headers are the ones global font-lock was stripping.
+- Restart Emacs (cleanest), or kill and reopen the mu4e buffers
+- Open mu4e, look at the headers list and the main menu
+- Open a message and read the body
+Expected: headers list shows unread/flagged/date/subject in their theme colors (mu4e-unread-face gold, mu4e-header-face green, etc.); the main menu and the message-view headers (From/To/Subject) are themed; the message body still renders correctly (gnus does the body, so it's unaffected). NOTE: a plain "g" refresh in an already-open *mu4e-headers* won't fix it on its own unless font-lock is off there; a restart is the reliable check.
+*** DONE slack keys are safe before slack loads
+CLOSED: [2026-06-24 Wed 10:44]
+What we're verifying: the C-; S slack keys don't error before slack has started, and the prefix shows in which-key. Fixed in modules/slack-config.el; restart to apply (not reloaded into the live session).
+- Restart Emacs but do NOT run cj/slack-start
+- Press C-; S Q (close all), and C-; S w / @ / # (these previously void-function'd or void-variable'd before load)
+- Press C-; S and check which-key shows the "slack" prefix
+Expected: C-; S Q reports "Closed 0 Slack buffers" with no error; w/@/# either run or autoload slack cleanly (no void-function); the which-key popup lists the slack prefix.
+*** DONE modeline still shows the git branch and state
+CLOSED: [2026-06-24 Wed 10:45]
+What we're verifying: the VC-cache simplification didn't change what the modeline shows on a normal repo. Fixed in modules/modeline-config.el (live in the daemon after reload).
+- Open a file inside a git repo
+- Glance at the mode-line VC segment
+Expected: the branch name and state still render as before (e.g. "main" with the usual state face). The change only drops a per-render stat and guards against git errors; normal display is unchanged.
+
+*** DONE Lock screen actually locks on Wayland
+CLOSED: [2026-06-24 Wed 10:45]
+What we're verifying: C-; ! l locks the screen on Wayland. slock (X11-only) never worked here; the locker now runs loginctl lock-session, which logind turns into a Lock signal that hypridle handles by running hyprlock — the same path idle/sleep locking already uses. Fix in modules/system-commands.el, live in the daemon.
+- Press C-; ! l (or run M-x cj/system-cmd-lock)
+- The screen should lock with hyprlock
+- Unlock with your password
+Expected: the screen locks immediately and unlocks with your password. (Before the fix it printed "Running lockscreen-cmd..." and nothing happened.)
+*** DONE OKLCH editor feels right
+CLOSED: [2026-06-24 Wed 10:47]
What we're verifying: the OKLCH sliders / C×L plane edit cleanly and clamping is visible.
- Switch the picker to OKLCH mode and drag L, then C, then H
- Push chroma past the sRGB gamut, then toggle the AA/AAA mask
Expected: each axis moves independently; the C×L plane (once 4b lands) opens on the current color; "chroma clamped to sRGB" shows on clamp; toggling the mask does not reset OKLCH mode.
-*** TODO Generated ramp harmonizes
+*** DONE Generated ramp harmonizes
+CLOSED: [2026-06-24 Wed 10:47]
What we're verifying: a ramp generated from a base color reads as one family, not a grab-bag (the aesthetic the math is meant to produce).
- Open =scripts/theme-studio/theme-studio.html= in Chrome
- Pick a mid-lightness base swatch (e.g. a blue) and generate its ramp at the defaults
- Read the row of steps left to right, then try a near-black and a near-white base
Expected: the steps share an obvious hue and step evenly in lightness; the chroma-ease keeps the extreme steps from going muddy or garish; nothing looks like it belongs to a different color.
-*** TODO Safe-lightness guidance reads clearly
-What we're verifying: the L_max marker and unsafe-band shade are legible and land in the right place when editing a covered face.
-- Open the picker in OKLCH mode on region (or hl-line), with syntax colors assigned
-- Read the L_max marker and the shaded unsafe band on the lightness slider
-- Drag lightness up toward and past the marker
-Expected: the marker is visible and correctly placed, the band above it reads as "unsafe," and crossing it is obvious; an out-of-scope face shows no marker.
-*** TODO Safe tint actually reads in real Emacs
-What we're verifying: a background tint the tool calls safe really keeps every token readable behind real syntax-colored text — the whole point of the worst-case floor.
-- In the tool, set a covered face (e.g. region) to a tint at or just below its L_max with the worst-case readout showing PASS
-- Build the theme and load it in Emacs, open a code buffer with varied syntax, and select a region spanning many token colors
-- Read every token through the region highlight, paying attention to the limiting foreground the tool named
-Expected: every token stays readable over the tint, including the limiting one; a tint pushed just past L_max (readout FAIL) shows a visibly strained or unreadable token, confirming the floor matches reality.
-*** TODO Color families group the way the eye reads them
+*** DONE Color families group the way the eye reads them
+CLOSED: [2026-06-24 Wed 10:51]
What we're verifying: the OKLCH hue clustering (25° gap) splits and merges families the way you'd expect, and renaming never moves a color.
- Open =scripts/theme-studio/theme-studio.html= in Chrome and load a real theme (e.g. sterling)
- Read the strips top to bottom: are "the blues" one strip, "the greens" another, neutrals and ground pinned at the top
- Find a pair you'd consider one family that landed in two strips (or two you'd consider separate that merged)
- Rename any swatch to something absurd and confirm it stays in the same strip
Expected: families match your mental grouping; the few that don't are the cue to revisit the 25° gap; renaming never regroups.
-*** TODO Regenerate-replace reads as deliberate
-What we're verifying: the count control clearly signals it rewrites the whole family, so replacing hand-added same-hue colors isn't a surprise.
-- Add two unrelated colors at a similar hue so they share a strip
-- Set that strip's count to 2
-- Watch what happens to the two colors
-Expected: the strip becomes a clean base±2 ramp, the two loose colors are gone, and the control made it obvious that's what it would do before you committed.
-*** TODO Removed-step references read clearly as "(gone)"
+*** DONE Removed-step references read clearly as "(gone)"
+CLOSED: [2026-06-24 Wed 10:46]
What we're verifying: lowering a family's count leaves a referencing face visibly stale, not silently re-pointed.
- Assign a UI or syntax element to an outer step of a family (e.g. region = a blue+3)
- Lower that family's count to 2 so blue+3 disappears
- Read the assignment's dropdown
Expected: the dropdown shows "(gone)" for the removed step, never a silent jump to a different color; re-pointing it is a deliberate choice.
-*** TODO Calibre bookmark default name is "Author, Title"
-What we're verifying: a new nov bookmark takes the "Author, Title" form parsed from the filename, not the raw EPUB filename.
-- Open an EPUB in Calibre (nov buffer).
-- Hit m to set a bookmark.
-Expected: the default bookmark name is "Author, Title" (underscores stripped, colon restored), e.g. "Agatha Christie, The A.B.C. Murders".
-
-*** TODO Calibre curated ? menu and docked description
-What we're verifying: the curated ? transient, the docked description, and the full dispatch all work in a live calibredb buffer.
-- In a calibredb search buffer, press ? and confirm the curated menu (library / filter / sort / open / describe) appears.
-- Press d or v to dock the selected book's description in a bottom-30% buffer; press q to dismiss it.
-- Press H and confirm calibredb's full dispatch opens.
-Expected: ? shows the curated menu, d/v dock the description (q dismisses), H opens the full calibredb dispatch.
-
-*** TODO Signel: real incoming message raises a toast through the notify script
-What we're verifying: the full receive path (signal-cli → signel --handle-receive → cj/signel--notify → notify script) fires on a real message.
-- Make sure you are NOT viewing the sender's chat buffer.
-- Have a real message sent to you on Signal (or send one from your phone to a second device thread that lands here).
-Expected: a transient info toast titled "Signal: <sender>" with the message text (one line, truncated if long), no sound.
-
-*** TODO Signel: actively-viewed chat stays quiet
-What we're verifying: the suppression predicate gates the toast when you're reading that chat.
-- Open the sender's chat buffer (=C-; M m=) and keep it the selected window in a focused frame.
-- Have the same sender message you again.
-Expected: the message renders in the buffer, but no desktop toast appears.
-
-*** TODO Project-aware capture files into the right todo.org
-What we're verifying: C-c c t and C-c c b file into the current projectile project's todo.org under its "<Project> Open Work" header, and fall back to the global inbox outside a project.
-- Inside a projectile project that has a todo.org, run C-c c t (Task), capture a test entry, and confirm it lands under "<Project> Open Work".
-- Run C-c c b (Bug) similarly and confirm it lands as "* TODO [#C] ..." under the same header.
-- Run a capture from outside any project (or a project with no todo.org) and confirm the global-inbox fallback with a warning.
-Expected: in-project captures land in that project's Open Work; out-of-project captures fall back to the global inbox with a warning.
-
+*** DONE Dirvish d duplicates, D force-deletes with a confirm
+CLOSED: [2026-06-24 Wed 10:52]
+What we're verifying: in dirvish, d now duplicates the file at point (delete-to-trash removed), and D force-deletes the marked files via sudo rm -rf after a yes-or-no-p naming the targets. The pure command builder is unit-tested; this is the live keypress plus the guarded destructive path.
+- Open dirvish on a scratch directory holding a couple of throwaway files
+- Put point on a file and press d — confirm a "<name>-copy.<ext>" appears (a duplicate, nothing deleted)
+- Mark one or two throwaway files, press D, and read the "Force-delete (sudo rm -rf, NO undo): <names>?" prompt
+- Answer no first (confirm nothing happens), then press D again and answer yes
+- Note whether sudo prompts for a password and whether the file actually disappears
+Expected: d duplicates; D names the exact targets and only deletes on yes; the files are gone with no trash copy. If sudo needs a password that shell-command can't supply, flag it — the delete may need to route through a tty instead.
** PROJECT [#A] Theme-Studio Open Work
Parent grouping the open theme-studio / theming issues; close each child independently.
+*** TODO [#C] theme-studio: surface font-lock faces in the studio :bug:studio:
+font-lock faces (keyword / string / comment / type / ...) are present in the inventory — they live in =emacs-default-faces.json= and the theme files (e.g. =distinguished.json=, =theme.json=), not =package-inventory.json=. So the data is there; the open question is why they don't appear in the studio pane. Investigate the studio UI's view/group assignment for core syntax faces and surface them where expected (or report that they already are, and where). From the roam inbox.
+*** TODO [#C] theme-studio: contrast calc should account for distant-foreground :feature:studio:
+The studio's contrast numbers ignore Emacs's distant-foreground swap — the color Emacs substitutes when fg/bg are too close. First document Emacs's algorithm (when the swap kicks in and how the threshold is computed), then find the fg/bg combination with the least contrast under that rule and report contrast against that worst case, not just the nominal fg. From the roam inbox.
+*** TODO [#C] theme-studio: flag a face inheriting from itself as a mistake :feature:studio:
+A face set to inherit from itself renders unexpectedly. When a face's inherit dropdown selects itself, mark it as an error: outline the dropdown (or zebra-stripe it — pick during build) with a terse tooltip describing the problem. Still allow saving (warning, not a block). Also identify other similar self-referential / invalid-combination error cases and apply the same warning pattern. From the roam inbox.
+*** TODO [#C] theme-studio: live preview should outline the auto-dim text, not the normal text :bug:studio:
+The live-preview outline currently marks the normal-theme text; it should outline the auto-dim variant instead. From the roam inbox.
+*** 2026-06-28 Sun @ 06:53:32 -0400 wttrin captured in the studio inventory (4 faces)
+Root cause was the inventory regex (fixed in a5fd0b4d): it only captured =/elpa/PKG-VERSION/= dirs, excluding wttrin's unversioned =/elpa/wttrin/= checkout. Confirmed on a clean wttrin load that =symbol-file= attributes its faces to =/elpa/wttrin/wttrin.elc= correctly. The live daemon's wttrin attribution was disturbed by the session's theme reloading (=symbol-file= returns nil; reload + unload-feature didn't repair it), so I did NOT regenerate the whole inventory from the daemon (that would have lost attribution for other packages too). Instead, surgically added wttrin's four file-loaded faces (=wttrin-instructions=, =wttrin-key=, =wttrin-mode-line-stale=, =wttrin-staleness-header=) to =package-inventory.json= from a clean batch load, regenerated =theme-studio.html= (make gen), and confirmed all studio gates green. wttrin is now a generic-preview app in the dropdown.
+Two residuals, neither blocking: (a) the OTHER local-checkout packages the regex fix unblocks are not yet captured — that needs one full inventory regen in a freshly-restarted (clean) daemon, best run after Craig's next Emacs restart; (b) =wttrin-instructions-header= is eval-defined outside the checkout (the checkout defines =wttrin-instructions=, not =-instructions-header=), so it can't be captured here — it would need to land in =elpa/wttrin/wttrin.el=. Optional polish: a bespoke two-column-footer =renderWttrin= instead of the generic preview. Visual confirm filed under "Manual testing and validation".
+*** 2026-06-27 Sat @ 22:05:31 -0400 Rebuilt the dirvish preview as a realistic two-pane
+Shipped in 61b68fcf (option 2). Two-pane dirvish: an active listing (per-type nerd-icons, sizes, hl-line, dimmed backup) beside an =ls -l= preview pane, the remaining faces in a labeled extras strip, all 38 dirvish faces still covered. Visual verified via off-screen screenshot.
*** TODO [#A] theme-studio: consistent assignment-view table columns :feature:studio:next:
All view-assignment tables should use one consistent column set and order, whatever view is selected: element name (sortable), lock, fg, bg, style, box (with a side expansion showing the selected color, as in UI faces), contrast, inheritance, size, preview text. No other columns at this design stage. When a view's elements can't take a given section, raise a signal and disable that section for that view; the disabled state is the visual cue. From the roam inbox 2026-06-16.
-*** TODO [#B] Route hardcoded theme colors through the theme :refactor:
-Config modules hardcode colors that should come from the theme (audit 2026-06-16, after removing the =*scratch*= background tint). Drive these from the theme, or expose them in theme-studio, instead of literal values.
-- Buffer-bg tints (same shape as the removed scratch tint): =music-config.el:794= and =org-noter-config.el:287= both face-remap =default :background "#1d1b19"= on the active window.
-- Hardcoded face colors that should ride the theme: =nerd-icons-config.el:32= =cj/nerd-icons-tint-color "darkgoldenrod"=; =prog-general.el:370-375= hl-todo keyword faces =#FF0000= / =#DAA520= / =#2C780E=; =eshell-config.el:78-86= prompt =:foreground "gray"/"white"=.
-- Reading-mode palettes (deliberate but hardcoded, confirm keep vs theme): =pdf-config.el:27= =pdf-view-midnight-colors=; =calibredb-epub-config.el:298-300= =:foreground "#E8DCC0"=.
-- =org-faces-config.el:38-103= defface defaults (~36 hex) — the themeable org-faces theme-studio already overrides; decide whether the defaults should derive from the palette too.
-*** TODO [#C] theme-studio: custom view-assignment dropdown with lock indicators :feature:studio:next:
-The view-assignment dropdown is a plain HTML menu. Make it a custom menu colored like the other custom menus, and have it indicate which assignment views have all their elements locked, so the user knows when a view's assignments are done. From the roam inbox 2026-06-16.
-*** TODO [#C] theme-studio: move the "clear palette" button :feature:studio:next:
-The clear-palette button is too easy to hit by accident (then re-import the JSON to recover). It currently rides with the update-color and palette-generation controls, not with the palette columns. Move it to be left-aligned at the same vertical level as the color-column names. Layout/CSS change in the palette area (app.js / styles.css); visual, so verify by eye. From the roam inbox 2026-06-16.
*** VERIFY [#A] theme-studio: deploy-wip button on the browser page :feature:studio:next:
Needs from Craig: a mechanism choice before I build it. The page is served from file://, so a button can't run make directly. Two options: (a) a tiny localhost helper the page POSTs to (it runs make deploy-wip), or (b) the page writes a watched trigger file that a small daemon/timer picks up. Pick (a) or (b) and I'll implement + test it.
Add a button on the theme-studio page that runs the make deploy-wip target locally (build WIP.json into the theme, live-reload the daemon). The page is served from file://, so the browser can't run make directly. Needs a local bridge: a tiny localhost helper the button POSTs to, or a watched trigger file the page writes. Pick the mechanism before building. From the roam inbox 2026-06-15.
*** VERIFY [#A] theme-studio: cannot reassign fg color :bug:studio:next:
Needs from Craig: the exact repro (palette JSON + click sequence, or a quick screen capture). I traced it and couldn't reproduce from the code: updateColor (the "update selected" path) already excludes the selected entry from its uniqueness check (j!==i), and the fg/bg chips are selectable — paletteChip wires d.onclick -> selectColor(i), with the lock only blocking removal, not selection. The "already exists" wording is addColor's message, which is only reached via applyEdit when selectedIdx is null (i.e. no chip selected). So the trigger is a state I can't see statically — selection getting lost before "update", or a second entry already named "fg". With the precise steps I can pin it; I won't guess-patch the palette-update path on an [#A] bug since a wrong fix there corrupts themes.
Selecting the fg tile, changing its value, and clicking update errors that an fg already exists instead of updating it. The update path treats a reassign as an add. From the roam inbox.
+*** DOING [#B] Route hardcoded theme colors through the theme :refactor:studio:
+Phase 1 DONE (2026-06-25, commit 439fb0e6): stripped every literal color from the config modules so nothing assigns a non-themeable value (0 hex + no named-color face values remain; validate-modules + org-faces/build-theme/face-diagnostic tests clean). The config now renders with default/theme faces, which surfaces where theming support is missing. *Restart Emacs to see the bare state* — the running daemon still holds some accumulated colored state (e.g. =hl-todo-keyword-faces=) that only clears on restart.
+
+Phase 2 — gaps to surface as themeable faces (exploration; work as we decide what to do):
+- *hl-todo keyword colors* (=prog-general.el=): removed the literal FIXME/BUG/HACK/ISSUE/TASK/NOTE/WIP colors; it now falls to hl-todo's package defaults. Add themeable faces (or route FIXME/BUG/HACK -> =error=, ISSUE/TASK -> =warning=, NOTE -> =success=, and a new info-blue for WIP).
+- *eshell prompt* (=eshell-config.el=): the timestamp/user/host/pwd were "gray" and the =%= was "white"; now the default face. Add themeable prompt faces (or route to =shadow= / =eshell-prompt=).
+- *active-window bg tint* (=org-noter-config.el=, =music-config.el=): the =#1d1b19= tint is gone (the =face-remap-add-relative= is now a no-op); the active window uses the default bg. Needs a themeable "active-buffer tint" face if the distinction is wanted back — same shape as the removed =*scratch*= tint.
+- *pdf reading colors* (=pdf-config.el=): =pdf-view-midnight-colors= removed; pdf-tools' own default applies. Needs themeable midnight fg/bg.
+- *epub/nov reading color* (=calibredb-epub-config.el=): the =#E8DCC0= sepia removed; reading fg falls to the default. Needs a themeable reading face.
+- *org-faces defface defaults* (=org-faces-config.el=): the ~28 literal defaults were stripped. The theme overrides these at runtime, so the focused faces stay themed — but confirm the theme covers the =-dim= variants (auto-dim's non-selected-window faces) too, else those render bare.
+From the 2026-06-16 audit; exploration phase 2026-06-25. The nerd-icons "darkgoldenrod" tint from the original audit is already gone.
*** VERIFY [#B] theme-studio: sort newest colors near the top :feature:studio:next:
Deferred from the no-approvals batch (no blocker, needs a focused studio session). Plan: the palette + gallery order comes from columnsFromPalette / sortColumns / paletteOptionList; newest entries currently sort low. Add a recency signal (palette insertion order) and surface recent columns near the front. Risk: the column sort is pinned by several browser gates (#sorttest etc.), so it needs careful test updates — which is why I held it rather than rush it here.
Newly added colors currently land after the ground layer (bg/fg), low in the order. Surface them near the first entry instead, in both the palette color list and the gallery/dropdown, since the most recently added colors are usually the ones being worked on. From the roam inbox 2026-06-15.
-*** VERIFY [#B] theme-studio: dashboard preview icons missing, list items unthemed :bug:studio:next:
-Needs from Craig: an approach decision on the icon half. The navigator nerd-glyphs show as mojibake because the browser has no nerd font — fixing it means shipping/@font-face-ing a Symbols Nerd Font web font into the studio page (a real asset + licensing call), or substituting plain glyphs in the preview. The "list items unthemed" half is a separate studio-CSS fix I can do, but I'd rather settle the font approach and do both together. Tell me: embed the nerd font, or use substitute glyphs?
-Found while theme-testing the live dashboard against the preview.
-- The navigator icons don't render in the preview at all, showing as mojibake. The nerd-font glyphs have no font fallback in the browser.
-- No way to set the color of the project, bookmark, and recent-files list items. The preview renders those entries as plain unstyled text, and the dashboard app exposes no editable face for them.
+*** 2026-06-25 Thu @ 13:58:07 -0400 theme-studio dashboard preview: icons render, items themeable
+Both halves resolved. Icon/mojibake half: the decision (embed the nerd font) was made and shipped during the gallery work — a Symbols Nerd Font is @font-face'd into the studio page (=ThemeStudioNerd= in styles.css / previews.js), so the dashboard preview's navigator renders real glyphs instead of mojibake. Items half: =dashboard-items-face= is now an editable face (=face_data.py= DASHBOARD_FACES), and the preview's project/bookmark/recent rows are wrapped in =dashboard-items-face= (commit 1303d995), so editing it recolors them. It inherits =widget-button= (default) while unset, so the rows stay bare during the vanilla exploration until the face is themed.
*** TODO [#B] theme-studio import organization workflow needs a spec :feature:studio:
:PROPERTIES:
:LAST_REVIEWED: 2026-06-13
@@ -377,57 +504,8 @@ Break the org-agenda-* plus scheduling / deadline / calendar / clocking / filter
:END:
Package faces model =inherit= explicitly, but UI faces currently expose only fg/bg/style fields in the table and generated theme output. Before implementing UI-face inheritance, write and review a small spec that defines: which UI faces get an inherit selector, how own defaults from =emacs-default-faces.json= appear versus effective inherited values, how export/import stores cleared vs inherited vs explicit values, how preview resolution follows UI inherit chains, and what browser gates prove the behavior. This touches the UI model, generated defaults, export format, preview rendering, and reset semantics, so it should not be slipped in as a refactor.
-*** TODO [#C] theme-studio: calibre package doesn't color properly :bug:studio:
-The calibre package preview has no elements to theme in the search list, and coloring switches to the string color on mismatched quotes. Investigate, then record a diagnosis and solution in this task before fixing. From the roam inbox 2026-06-15.
-*** TODO [#C] theme-studio: break org-mode preview into grouped subsections :feature:studio:
-Rather than cramming all org-mode preview into one pane, split into groups so each element is shown in a common, context-rich environment. From the roam inbox.
-*** TODO [#C] theme-studio: converter drops :inherit on UI faces :bug:studio:
-build-theme.el's UI tier passes inherit=nil to --attrs, so a UI face that relies only on its inherit field (no explicit fg/bg) loses the inheritance in the generated theme, while the studio preview shows the inherited color via resolveUiAttr. The package tier already emits :inherit; the UI tier should match. Surfaced while diagnosing why mode-line-inactive looked off in Emacs versus the preview (that case had explicit colors and turned out to be a stale deploy, but the inherit gap is real for any inherit-only UI face).
-*** TODO [#C] theme-studio: elfeed ignores theme assignments :studio:studio:
-The preview shows theme colors, but elfeed itself renders all-white with no variation. Note: this may be the shr-rendered entry/article view (elfeed-show), where color often comes from the document rather than the theme — confirm whether the symptom is in the search list or the article view. From the roam inbox.
-*** VERIFY [#C] theme-studio face-consistency check :feature:studio:next:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-10
-:END:
-Needs from Craig: this is an open-ended feature, not a bug — it needs a spec first (what "consistency" means: which faces are compared, what rule flags an inconsistency, how it's surfaced in the UI). Give me the check's definition (or say "brainstorm a spec") and I'll build it; parked until then.
-Rule taxonomy captured in [[file:docs/design/theme-studio-face-rules.org][docs/design/theme-studio-face-rules.org]] (Design Rules vs Fidelity Rules). The two checks below map to those two rule kinds. Both surface structural-attribute (weight/slant/underline/box/overline/height) issues; color is the theme's design and out of scope.
-
-1. Theme cross-cutting consistency (primary, per Craig 2026-06-09): the theme has deliberate cross-cutting rules — e.g. headings/titles are bold, links are underlined, errors/warnings/success are bold. Flag where the theme BREAKS ITS OWN rule (a heading that isn't bold, a link that isn't underlined). The designer declares the rules; the check finds the violators. This is the "tell me where I broke the rule" guardrail.
-
-2. defface-baseline divergence (secondary): flag where a face's structural attrs differ from its package =defface= so each divergence is deliberate, not an accidental drop. Would have caught the dropped underline/bold defaults and the contradictions (shr-h3 bold-vs-italic, erc-action italic-vs-bold) from the package-face audit as they were introduced.
-
-Bake into the tool (a lint surfaced in the UI) or run as a build-time check (seeds vs live deffaces via emacsclient).
-
-*** TODO [#C] theme-studio: restrict the cursor row to its background :bug:studio:
-The UI table gives the cursor face the full control set (fg, B/I/U/S, box), but Emacs only honors the cursor face's :background. Its shape is cursor-type, not a face attribute, so every other control on that row is a no-op once the theme loads. Restrict the cursor row to just its background swatch so the studio doesn't present controls Emacs drops.
-*** TODO [#C] theme-studio terminal/ANSI colors :feature:studio:
-theme-studio represents GUI faces only; terminal colors aren't surfaced at all. Scope decided 2026-06-09: GUI-first faces, NOT full per-face display-class fallback. Two pieces:
-
-1. ANSI-16 panel. Map the 16 ANSI slots (black/red/green/yellow/blue/magenta/cyan/white + bright variants) to palette colors, with a preview, and export them so =build-theme.el= emits the =ansi-color-*= / =term-color-*= faces. This matters even in pure-GUI Emacs: colored shell output, compilation buffers, eshell, and vterm/eat all draw from these. Signals must line up with their ANSI slot (error red→ansi red, success→green, warning→yellow, info/link→blue) so a signal reads the same in a terminal.
-
-2. Core-face 16-color fallback. Only the ~10 faces that decide console legibility get a =(((class color) (min-colors 16)) ...)= clause plus a =(t ...)= floor: default/fg, bg, keyword, string, comment, constant, error, warning, region, mode-line, line-number. Tune these for contrast — push it UP, legibility over fidelity, because the only 16-color target is the bare Linux virtual console (an occasional emergency context). The long tail stays GUI-first and auto-approximates.
-
-Why this scope: the GUI and the normal terminal (foot + tmux, truecolor / ≥256-color) both render the GUI hexes fine; GUI-first is correct there. Only the Linux VT is 16-color, and a low-contrast palette approximates badly down to 16 — so a few core faces get a deliberately higher-contrast 16-color fallback rather than every face carrying a multi-spec. Tool work: the ANSI-16 panel + a flag on the core faces to also capture a 16-color value; =build-theme.el= emits multi-spec only for those. Full per-face fallback is revisited only if console work becomes regular.
-*** TODO [#D] theme-studio CIEDE2000 DeltaE option :feature:studio:
-Deferred from the perceptual color metrics spec (vNext). v1 uses DeltaE-OK on its native scale with a 0.02 threshold (decided); revisit CIEDE2000 only if the native OKLab scale proves too unfamiliar or poorly calibrated for palette distinguishability. Spec: [[id:15db8ae3-fc14-49f3-9ed5-d5ff59790904][spec]] (vNext candidates; review folded in 2026-06-08).
-*** TODO [#D] theme-studio low-contrast preset/mask mode :feature:studio:
-Deferred from the perceptual color metrics spec (vNext). After raw OKLCH/APCA/DeltaE readouts exist, decide whether to add a named low-contrast workflow: APCA Lc bands, a contrast ceiling/floor mask, or a "soft" sibling to the existing any/AA+/AAA picker mask. Spec: [[id:15db8ae3-fc14-49f3-9ed5-d5ff59790904][spec]] (vNext candidates; review folded in 2026-06-08).
-*** TODO [#D] theme-studio per-tier reseed controls :feature:studio:
-Deferred from the seeding-engine spec (vNext). V1 reseeds all three guide-owned tiers at once; later consider separate "reseed syntax", "reseed UI", and "reseed package/org" controls if all-at-once proves too blunt. Spec: [[id:b70b37f2-37df-4c8e-ac2f-1f20d12e33dd][spec]] (vNext; review folded in 2026-06-08).
-*** VERIFY [#C] Palette-columns spec review
-SCHEDULED: <2026-06-12 Fri>
-Read [[file:docs/theme-studio-palette-columns-spec.org][docs/theme-studio-palette-columns-spec.org]] (Draft, from the 2026-06-10 design discussion) and bless or amend. Decisions 9 and 10 are the two session calls awaiting your word: strips flip to lightest→darkest top→bottom to match the dropdown, and each dropdown column run places the base at its natural lightness position (vs bg/fg bases leading before any steps). On "spec's good": mark Ready, file the phase breakdown, cancel the [#C] hint-override task, start Phase 1.
-
-*** TODO [#D] org-faces: dim variants and retire dupre-org-* :feature:theme-studio:
-vNext from the org-faces spec: org-faces-*-dim variants wired into auto-dim so keywords stay legible in unfocused windows, and migrate or retire the legacy dupre-org-* set. [[id:35578114-8c29-43af-97a2-fdfea01a802e][org-faces-spec-implemented.org]]
-*** TODO [#D] Face diagnostic popup — theme-studio bridge (vNext) :feature:
-vNext for the face/font diagnostic tool: interactivity — "send this face to theme-studio", jump-to-theme-spec, any write path. Deferred per [[id:98f065cf-8bd5-46a0-ac24-da94d66855ad][the spec]]'s scope tiers.
-*** 2026-06-16 Tue @ 05:10:55 -0500 Alphabetized the assignment-view package dropdown
-The package-faces optgroup (below the @code/@ui editor entries) now lists apps alphabetically by display label. Root cause: =buildViewSel= iterated =for(const app in APPS)=, and =generate.py= builds APPS as bespoke apps first then inventory apps, so the combined list wasn't alphabetical. Fix is localized to the view-list build per the plan: added a pure =appViewKeysSorted(apps)= helper in =app-core.js= (sorts keys by label, case-insensitive, key fallback when a label is missing) and =buildViewSel= iterates it. TDD: 4 node tests in =test-app-core.mjs= (red->green); updated the #viewtest browser gate from asserting insertion order to asserting =appViewKeysSorted(APPS)=; full theme-studio suite green (Python + Node + all browser gates). Commit =afd2ddad=, pushed. Visual sign-off optional (gate already confirms the DOM order).
-*** 2026-06-16 Tue @ 06:11:30 -0500 Contrast cell: dropped PASS/FAIL, verdict moved to the hover
-Craig's call (option a + hover): the contrast cell now shows just the rating-colored number (green = passes AAA, grey = passes AA, red = fails AA), and the WCAG meaning lives in a hover. Added a pure =contrastTitle(r)= to =app-util.js= (4 node tests), changed =crHtml= (app.js) to drop the verdict word and set =title=, kept =verdictFor= for the covered-overlay worst-case readout (untouched, #contrasttest still green). New #crtest browser gate; full theme-studio suite green. Commit =9e99749d=, pushed.
-*** DOING [#B] Dashboard theming broken: font-lock strips faces; items + icons :bug:
-Investigated 2026-06-16. Three independent causes make the live dashboard render banner, headings, and items in the default face, with no file/section icons. Diagnosis grounded in live daemon inspection (face props, overlays, font-lock state).
+*** 2026-06-25 Thu @ 15:29:51 -0400 Dashboard theming fixed: font-lock, file + heading icons, items themeable
+All three causes resolved. Cause A (font-lock stripping faces) fixed 2026-06-16 (202cf430). Cause C: file icons fixed 2026-06-16 (1c97cba7), and section-heading icons now enabled too (=dashboard-set-heading-icons t=, 2026-06-25). Cause B (item color) unblocked — theme-studio now exposes =dashboard-items-face= (=face_data.py=) so the items are colored from the theme, not a hardcoded hex; setting that color is the studio's job now. Original diagnosis (2026-06-16, live daemon inspection) kept below.
**** Cause A — banner + section headings render default ("Banner Text not gold")
=global-font-lock-mode= (enabled at startup, =early-init.el:311=) fontifies the =*dashboard*= buffer. Dashboard applies the banner title (=dashboard-banner-logo-title=) and section headings (=dashboard-heading=) via the =face= TEXT PROPERTY. font-lock owns the =face= property and strips manually-applied ones it didn't set via keywords, so those faces get cleared on render (every line carries =fontified t=, the jit-lock fingerprint). The theme is fine: =dashboard-banner-logo-title= computes to #dab53d gold and =dashboard-heading= to #67809c — they're stripped at render, not missing. This is a regression of the 2026-05-22 fix "Dashboard navigator icons and section titles uncolored" (7496), which worked before font-lock ran in this buffer.
@@ -475,27 +553,170 @@ Phase 1. Palette anchors + OKLCH shade generation (reusing colormath.js), the RO
Phase 2. Initial state from seed() plus seedPkgmap for the non-org packages; all-tier reseed button with a scope-named overwrite warning, resetting non-org to their APPS defaults; regenerate dupre-revised.json. Gate: #selftest PASS; default-on-open equals seed(); artifact round-trip (regenerated dupre-revised.json imports back to the same seeded state); Chrome eyeball.
**** TODO Seeding-engine test surface :solo:test:
Keep #seedtest, #selftest, the default-on-open check, the dupre-revised round-trip, node --check, and Chrome validation green.
-** PROJECT [#B] AI Open Work
-Parent grouping the open AI assistant / gptel issues; close each child independently.
-*** TODO [#B] ai-rewrite: chosen directive never reaches the request :bug:solo:
-=modules/ai-rewrite.el:64= — the directive is let-bound around =(call-interactively #'gptel-rewrite)=, but gptel-rewrite is a transient prefix that returns when the menu shows; the send resolves the directive AFTER the binding unwound (verified against ~/code/gptel/gptel-rewrite.el:780-799). The picker's choice is silently dropped — the module's core feature is inert. Set =gptel--rewrite-directive= buffer-locally (restore via =gptel-post-rewrite-functions=) or use a self-removing global hook entry. From the 2026-06 config audit.
+*** TODO [#C] ansi-color dropdown plain, reuse info in the hover :feature:studio:
+Drop the parenthetical from the "ansi color" assignment-view dropdown label so it reads plain, and move the explanation to the hover instead: name the packages that reuse these colors (vterm / eshell / compilation / ghostel) and verify they actually do before stating it. From the roam inbox 2026-06-24.
+*** TODO [#C] theme-studio: custom view-assignment dropdown with lock indicators :feature:studio:next:
+The view-assignment dropdown is a plain HTML menu. Make it a custom menu colored like the other custom menus, and have it indicate which assignment views have all their elements locked, so the user knows when a view's assignments are done. From the roam inbox 2026-06-16.
+*** TODO [#C] theme-studio: calibre package doesn't color properly :bug:studio:
+The calibre package preview has no elements to theme in the search list, and coloring switches to the string color on mismatched quotes. Investigate, then record a diagnosis and solution in this task before fixing. From the roam inbox 2026-06-15.
+*** TODO [#C] theme-studio: break org-mode preview into grouped subsections :feature:studio:
+Rather than cramming all org-mode preview into one pane, split into groups so each element is shown in a common, context-rich environment. From the roam inbox.
+*** TODO [#C] theme-studio: elfeed ignores theme assignments :studio:studio:
+The preview shows theme colors, but elfeed itself renders all-white with no variation. Note: this may be the shr-rendered entry/article view (elfeed-show), where color often comes from the document rather than the theme — confirm whether the symptom is in the search list or the article view. From the roam inbox.
+*** VERIFY [#C] theme-studio face-consistency check :feature:studio:next:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-10
+:END:
+Needs from Craig: this is an open-ended feature, not a bug — it needs a spec first (what "consistency" means: which faces are compared, what rule flags an inconsistency, how it's surfaced in the UI). Give me the check's definition (or say "brainstorm a spec") and I'll build it; parked until then.
+Rule taxonomy captured in [[file:docs/design/theme-studio-face-rules.org][docs/design/theme-studio-face-rules.org]] (Design Rules vs Fidelity Rules). The two checks below map to those two rule kinds. Both surface structural-attribute (weight/slant/underline/box/overline/height) issues; color is the theme's design and out of scope.
-*** VERIFY [#B] Stale elpa gptel shadows the local fork — likely the gptel-magit root :bug:quick:solo:next:
-Needs from Craig: can't be done standalone. I tried deleting elpa/gptel-0.9.8.5 — the fork loaded fine and gptel-magit still worked via use-package autoloads, but package activation then printed "Unable to activate gptel-magit / Required gptel-0.9.8 unavailable" on every startup, so I reverted. To remove the shadow we must also resolve gptel-magit's package dependency: either drop gptel-magit's package dep (load it via load-path like the gptel fork), or repackage the fork into .localrepo as gptel. Tell me which and I'll do it; this pairs with the gptel-magit investigation.
-=elpa/gptel-0.9.8.5= is still installed alongside the =~/code/gptel= fork (=ai-config.el:383=); package activation puts the elpa dir + autoloads on load-path, so which copy wins depends on ordering, and a mixed load (fork .el + elpa .elc) produces "impossible" bugs. =gptel-magit= (elpa) declares gptel as a dependency, so IT may be pulling the stale copy — check this first when working the open "[#B] Investigate gptel-magit not working properly" task. Fix: =package-delete= the elpa gptel + remove from .localrepo so the fork is the only copy on disk. From the 2026-06 config audit.
+1. Theme cross-cutting consistency (primary, per Craig 2026-06-09): the theme has deliberate cross-cutting rules — e.g. headings/titles are bold, links are underlined, errors/warnings/success are bold. Flag where the theme BREAKS ITS OWN rule (a heading that isn't bold, a link that isn't underlined). The designer declares the rules; the check finds the violators. This is the "tell me where I broke the rule" guardrail.
-2026-06-15: tried deleting =elpa/gptel-0.9.8.5= standalone. The fork loaded correctly and gptel-magit still worked via use-package =:commands= autoloads, BUT package activation then printed "Unable to activate package gptel-magit / Required package gptel-0.9.8 unavailable" on every startup and test run (gptel-magit declares gptel as a package dependency that no longer resolves). Reverted. This can't be done standalone — it must be paired with the gptel-magit dependency fix (drop gptel-magit's package dep, or repackage the fork into .localrepo as gptel). Do it together with the gptel-magit investigation task.
+2. defface-baseline divergence (secondary): flag where a face's structural attrs differ from its package =defface= so each divergence is deliberate, not an accidental drop. Would have caught the dropped underline/bold defaults and the contradictions (shr-h3 bold-vs-italic, erc-action italic-vs-bold) from the package-face audit as they were introduced.
-*** TODO [#C] ai-conversations: dead-buffer load, role flattening, non-atomic writes :bug:solo:
-From the 2026-06 config audit, =modules/ai-conversations.el=:
-- =:324= — load in a fresh session does =get-buffer-create "*AI-Assistant*"= (plain fundamental-mode buffer); =--ensure-ai-buffer= then sees it exists and never calls =(gptel)=. Sending doesn't work, autosave self-cancels (requires gptel-mode). Use =get-buffer= for the check; let ensure create. The browser RET/l path inherits this.
-- =:240= — persistence drops gptel's =response= text properties, so a reloaded history replays to the model as ONE user message (model re-reads its own answers as Craig's words). Adopt gptel's native bounds persistence or re-mark on load from the "* Backend:" headings.
-- =:248= — =write-region= straight at the target; crash mid-write truncates the only copy of the history (autosave hits this constantly). Temp + rename.
-- =:140= — three overlapping autosave mechanisms (after-send advice that fires before the response exists, post-response hook, 60s timer). Keep the hook; drop the advice (and likely the timer).
+Bake into the tool (a lint surfaced in the UI) or run as a build-time check (seeds vs live deffaces via emacsclient).
-*** VERIFY [#C] Dedup gptel model-switch commands — keep switch-backend or fold into change-model :bug:
-=cj/gptel-change-model= (C-; a m) already does backend+model switching and interns correctly, so =cj/gptel-switch-backend= (C-; a B) is arguably redundant now that its crash is fixed. Decision for Craig: keep both, or delete =cj/gptel-switch-backend= plus its C-; a B binding and keep one model-switch command. From the 2026-06 config-audit follow-up.
+*** TODO [#C] theme-studio: restrict the cursor row to its background :bug:studio:
+The UI table gives the cursor face the full control set (fg, B/I/U/S, box), but Emacs only honors the cursor face's :background. Its shape is cursor-type, not a face attribute, so every other control on that row is a no-op once the theme loads. Restrict the cursor row to just its background swatch so the studio doesn't present controls Emacs drops.
+*** TODO [#C] theme-studio terminal/ANSI colors :feature:studio:
+theme-studio represents GUI faces only; terminal colors aren't surfaced at all. Scope decided 2026-06-09: GUI-first faces, NOT full per-face display-class fallback. Two pieces:
+
+1. ANSI-16 panel. Map the 16 ANSI slots (black/red/green/yellow/blue/magenta/cyan/white + bright variants) to palette colors, with a preview, and export them so =build-theme.el= emits the =ansi-color-*= / =term-color-*= faces. This matters even in pure-GUI Emacs: colored shell output, compilation buffers, eshell, and vterm/eat all draw from these. Signals must line up with their ANSI slot (error red→ansi red, success→green, warning→yellow, info/link→blue) so a signal reads the same in a terminal.
+2. Core-face 16-color fallback. Only the ~10 faces that decide console legibility get a =(((class color) (min-colors 16)) ...)= clause plus a =(t ...)= floor: default/fg, bg, keyword, string, comment, constant, error, warning, region, mode-line, line-number. Tune these for contrast — push it UP, legibility over fidelity, because the only 16-color target is the bare Linux virtual console (an occasional emergency context). The long tail stays GUI-first and auto-approximates.
+
+Why this scope: the GUI and the normal terminal (foot + tmux, truecolor / ≥256-color) both render the GUI hexes fine; GUI-first is correct there. Only the Linux VT is 16-color, and a low-contrast palette approximates badly down to 16 — so a few core faces get a deliberately higher-contrast 16-color fallback rather than every face carrying a multi-spec. Tool work: the ANSI-16 panel + a flag on the core faces to also capture a 16-color value; =build-theme.el= emits multi-spec only for those. Full per-face fallback is revisited only if console work becomes regular.
+*** VERIFY [#C] Palette-columns spec review
+SCHEDULED: <2026-06-12 Fri>
+Read [[file:docs/theme-studio-palette-columns-spec.org][docs/theme-studio-palette-columns-spec.org]] (Draft, from the 2026-06-10 design discussion) and bless or amend. Decisions 9 and 10 are the two session calls awaiting your word: strips flip to lightest→darkest top→bottom to match the dropdown, and each dropdown column run places the base at its natural lightness position (vs bg/fg bases leading before any steps). On "spec's good": mark Ready, file the phase breakdown, cancel the [#C] hint-override task, start Phase 1.
+
+*** 2026-06-24 Wed @ 21:53:39 -0400 Editable face-list color grouping cancelled — subsumed by the gallery
+The roam-inbox ask was to default-group the editable nerd-icons face table by color family. Craig's call (2026-06-24): the gallery preview already clusters the icons by hue, which covers the underlying "see colors grouped" need, so grouping the 34-row editable table too isn't worth it. Cancelled.
+*** 2026-06-24 Wed @ 18:09:26 -0400 theme-studio tier-1 simplifications landed
+Behavior-preserving simplifications from the four-agent refactor/simplify assessment, all test-verified (full suite green). Landed: syncMockHeight + syncPkgHeight merged into syncPaneHeight(tableId, paneId); the dead generatorHues "manual" branch deleted (identical to fallback); locateInfoLine removed (fn + export + test, orphaned this session); the redundant pkgbody guard dropped (buildPkgTable self-guards); displayHex/displayName closures inlined; paintUI now calls worstCellHtml; generate.py's two nerd-icons loaders share _load_nerd_icons_artifact (sentinel keeps the null-file edge exact); face_coverage.classify rewritten with named locals (with a new characterization test). Two agent findings were wrong and skipped on verification: LOCATE_REG is live (read by previewSpan), and normalizePaletteEntryCore doesn't exist (hallucinated). Skipped on judgment: a RELEASED_BOX constant (mutable-dict aliasing hazard, only ~10 sites) and inlining apply_hover_box_default (its why-docstring earns the named function). Open for Craig: previewFaceAttrs (app-core.js) is test-only with a stale "the gate calls it" docstring — confirm delete vs keep.
+*** 2026-06-24 Wed @ 21:53:39 -0400 app.js split — controls.js extracted, remaining splits declined
+The highest-value extraction landed (controls.js, see below). Craig's call (2026-06-24): stop there — the remaining clusters (picker, locate, io, tables) are diminishing navigability gain for more churn, so they're declined. The token-at-position pattern is proven and documented if any one is ever wanted.
+**** 2026-06-24 Wed @ 19:16:47 -0400 Extracted the control factories to controls.js
+Cut the contiguous dropdown / detail-editor / expander cluster (the custom color dropdown state + closeColorDropdown + mkColorDropdown through mkExpander, 205 lines) from app.js into controls.js, spliced back at a CONTROLS_J token via generate.py. app.js dropped 927 to 721 lines. The token sits at the exact extraction point, so the assembled page is byte-identical (just relocated source) — full suite green with no gate changes. mkBoxControl (a lone factory elsewhere in app.js) stayed put; it can join controls.js later.
+*** TODO [#D] theme-studio: move the "clear palette" button :feature:studio:
+Craig dislikes the current placement (it rides with the update-color and palette-generation controls and is too easy to hit by accident, then re-import the JSON to recover) but has no target placement in mind yet (2026-06-25). Parked until a placement idea lands — the earlier "left-align at the color-column level" was a guess, not a decision. When a target exists: layout/CSS change in the palette area (app.js / styles.css), visual, verify by eye. From the roam inbox 2026-06-16.
+*** 2026-06-20 Sat @ 05:53:39 -0400 Tightened the elements-table horizontal layout
+Reduced per-cell padding 12px to 8px across all three tables and shortened the redundant "mode-line-highlight (mode-line hover)" label to "(hover)". The weight/slant narrowing landed with the custom-widget task below. Commit 792e09b5.
+*** 2026-06-20 Sat @ 05:53:39 -0400 Custom weight/slant dropdowns with previews
+Replaced the native weight/slant selects with mkEnumDropdown, themed like the color dropdown. Values are spelled out (semibold not "semi"; unset reads "weight"/"slant"), each popup option previews its own weight or slant, and lock + popup behavior mirrors the color dropdown. Commit 055e0992.
+*** 2026-06-20 Sat @ 05:53:39 -0400 Language dropdown sorted with nav arrows
+Alphabetized the language list with Elisp pinned as the default, and added the ‹ › arrows that step the selection (clamped) reusing stepViewIndex. #langtest gate. Commit be62ae5b.
+*** 2026-06-20 Sat @ 05:53:39 -0400 Moved the lock column to the leftmost position
+Lock cell now sits first in all three tables, ahead of the element/face name; the name sort moved to column 1. From the roam inbox 2026-06-20. Commit 4f869aa1.
+*** 2026-06-20 Sat @ 06:44:07 -0400 Explanatory hovers on the expander detail labels
+Each label in the expander detail row carries a DETAIL_HOVERS tooltip, matching the table-header labels. From the roam inbox 2026-06-20. Commit 2caa4606.
+*** 2026-06-20 Sat @ 06:44:07 -0400 View-dropdown lock indicator
+The view dropdown prefixes a lock glyph on any view whose elements are all locked. Delivers the lock-indicator half of the custom-view-dropdown task; the custom-menu half is still open. From the roam inbox 2026-06-20. Commit 2caa4606.
+*** 2026-06-20 Sat @ 06:44:07 -0400 Expand/collapse-all toggle with disclosure triangles
+Per-row expander toggles show ▶/▼ disclosure triangles; a header-level expand-all/collapse-all button per table opens or closes every row at once. From the roam inbox 2026-06-20. Commit 2933a362.
+*** 2026-06-20 Sat @ 06:44:07 -0400 Expander stays open across a table rebuild
+A package edit rebuilds the table, which had collapsed an open expander mid-edit. An EXPANDED set keyed by element/face reopens the open rows on rebuild. From the roam inbox 2026-06-20. Commit 7382bf53.
+*** 2026-06-20 Sat @ 06:44:07 -0400 Added 18 language previews
+Tokenized samples.py previews for Racket, Scheme, Haskell, OCaml, Scala, Kotlin, Swift, Lua, Ruby, Perl, R, Erlang, SQL, PHP, Ada, Fortran, MATLAB, Assembly, wired into the language dropdown (28 languages total) with a guard test. From the roam inbox 2026-06-20. Commit 309b1e9a.
+*** 2026-06-20 Sat @ 06:44:07 -0400 Moved the box column between style and contrast
+Box now sits at column 5 in all three tables, after style and before contrast (reverses the earlier box-to-last). From the roam inbox 2026-06-20. Commit 2a34c3c7.
+*** 2026-06-23 Tue @ 13:51:37 -0400 theme-studio preview locate v1 — implemented
+Built the preview-element locate feature per the spec (all six phases). Hover any data-face preview element to see its section / face / effective value + source note via title, with the preview-label info line updating to "section > face — value" on mouseover; click an on-pane element to scroll + flash its assignment row; off-pane elements stay hover-only (default cursor). Pure helpers in app-core.js (Node-tested, test-locate.mjs), the stateful previewSpan adapter + cached registry + unified click dispatch in previews.js / app.js, all browser-gated. Verified end to end: run-tests.sh fully green — 262 Node tests, 48 browser gates, ERT + Python + spliced-script parse. Nothing committed yet. Implementation boundary recorded: previewSpan powers the package previews + cross-surface spans; the UI mock keeps its bespoke rendering (its own flashUi locate predates this), now routed through the same locateClick dispatcher (Phase 5). The org-agenda / completion previews become the organic showcase later. [[id:fbcf0e20-1328-42b4-aa36-3401509e7816][theme-studio-preview-locate-spec.org]]
+**** 2026-06-23 Tue @ 13:20:39 -0400 Phase 0 — pure-helper extraction landed
+Added the five pure locate helpers to app-core.js — buildLocateRegistry(apps,pkgmap,uimap,map), locateFaceMeta(owner,face,registry), formatLocateTitle(meta), previewFaceAttrs(owner,face,registry), isLocateOnPane(owner,currentApp) — all state passed in, returning data not HTML. Owner-qualified registry key (owner+face), effective fg/bg matching the rendered pixels (package inherit via the face's :inherit, UI inherit via UI_INHERIT), per-attribute source notes (direct / inherited-from-X / default / cleared). New test-locate.mjs: 15 pure-Node tests covering the owner-qualified collision, the source-note states, previewFaceAttrs validation, rebuild-after-edit, and the linear/ms perf budget. Verified: run-tests.sh fully green — generate.py inline + 260 Node tests + spliced-script parse + all browser gates + Python/ERT.
+**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 1 — face registry wired
+LOCATE_REG: one cached module-level registry built by buildLocateRegistry(APPS,PKGMAP,UIMAP,MAP), rebuilt (rebuildLocateRegistry) at the top of the two preview renderers (buildPkgPreview, buildMockFrame) — the chokepoints every assignment / import / reset / view-switch funnels through before spans render, so it never goes stale and never rebuilds per hover/span. Built lazily, not at declaration, to dodge the inlined UI_INHERIT const's TDZ. locate-onpane recomputed at render via isLocateOnPane. Gate #locatetest: registry presence, owner-qualified keys, rebuild-after-edit. run-tests.sh green.
+**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 2a — previewSpan adapter + os delegation
+previews.js: previewSpan(owner,face,text) reads the live globals, dispatches by surface, emits data-owner-app + data-face + the locate-onpane class (on-pane only), and os delegates to it. Text stays trusted preview HTML (callers pre-escape entities) — previewSpan does NOT re-escape it, preserving the old os() contract and avoiding double-escaping &lt;. Gate #locatetest extended; all existing package-preview gates (mdtest/mupreviewtest/gnustest/previewlinktest/mocktest/autodimtest) still pass unchanged.
+**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 2b — owner-aware assertPreviewFaces
+Rewrote the gate validator to resolve each element's owner from data-owner-app (defaulting to the preview's app for bare spans), validating package faces against APPS[owner].faces and @ui against UIMAP keys. Accepts intentional off-pane + @ui spans, rejects a bad owner. Existing same-app preview gates still pass.
+**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 2c — @ui rendering in previewSpan
+Added ulocateCss(face) (effFg(resolveUiAttr) over UIMAP, matching the registry's effective value) as the @ui branch of previewSpan. Gate: a @ui face (minibuffer-prompt) renders its real color off a package preview and is off-pane.
+**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 2d — gate-only showcase fixture
+#showcasetest: a synthetic host package-preview context with one package-owned off-pane span + one @ui (minibuffer-prompt) off-pane span — each renders in its owner's real color, is hover-only (no locate-onpane), and passes the owner-aware validator. No user-facing preview change.
+**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 3 — hover title + info line
+previewSpan now carries the full locate title (formatLocateTitle, attribute-escaped) on every element; buildPkgPreview wires mouseover → the pkgprevlabel info line shows locateInfoLine "section > face — value" (title is the deterministic fallback), restored on mouseleave. New pure locateInfoLine in app-core.js (+2 Node tests). Gate #locatehovertest: exact title string, direct/cleared notes, the info line update + restore.
+**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 4 — click flash + cursor split
+Added .locate-onpane{cursor:pointer} to styles.css (off-pane keeps the default cursor). Click routes through the unified locateClick dispatcher: on-pane flashes its assignment row (flashRow, no persistent selection), off-pane / unassigned inert. Gate #locateclicktest: on-pane flash, off-pane unflashed, the cursor/class split.
+**** 2026-06-23 Tue @ 13:51:37 -0400 Phase 5 — locate-dispatch cleanup
+One locateClick(e, defaultOwner) replaces both the buildPkgPreview and buildMockFrame face-click branches — owner from data-owner-app or the surface default, on-pane-only for owner-tagged spans, bare spans (generic / auto-dim / UI mock) stay clickable. The data-k syntax path stays separate. #mocktest still green (mock click unchanged); #locateclicktest covers the unified path on both surfaces.
+
+*** TODO [#D] theme-studio preview locate: reveal off-pane element in owning pane :feature:theme-studio:
+vNext from the preview-locate spec: add a "reveal in pane" affordance for off-pane preview elements (switch to the owning pane and scroll to the row) if the hover-only model proves too manual. V1 deliberately keeps off-pane elements non-clickable. [[id:fbcf0e20-1328-42b4-aa36-3401509e7816][theme-studio-preview-locate-spec.org]]
+*** TODO [#D] theme-studio preview locate: syntax/code tier into unified registry :feature:theme-studio:
+vNext from the preview-locate spec: fold the data-k syntax/code tier into the locate registry. V1 leaves it on its existing cp.onclick -> flashAssign path. [[id:fbcf0e20-1328-42b4-aa36-3401509e7816][theme-studio-preview-locate-spec.org]]
+*** TODO [#D] theme-studio preview locate: keyboard-focus info strip :feature:theme-studio:
+vNext from the preview-locate spec: make preview spans focusable and drive a hover/focus info strip for keyboard-only wayfinding. V1 wayfinding is pointer-driven (recorded accessibility caveat). [[id:fbcf0e20-1328-42b4-aa36-3401509e7816][theme-studio-preview-locate-spec.org]]
+*** 2026-06-24 Wed @ 22:30:00 -0400 converter :inherit on UI faces — verified already correct, not reproducible
+The reported bug (build-theme.el's UI tier dropping :inherit for inherit-only UI faces) does not reproduce in the current code. uiFaceBlank carries an inherit field, exportObj dumps the full UIMAP (inherit included), and build-theme/--attrs reads it. Direct test: a theme.json with ui face {inherit: mode-line, fg: null, bg: null} fed to build-theme/--ui-face-specs emits ((mode-line-inactive ((t (:inherit mode-line))))) — the :inherit survives. Closed as already-fixed / stale.
+*** TODO [#D] theme-studio CIEDE2000 DeltaE option :feature:studio:
+Deferred from the perceptual color metrics spec (vNext). v1 uses DeltaE-OK on its native scale with a 0.02 threshold (decided); revisit CIEDE2000 only if the native OKLab scale proves too unfamiliar or poorly calibrated for palette distinguishability. Spec: [[id:15db8ae3-fc14-49f3-9ed5-d5ff59790904][spec]] (vNext candidates; review folded in 2026-06-08).
+*** TODO [#D] theme-studio low-contrast preset/mask mode :feature:studio:
+Deferred from the perceptual color metrics spec (vNext). After raw OKLCH/APCA/DeltaE readouts exist, decide whether to add a named low-contrast workflow: APCA Lc bands, a contrast ceiling/floor mask, or a "soft" sibling to the existing any/AA+/AAA picker mask. Spec: [[id:15db8ae3-fc14-49f3-9ed5-d5ff59790904][spec]] (vNext candidates; review folded in 2026-06-08).
+*** TODO [#D] theme-studio per-tier reseed controls :feature:studio:
+Deferred from the seeding-engine spec (vNext). V1 reseeds all three guide-owned tiers at once; later consider separate "reseed syntax", "reseed UI", and "reseed package/org" controls if all-at-once proves too blunt. Spec: [[id:b70b37f2-37df-4c8e-ac2f-1f20d12e33dd][spec]] (vNext; review folded in 2026-06-08).
+*** TODO [#D] org-faces: dim variants and retire dupre-org-* :feature:theme-studio:
+vNext from the org-faces spec: org-faces-*-dim variants wired into auto-dim so keywords stay legible in unfocused windows, and migrate or retire the legacy dupre-org-* set. [[id:35578114-8c29-43af-97a2-fdfea01a802e][org-faces-spec-implemented.org]]
+*** TODO [#D] Face diagnostic popup — theme-studio bridge (vNext) :feature:
+vNext for the face/font diagnostic tool: interactivity — "send this face to theme-studio", jump-to-theme-spec, any write path. Deferred per [[id:98f065cf-8bd5-46a0-ac24-da94d66855ad][the spec]]'s scope tiers.
+*** 2026-06-16 Tue @ 05:10:55 -0500 Alphabetized the assignment-view package dropdown
+The package-faces optgroup (below the @code/@ui editor entries) now lists apps alphabetically by display label. Root cause: =buildViewSel= iterated =for(const app in APPS)=, and =generate.py= builds APPS as bespoke apps first then inventory apps, so the combined list wasn't alphabetical. Fix is localized to the view-list build per the plan: added a pure =appViewKeysSorted(apps)= helper in =app-core.js= (sorts keys by label, case-insensitive, key fallback when a label is missing) and =buildViewSel= iterates it. TDD: 4 node tests in =test-app-core.mjs= (red->green); updated the #viewtest browser gate from asserting insertion order to asserting =appViewKeysSorted(APPS)=; full theme-studio suite green (Python + Node + all browser gates). Commit =afd2ddad=, pushed. Visual sign-off optional (gate already confirms the DOM order).
+*** 2026-06-16 Tue @ 06:11:30 -0500 Contrast cell: dropped PASS/FAIL, verdict moved to the hover
+Craig's call (option a + hover): the contrast cell now shows just the rating-colored number (green = passes AAA, grey = passes AA, red = fails AA), and the WCAG meaning lives in a hover. Added a pure =contrastTitle(r)= to =app-util.js= (4 node tests), changed =crHtml= (app.js) to drop the verdict word and set =title=, kept =verdictFor= for the covered-overlay worst-case readout (untouched, #contrasttest still green). New #crtest browser gate; full theme-studio suite green. Commit =9e99749d=, pushed.
+*** TODO [#B] theme-studio: package coverage for pearl, wttrin, chime :feature:studio:
+Three projects shipped themeable faces and asked theme-studio to render accurate previews. Data lives in the PROCESSED handoff files.
+**** TODO pearl — 6 faces + overlay-driven appearance
+Six faces in the =pearl= customize group plus overlay-driven appearance a raw buffer read won't show. =inbox/PROCESSED-2026-06-23-2239-from-pearl-theme-studio-pearl-spec.org= + cover + =sample-pearl-buffer.org=.
+**** TODO emacs-wttrin — 4 new faces
+Was hardcoded "gray60"; now four customizable faces (branch =feature/themeable-faces=). =inbox/PROCESSED-2026-06-23-2253-from-emacs-wttrin-wttrin-faces-handoff.org= + rendered sample.
+**** TODO chime — 4 themeable modeline faces
+Four modeline faces shipped (081d76e). =inbox/PROCESSED-2026-06-23-2326-from-chime-chime-added-four-themeable-modeline.org=.
+*** PROJECT [#B] theme-studio guide-support features :feature:studio:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-13
+:END:
+From the color-assignment guide work (2026-06-08): make the tool support the guide without mandating it — everything a seed, an advisory, or a view, never a gate. Two specs to write, both deriving from the rewritten guide and its seed table ([[file:scripts/theme-studio/theme-coloring-guide.org][theme-coloring-guide.org]]).
+**** 2026-06-08 Mon @ 19:08:00 -0500 Seeding-engine spec written and Ready
+[[id:b70b37f2-37df-4c8e-ac2f-1f20d12e33dd][theme-studio-seeding-engine-spec-doing.org]] — role table + face→role maps for syntax/UI/org, OKLCH shade generation, reseed dupre-revised to the compact mapping. Codex-reviewed, Ready. Implementation tracked under the seeding-engine parent below.
+**** TODO Guide-support views and advisories spec
+Five optional surfaces, all dismissible and non-blocking, in one collapsible panel where they advise: (1) CVD-simulation toggle on previews (deuteranopia/protanopia/tritanopia); (2) squint/blur preview toggle; (3) lightness-ramp view + palette advisories (accent count over 6-8, roles separated only by red/green) — depends on the OKLCH/ΔE core; (4) definition-vs-call / weight advisories; (5) state-over-syntax preview (region/search/diff tint over real syntax-colored text). Sequence: rewritten guide reviewed → seeding-engine spec → this. Advisories (3, 4) layer on the perceptual-metrics feature.
+*** TODO [#C] Dupre diff-changed / diff-refine-changed legibility :bug:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+Surfaced 2026-06-07 from a pearl session designing its modified-ticket indicator (pearl marks a changed field by inheriting =diff-changed=). dupre's =diff-refine-changed= is bright gold (#ffd700) under near-white text (#f0fef0) -- WCAG contrast ~1.35, unreadable as a plain background. It only looks fine inside diff-mode because diff-mode overlays its own dark foreground. =diff-changed= (#875f00 amber) is ~5.49, readable but off the modus model. Every modus variant keeps both faces legible (contrast 9-16) by pairing a dark low-saturation background with a hue-matched foreground.
+
+Ask:
+1. Rework dupre's =diff-changed= and =diff-refine-changed= on modus lines: dark low-saturation background, legible foreground (plain default fg for simplicity, or hue-tinted per modus -- decide), and keep refine slightly stronger than changed (refine is the word-level emphasis inside a changed region; modus keeps them distinct).
+2. While there, audit dupre's broader diff/palette faces against modus conventions (background/foreground tinting, contrast targets) and flag where it diverges.
+
+Reference values -- modus-vivendi: refine-changed bg #4a4a00 fg #efef80, changed bg #363300 fg #efef80. modus-operandi: refine-changed bg #fac090 fg #553d00, changed bg #ffdfa9 fg #553d00.
+
+Side-by-side legibility render: [[file:assets/2026-06-07-dupre-diff-face-legibility-compare.png][assets/2026-06-07-dupre-diff-face-legibility-compare.png]].
+** TODO [#B] org-capture popup leaks f12 / f10 / f11 / ai-term keys :bug:
+While the org-capture popup is open, the global F-keys (the =f12= term, =f10= / =f11=, the ai-term family) still fire and pop a terminal over the capture. Disable those keys for the duration of the capture popup if there's a clean way. Research first and report; if it's too invasive, defer or cancel rather than force it. From the roam inbox 2026-06-24.
+** TODO [#B] VAMP — extract music-config into a standalone player :feature:refactor:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+Build VAMP ("VAMP Audio Music Player"), a standalone, publishable Emacs music player at =~/code/vamp= — derived from a maintained subset of EMMS, depending on the EMMS package not at all, with MPV and mpd behind a generalized adapter API. =.emacs.d= keeps thin glue (=vamp-config.el=: keybindings, paths, dashboard); archsetup owns OS wiring (Super+/ launcher, m3u MIME). Models the =linear-config= → =pearl= migration.
+
+Brainstorm complete 2026-06-22 — validated design at [[file:docs/design/vamp-music-player.org][docs/design/vamp-music-player.org]]. It builds on the prior EMMS-removal work ([[file:docs/specs/music-config-without-emms-spec.org][spec]] + [[file:docs/design/music-config-without-emms-review.org][2026-05-15 review]]), confirming its B1/B2/B4/S3 decisions and pivoting four things (publishable-now, two adapters + generalized API, VAMP name, desktop integration).
+
+Next: (1) revise the spec to the new direction; (2) spike the risky assumptions (mpd dumb-single-file-player contract; m3u =.desktop= on Hyprland); (3) =/start-work= against the revised spec — pure-helper extraction (review Migration Plan step 1) is the safe first phase. Priority [#C] is a placeholder pending Craig's call.
+
+** DONE [#C] dashboard: add a weather entry (wttrin) with an icon :feature:
+CLOSED: [2026-06-28 Sun]
+Shipped (a8a04377): a Weather launcher on key =w= in the dashboard top row after Agenda, drawn with the =nf-weather-day_sunny_overcast= Weather Icons glyph (Craig picked it from a rendered candidate set). It opens the wttrin forecast via =call-interactively= so the location prompt runs (a bare =(wttrin)= errors -- the location is a required arg supplied by the interactive form). Row sizes 4-4-3-3 -> 5-4-3-3; launcher-table tests updated. Verified live by Craig.
+** TODO [#C] nov: sepia reading view (dark bg, tan/sepia text) :feature:
+A sepia setting for =nov-mode=: keep a dark background, render the letters in a tan/sepia color. nov defines no faces of its own and leans on shr, so the path is buffer-local face-remapping (=face-remap-add-relative= on =default= / =shr-text= / =variable-pitch=) in a nov-mode hook, toggled per a sepia preference. Overlaps the "epub/nov reading color" note under "Route hardcoded theme colors through the theme" (the removed =#E8DCC0= sepia plus "needs a themeable reading face") — reconcile with that themeable-face direction. From the roam inbox.
+** DONE [#C] ai-term: M-SPC summon ignores the agent's last fullscreen size :bug:
+CLOSED: [2026-06-28 Sun]
+Fixed via Approach B (geometry tracking). A =window-configuration-change-hook= tracker (=cj/--ai-term-track-geometry=) records whether a displayed agent window is the sole window of its frame into =cj/--ai-term-last-fullscreen=; =cj/--ai-term-display-saved= restores the agent in place (fullscreen) when that flag (or the existing bury flag) is set and the frame is a single window, otherwise docks as before. Two follow-on bugs surfaced and were fixed during live testing: (1) the tracker must NOT re-capture dock direction/size on every window change -- doing so fed a capture/replay loop that drifted the dock height ~2 rows per cycle (the F9 shrink-bug class), so the tracker tracks only the fullscreen flag and leaves dock geometry to the toggle-off capture; (2) the restore condition used a bare =one-window-p=, which counts an active minibuffer (a picker prompt mid-summon) as a second window and misfired the restore into a dock that then cascaded -- fixed with =(one-window-p t)= (NOMINI). 5 new ERT tests in =test-ai-term--single-window-toggle.el=; 162/162 ai-term tests green; verified live by Craig (window holds (0 0 141 43) across round-trips). From Craig 2026-06-28.
+** TODO [#C] pdf-view: epdfinfo crashes loading some PDFs (large IA scans) :bug:
+=epdfinfo server quit. restart y/n?= when opening certain PDFs, so pdf-view-mode never engages and the file lands in the wrong mode. Reproduced with =~/sync/books/Karl Jaspers/Karl Jaspers_ Basic Philosophical Writings _ Selections (49298)/Karl Jaspers_ Basic Philosophical Writings - Karl Jaspers.pdf= (576-page, 31MB Internet Archive scan).
+Diagnosis: the PDF is structurally valid (=qpdf --check= clean; =pdfinfo= reads it) and poppler renders its pages (=pdftoppm= pages 1 and 300 succeed), so it isn't corruption or a poppler-render crash. epdfinfo crashes loading the document, likely on the tagged-PDF structure / metadata stream the IA scan carries (=Tagged: yes=, =Metadata Stream: yes=), a known epdfinfo trouble class. =auto-mode-alist= maps =.pdf= -> =pdf-view-mode= correctly, so-long is off, and there's no large-file prompt (=large-file-warning-threshold= nil).
+Fix options (Craig to choose): (1) re-save the file to strip what crashes epdfinfo (=mutool clean= / ghostscript / =qpdf --replace-input=), keeping a backup -- fixes this file, recurs on the next bad scan; (2) graceful fallback in =pdf-config.el= -- when epdfinfo dies on a PDF, open it in zathura (already bound to =z=) instead of the dead pdf-view buffer, robust for the whole class; (3) both. From the roam inbox.
** PROJECT [#B] Architecture review follow-up from 2026-05-03 :refactor:
High-level pass over =init.el=, =early-init.el=, and all 104 files in
@@ -767,7 +988,7 @@ No init.el load-order change — keybindings and the foundation modules already
Verified each fix with a fresh =emacs --batch (require 'X)=, then swept all ~100 modules standalone: every one loads or fails only with a clear missing-package message (the spec's Phase 2 exit bar). Full =make test=, =make validate-modules=, and an init smoke all pass. Module headers and the inventory's hidden-dependency section updated to mark the seven resolved.
-**** TODO [#B] Defer feature modules behind autoloads, hooks, and commands :refactor:
+**** DOING [#A] Defer feature modules behind autoloads, hooks, and commands :refactor:
Once dependencies are explicit, reduce the number of modules required at
startup. Start with lower-risk feature modules:
@@ -782,6 +1003,9 @@ Do this incrementally. After each batch:
- Run =make test= or at least targeted tests.
- Check that keybindings still resolve and which-key labels still appear.
+***** 2026-06-21 Sun @ 01:53:55 -0400 Deferred games-config (batch 1, module 1)
+Replaced =(require 'games-config)= in init.el with explicit autoloads for =malyon= and =2048-game= → games-config; the module now loads on first game-command use instead of at startup. games-config.el: =:defer 1= → =:defer t :commands=, header Load shape eager→command. package.el already autoloads both commands, so routing through games-config only preserves the one setting it owns (=malyon-stories-directory=), applied via use-package =:config= when malyon loads. Verified the autoload→module→package→config chain in batch. Test: =tests/test-init-defer-games.el= (commands resolve with the module unloaded; config applies on load). Inventory row eager→command; header-contract 4/4 (still allowlisted), full =make test= green. Shipped as 03d8b587. Daemon keeps it loaded until restart — interactive restart smoke pending (see Manual testing).
+
**** 2026-05-24 Sun @ 19:59:01 -0500 Centralized custom keymap registration
Added cj/register-prefix-map and cj/register-command to keybindings.el (commit 47f222f6) with test-init-keymap-registration.el, then migrated all 31 cj/custom-keymap registration sites across 24 modules onto the API. Consumers no longer reference cj/custom-keymap directly — keybindings.el is the sole owner of the prefix, and modules require keybindings to reach the API.
@@ -795,7 +1019,7 @@ Related existing task: [#B] "Review and rebind M-S- keybindings".
=use-package=, and =use-package-always-ensure=. That is more than early startup
needs and can make startup network-sensitive.
-**** TODO [#B] Split early startup from package bootstrap :refactor:
+**** TODO [#A] Split early startup from package bootstrap :refactor:
Keep =early-init.el= focused on things that must happen before package and UI
startup:
@@ -853,66 +1077,6 @@ Add the buffer-local var, set it on each "Run a test..." selection, use it as th
*** TODO [#B] TS/JS coverage status sync
Update the =dev-fkeys.el= header comment (L33) — TS/JS is no longer punted; the cmd-builder at L384 emits vitest/jest. Document the prefer-vitest fallback.
-** PROJECT [#B] Migrate All Terminals From Vterm to Ghostel
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-04
-:END:
-Replace vterm with ghostel (libghostty-vt) as the single terminal engine across every workflow, and rename ai-vterm → ai-term. References: [[file:docs/2026-05-25-emacs-terminal-comparison.org][docs/2026-05-25-emacs-terminal-comparison.org]] (vterm vs eat vs ghostel research); migration spec [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][docs/specs/vterm-to-ghostel-migration-spec-implemented.org]] (READY; external review incorporated 2026-06-04, D1-D7 agreed). Build in 5 phases (0-4); see the spec's Implementation tasks block.
-
-Decisions D1-D7 are settled in the spec's Agreed-decisions section. Build order below; each phase stays green (suite + byte-compile) at every step.
-
-*** TODO [#B] Follow-up: theme ghostel ANSI faces in dupre
-D2 — set the 16 ghostel-color-* + ghostel-default faces in dupre-faces/palette.
-Roam-inbox note (2026-06-14): theme-studio assignments don't reach ghostel — it paints from its own ANSI palette, not the theme. Also investigate ghostel's property-file color mechanism as an alternative and surface the options for working with that limitation.
-
-*** TODO [#B] Follow-up: evaluate ghostel-eshell + ghostel-compile
-D3 — ghostel-eshell as eshell visual backend; ghostel-compile against F4 dev-fkeys.
-
-*** TODO [#B] Investigate ghostel selection/highlight color
-Look at how selected text is highlighted in a ghostel buffer — the region face in =ghostel-copy-mode= and any live selection — surfaced during the copy-mode debugging. Check whether the highlight is legible against the dupre background and consistent with the rest of the config; if it needs theming, fold it in with D2 (theming the ghostel faces in dupre).
-
-*** 2026-06-04 Thu @ 23:57:09 -0500 Phase 0 done: characterization baseline green
-=make test= green except the 5 documented pre-existing failures (4 test-dupre-theme, 1 test-init-module-headers), none terminal-related. Characterization coverage already present + green for all six must-survive behaviors: vterm-toggle--dispatch/display/buffer-filter, vterm-tmux-history, ai-vterm--show-or-create/launch-command/f9-in-vterm, ui-config--buffer-cursor-state + vterm-copy-mode-cursor, dashboard-config-launchers. Add a characterization test before any behavior change in later phases if a gap appears.
-
-*** 2026-06-05 Fri @ 00:38:34 -0500 Phase 1 done: ghostel + term-config.el
-=modules/term-config.el= written (full port of vterm-config: tmux history/copy-mode-dwim preserved via process-tty-name + ghostel-send-string; F12 toggle + display rule + geometry; cj/term-map C-; x menu → ghostel commands; which-key "terminal menu"; ghostel-max-scrollback 10MB; C-; added to ghostel-keymap-exceptions; F12 + C-; in ghostel-mode-map; use-package ghostel guarded per D6). Dropped: mouse-wheel SGR forwarding, vterm-timer-delay hacks, copy-mode cursor hook, goto-address hook. ghostel installed into elpa (MELPA + auto-downloaded native module). Tests: test-term-toggle--{dispatch,display,buffer-filter} + test-term-tmux-history (16) ported with a ghostel stub in testutil-ghostel-buffers; all green.
-
-*** 2026-06-05 Fri @ 00:38:34 -0500 Phase 2 done: ai-vterm→ai-term on ghostel
-=modules/ai-vterm.el= → =modules/ai-term.el=: 6 vterm call sites swapped to ghostel (buffer named via let-bound ghostel-buffer-name + pinned ghostel-buffer-name-function so OSC titles don't rename agent buffers); F9/C-F9/M-F9 on global + ghostel-mode-map; refuse-in-terminal guard removed (D4 — F9 launches in TTY frames); tmux-suppression invariant preserved (cj/--ai-term-suppress-tmux). 23 ai-vterm tests renamed → test-ai-term--* (terminal-guard test deleted, obsolete); show-or-create + f9-in-term rewritten for ghostel; all green. ui-config cursor-state ported (ghostel-mode + ghostel--input-mode; copy/emacs = read-only, else writeable) + its test. init.el now requires term-config + ai-term; vterm-config.el + ai-vterm.el deleted. Full suite green except the 5 documented pre-existing failures (4 dupre-theme, 1 init-module-headers/popper-config-missing — both unrelated). validate-modules ✓; full early-init+init smoke clean (no ghostel/term/ai-term errors). vterm package still installed (Phase 4) — dashboard "Launch VTerm" + dormant auto-dim still reference it until Phase 3/4. Restart Emacs to pick up ghostel (load-order + use-package :config change).
-
-*** 2026-06-05 Fri @ 00:50:58 -0500 Phase 3 done: satellites ported to ghostel
-Deleted auto-dim's vterm color-advice + redraw integration (~165 lines; D1 — terminals don't dim, ghostel bakes its palette per-terminal so there's no per-window color hook); dashboard launcher → =(ghostel)= + "Launch Terminal" label; cj-window-geometry/toggle-lib doc comments; module-inventory + init-load-graph doc refs. (ui-config cursor-state + init.el requires landed in Phase 2.) Trimmed test-auto-dim-config (dropped the 6 vterm tests) + updated the dashboard-launcher test stub. Incidental: removed the stale =popper-config= entry from the test-init-module-headers allowlist (the file doesn't exist + isn't required) — fixes the long-standing pre-existing test failure.
-
-*** 2026-06-05 Fri @ 00:50:58 -0500 Phase 4 done: vterm + vterm-toggle removed
-=package-delete='d vterm + vterm-toggle from elpa. No vterm refs remain in modules/init except intentional historical comments. Suite green except the 4 pre-existing dupre-theme failures (the popper-config one is now fixed). validate-modules ✓; full early-init+init batch smoke = INIT-SMOKE-OK. The migration parent stays DOING until Craig restarts Emacs and walks the ghostel manual-verify matrix under "Emacs Manual Testing and Validation".
-
-*** 2026-06-05 Fri @ 14:24:02 -0500 Auto-dim revisit cancelled — current no-dim behavior is fine
-Craig confirmed the shipped auto-dim setup works fine as-is: terminal buffers don't participate in unfocused-window dimming (D1), and the rest of auto-dim behaves. That is the measured decision the original task asked for — option (a), keep no-dim — so no rework (the focus-loss palette-blend in option (b) or an upstream per-window hook in option (c)) is needed. Closing without further investigation. Context: [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][migration spec]] D1.
-
-*** 2026-05-26 Tue @ 15:15:43 -0500 Direction confirmed; Claude Code in eat needs a caveat
-Craig confirmed the consolidation: one terminal engine everywhere — eat for standalone terminal buffers (replacing vterm) plus =eat-eshell-mode= as eshell's visual backend, keeping eshell as the shell. Not dropping eshell for eat + zsh.
-
-Researched whether Claude Code runs cleanly in eat (Craig runs it in his Emacs terminal). Verdict: mostly, with caveats. eat is the default backend for claude-code.el and renders the TUI with color and full key handling, but there is an eat-specific bug where Claude Code's input handling makes the buffer scroll-pop to the top on window-buffer changes and the input box can get stuck mid-buffer (recoverable, but it does not happen in vterm or ghostel), and eat runs about 1.5x slower than vterm on heavy streaming output. claude-code.el's own docs name ghostel as the most faithful Claude TUI renderer.
-
-Recommendation: consolidate everyday terminals onto eat, but keep ghostel (or vterm) for the Claude Code workflow specifically — the scroll-pop / stuck-input bug and the slower heavy-stream handling are exactly what bites a long Claude session. Sources: [[https://github.com/cpoile/claudemacs][claudemacs]], [[https://github.com/stevemolitor/claude-code.el][claude-code.el]], [[https://codeberg.org/akib/emacs-eat][emacs-eat]].
-
-Eval plan (from the research doc): install EAT alongside vterm, run the same workloads through both, decide. Test matrix: Claude Code TUI, lazygit, htop/btop, yazi, a heavy-output build, ssh to a remote, and eshell with =eat-eshell-mode=. Assess rendering fidelity, stability under heavy output, and Emacs-native line editing. Switch only if it covers every workflow without regression.
-
-*** 2026-06-02 Tue @ 14:12:48 -0500 Audit: eval plan not yet run; back to TODO
-Task audit found no eval work recorded since the 2026-05-26 direction-confirmed note. The test matrix above is unrun, so the task isn't actively in progress — moved DOING back to TODO until the eval starts.
-
-*** 2026-06-04 Thu @ 22:40:27 -0500 Pivot: ghostel as the single engine (not eat)
-Direction changed from eat-everyday + ghostel-for-Claude to ghostel-for-everything, and the task is now a migration rather than an eval. Rationale: ghostel is claude-code.el's most-faithful Claude TUI renderer and the fastest engine (81 vs vterm 34 vs eat 4.9 MB/s), and an audit confirmed it exposes an analog for every vterm primitive this config uses (=ghostel-send-string=, =ghostel-keymap-exceptions=, =ghostel-copy-mode=, =ghostel-clear-scrollback=, =ghostel-send-next-key=, =ghostel-next-prompt= / =ghostel-previous-prompt=, =ghostel-max-scrollback=, =ghostel-kill-buffer-on-exit=). eat's washed colors, the scroll-pop / stuck-input bug under Claude Code, and slowest throughput made it the weaker single-engine pick; one engine beats running two. Surface audited: 2 main modules (=vterm-config.el=, =ai-vterm.el=) + 4 satellites (=auto-dim-config.el= is the heavy one) + ~35 test files + init.el. Next: spike ghostel read-only to answer the open migration questions (auto-dim rework — ARCHITECTURE.md forbids the around-redraw color advice vterm uses; tmux pane-id via =process-tty-name= on a ghostel process; buffer naming; TTY-frame behavior; copy-mode keybinding parity), then write the migration spec under =docs/design/= and review it.
-
-*** 2026-06-04 Thu @ 23:17:54 -0500 Spec review: not ready until decisions and handoff shape are closed
-Ran the spec-review workflow against [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][docs/specs/vterm-to-ghostel-migration-spec-implemented.org]] and wrote a companion review file (incorporated and deleted 2026-06-04). Verdict: =Not ready=. Direction is sound, but the draft still has open D1-D5 decisions, lacks the workflow-required =Implementation phases= section and acceptance criteria, and needs explicit ghostel package/native-module failure behavior before implementation tasks can be emitted.
-
-*** 2026-06-04 Thu @ 23:24:28 -0500 Spec-response: review incorporated, raised to READY
-Folded the external review via spec-response. Craig accepted D1-D5; baked them plus D6 (module-failure = degrade-with-warning, modifying the reviewer's fail-loud) and D7 (=ghostel-max-scrollback= 10 MB) into a new Agreed-decisions section. Added Implementation phases (0-4), Acceptance criteria, Dependency/module-failure behavior, Test strategy, per-phase key/menu ownership, the tmux-suppression contract, and an Implementation-tasks drop-in block. Status DRAFT → READY; review file deleted. Build is now unblocked.
-
-*** 2026-06-04 Thu @ 23:30:18 -0500 External re-review: ready
-Re-reviewed [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][docs/specs/vterm-to-ghostel-migration-spec-implemented.org]] after incorporation. Verdict: =Ready=. No further blocking review notes; implementation can start from the phase plan and acceptance criteria in the spec.
-
** PROJECT [#B] Module-by-module hardening
:PROPERTIES:
:LAST_REVIEWED: 2026-06-05
@@ -1803,13 +1967,8 @@ Pitfalls:
- Do not accidentally re-enable UI/doc/sideline behavior that was explicitly
disabled for performance.
-***** TODO [#B] Add a startup smoke test for LSP config resolution :quick:solo:
-
-Keep this narrow. A useful test can require the LSP-related modules with mocked
-=use-package= side effects and assert that:
-- generic defaults are set in one place,
-- no duplicate hook entries are installed for the same mode,
-- =lsp-enable-remote= remains nil.
+***** 2026-06-25 Thu @ 01:53:48 -0400 Added the LSP config-resolution smoke test
+=tests/test-prog-lsp.el= (5 ERT tests) pins prog-lsp's load-time invariants: =lsp-enable-remote= stays nil (no auto-start on TRAMP files), the file-watch-ignore defaults live in one idempotent helper (=cj/lsp--add-file-watch-ignored-extras=), the eldoc provider is stripped from the global hook, and no mode holds a duplicate =lsp-deferred= entry. Tests the top-level =:init= + helper surface rather than the =:config= defaults, which defer to lsp-mode's own load under =make test= (the no-package-initialize constraint). Hit and fixed the lexical-binding special-var trap on =lsp-file-watch-ignored-directories= in the test.
**** TODO [#B] Gate tree-sitter grammar auto-install behind an explicit policy
@@ -2252,529 +2411,732 @@ configuration (=text-config=, =diff-config=, =ledger-config=,
=games-config=, =mu4e-org-contacts-setup=, =telega-config=,
=httpd-config=, =org-agenda-config-debug=).
-** PROJECT [#B] theme-studio guide-support features :feature:studio:
+** TODO [#C] Unified popup and messenger UX — placement, dismissal, one library :feature:
:PROPERTIES:
-:LAST_REVIEWED: 2026-06-13
+:LAST_REVIEWED: 2026-06-20
:END:
-From the color-assignment guide work (2026-06-08): make the tool support the guide without mandating it — everything a seed, an advisory, or a view, never a gate. Two specs to write, both deriving from the rewritten guide and its seed table ([[file:scripts/theme-studio/theme-coloring-guide.org][theme-coloring-guide.org]]).
-*** 2026-06-08 Mon @ 19:08:00 -0500 Seeding-engine spec written and Ready
-[[id:b70b37f2-37df-4c8e-ac2f-1f20d12e33dd][theme-studio-seeding-engine-spec-doing.org]] — role table + face→role maps for syntax/UI/org, OKLCH shade generation, reseed dupre-revised to the compact mapping. Codex-reviewed, Ready. Implementation tracked under the seeding-engine parent below.
-*** TODO Guide-support views and advisories spec
-Five optional surfaces, all dismissible and non-blocking, in one collapsible panel where they advise: (1) CVD-simulation toggle on previews (deuteranopia/protanopia/tritanopia); (2) squint/blur preview toggle; (3) lightness-ramp view + palette advisories (accent count over 6-8, roles separated only by red/green) — depends on the OKLCH/ΔE core; (4) definition-vs-call / weight advisories; (5) state-over-syntax preview (region/search/diff tint over real syntax-colored text). Sequence: rewritten guide reviewed → seeding-engine spec → this. Advisories (3, 4) layer on the perceptual-metrics feature.
-** PROJECT [#C] GPTel Feature Extension Brainstorm :feature:
+Merged 2026-06-20 from the config-wide popup-policy task and the messenger-unification
+task — they're the same policy at two scopes (the messenger windows are the first
+concrete application of the general popup rules). Two parts:
+
+(A) Config-wide popup policy. All transient popups follow one set of principles.
+Placement: when the Emacs frame is wider than tall, the popup rises from the right;
+when square or taller, from the bottom — settle the aspect-ratio threshold and the
+pop-out percentage. Dismissal: C-c C-c when there's an accept action, C-c C-k when
+there's a cancel, otherwise =q= closes the window. Generalizes ai-term adaptive
+placement (the aspect-ratio docking) and the messenger window/key rules below into
+one config-wide policy. From the roam inbox.
+
+(B) Messenger unification (first application of the policy above).
+Spec: [[file:docs/specs/messenger-unification-spec.org][messenger-unification-spec.org]] ([[id:4bfc2011-8ffc-4765-8886-91df12141171][by id]], Draft, 2026-06-11; keybinding-alphabet section + smoke-first parity added 2026-06-16). One library (=cj-messenger-lib.el=) gives every messenger the same shape: chat windows rise from the bottom (the signel rule, generalized), C-c C-c confirms, C-c C-k cancels, C-c C-a attaches — dispatched per backend through a registry + minor mode. Signel already conforms (reference backend); telega and slack join in phases 2-3; ERC later. All eight decisions settled 2026-06-11 (cancel closes an idle window; telega's filter-cancel shadow accepted; slack rooms join the bottom rule). Spec held open — Craig has more ideas to fold in before it's marked Ready.
+
+** TODO [#C] Auto-dim: org headings, links, and tags do not dim in unfocused windows :bug:
:PROPERTIES:
-:LAST_REVIEWED: 2026-06-01
+:LAST_REVIEWED: 2026-06-20
:END:
+auto-dim-other-buffers-affected-faces (auto-dim-config.el) remaps font-lock and a few org faces to the flat dim face, but not org-level-1..8, org-link, or org-tag, so headings, links (seen in daily-prep.org), and tags like :solo: stay lit when the window loses focus. Decide the dim approach: a flat-dim remap like font-lock (quick) versus dedicated -dim variants surfaced through org-faces / theme-studio (richer, matches the keyword work; Craig flagged org-tags may want the org-faces treatment). Consolidates three roam-inbox captures.
+** TODO [#C] "? = curated help menu" convention across modes :feature:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-20
+:END:
+From the calibredb keybindings work 2026-06-06. The pattern that worked: in a modal/major-mode buffer (calibredb), bind =?= to a curated transient of the frequent workflows, and move the package's own full dispatch to =H=. It fixes the "I can't discover the keys" problem that which-key can't help with (which-key only pops up after a prefix, not for top-level single keys in a mode-map).
-Categories below thematize the agent affordances the design doc
-[[file:docs/design/gptel-agentic-tool-ideas.org][gptel-agentic-tool-ideas.org]]
-points at -- Git, Org, messaging, file / buffer / workspace state,
-media, and the dev loop. The shortlist's first-batch ADOPT tools
-(git_status / git_log / git_diff / web_fetch) already shipped; the
-themes below are next-tier work where the agent treats Emacs as a
-structured workspace, not a text terminal. Per-theme spec lives in
-the task body once written; implementation tasks land as siblings
-of the spec heading once the spec is approved. The magit-backend
-reimplementation of the shipped git tools is tracked separately in
-[[id:bd47c9a8-aae1-4a3d-ad5b-b8767f2fd580][gptel-git-tools-magit-backend-spec.org]].
-
-*** TODO [#C] Wire Up MCP.el so That GPTel Has Access to MCP Servers via GPTel Tools
-
-**** 2026-05-16 Sat @ 15:44:36 -0500 Spec
-
-Design doc: [[id:b4c274c5-8572-4a7b-b657-d315712bd6af][docs/specs/mcp-el-gptel-integration-spec-doing.org]]
-
-**** 2026-05-17 Sun @ 14:14:34 -0500 Landed ai-mcp.el pure-helper foundation
-
-Commit =54d231be=. Sections 1 (constants + defcustoms) and 3 (pure helpers) of the seven-section outline. 41 ERT tests, all green. Refactor audit caught two duplications during Phase 4 and folded them into the same commit (=cj/mcp--get-server-entry= and =cj/mcp--name-matches-p=). Phase 1.5 (confirmation contract) is next.
-
-**** TODO [#C] Phase 1.5 -- GPTel confirmation contract
-
-*Goal:* flip =gptel-confirm-tool-calls= to ='auto= and gate the existing local tools that need it.
-
-*Entry:* Phase 1 module exists and helpers tested.
-
-*DECISION (cj):* which of the existing local tools register with =:confirm t= once ='auto= is in effect? Reads (=read_buffer=, =read_text_file=, =list_directory_files=, =git_status=, =git_log=, =git_diff=) clearly stay =:confirm nil=. Judgment calls:
-- =web_fetch= -- fetches arbitrary URLs the agent supplies. Spec recommends gating.
-- =write_text_file= -- writes any path under =$HOME= with agent-supplied content.
-- =update_text_file= -- modifies an existing file with an agent-supplied transform.
-- =move_to_trash= -- moves a path to trash (reversible but disruptive).
-
-*Deliverables:*
-- =ai-mcp.el= setup section runs =(setq gptel-confirm-tool-calls 'auto)=.
-- Remove =(setq gptel-confirm-tool-calls nil)= from =modules/ai-config.el:386= with a comment pointing at =ai-mcp.el=.
-- For each tool the decision marks "gate," add =:confirm t= to its =gptel-make-tool= form.
-- Tests in =tests/test-ai-mcp-confirm-contract.el= asserting: =gptel-confirm-tool-calls= is ='auto= after load; write-classified stub MCP tool with =:confirm t= triggers the confirm branch in =gptel-send='s dispatch (stub the prompt); read-classified MCP tool with =:confirm nil= does not; =git_log= (=:confirm nil=) still runs without prompting; each newly-gated local tool does prompt.
-
-*Exit:* tests green. Manual smoke: open GPTel, call a gated tool, confirm prompt appears. Call =git_log=, no prompt.
-
-**** TODO [#B] Phase 2 -- Compat layer + registration pipeline (fake inventory)
-
-*Goal:* implement the mcp.el compat wrappers and the tool-registration pipeline against stubbed =mcp-server-connections=.
-
-*Entry:* Phase 1.5 proves gptel respects per-tool =:confirm= slot.
-
-*Deliverables:*
-- Section 4 of =ai-mcp.el= (compat layer): =cj/mcp--server-status=, =cj/mcp--server-tools=, =cj/mcp--server-name=, =cj/mcp--assert-capabilities=. Each helper documents the upstream commit / file location it targets.
-- Section 5 of =ai-mcp.el= (registration pipeline): =cj/mcp--register-tool=, =cj/mcp--register-server-tools=, =cj/mcp--deregister-server-tools=, =cj/mcp--rewrite-plist=, =cj/mcp--registered-tools= hash.
-- All MCP tools register with =:async t=.
-- Tests in =tests/test-ai-mcp-registration.el=.
-
-*Exit:* with a stubbed =mcp-server-connections=, registration produces correctly prefixed =mcp__SERVER__TOOL= entries in =gptel-tools=; closures call =mcp-call-tool SERVER REMOTE-NAME= (verified by stubbing =mcp-async-call-tool=); deregistration removes only MCP-owned tools and leaves a pre-populated local =git_log= entry intact; re-registration replaces function pointer without duplicating menu entries; confirm overrides win over patterns.
-
-**** TODO [#B] Phase 3 -- Async state machine + timer-race timeout wrapper
-
-*Goal:* implement the lifecycle state machine and the per-call timer-race timeout.
-
-*Entry:* Phase 2 registration works against stubs.
-
-*Deliverables:*
-- Section 6 of =ai-mcp.el= (async state machine): =cj/mcp--state=, =cj/mcp--server-status= alist, =cj/mcp--stall-timer=, =cj/mcp-ensure-started=, =cj/mcp--on-hub-callback=, =cj/mcp--poll-status=, =cj/mcp--start-stall-timer=, =cj/mcp--build-status-from-specs=.
-- =cj/mcp--wrap-async-with-timeout= (timer/callback race; both branches set =done= before invoking gptel callback so late responses are ignored).
-- Tests in =tests/test-ai-mcp-async.el=.
-
-*Exit:* =cj/mcp-ensure-started= returns in <100 ms with delayed-callback stubs; stall timer fires for stuck servers; timer-race wrapper handles all three orderings (MCP-first, timer-first, late-MCP-after-timer); async error path (=:error-callback= without inited callback) reaches =failed= state via polling.
-
-**** TODO [#B] Phase 4 -- First real connection (drawio or slack-deepsat)
-
-*Goal:* wire one real no-auth server end-to-end against actual mcp.el and prove the stubbed Phase 3 behavior matches reality.
-
-*Entry:* Phase 3 async works against stubs.
-
-*Deliverables:*
-- Add =use-package mcp= to =ai-mcp.el= (MELPA active, =:load-path= for local checkout commented).
-- =cj/mcp--assert-capabilities= called at load time; signals clearly if mcp.el is too old.
-- Set =cj/mcp-enabled-servers= temporarily to =("drawio")= (or =("slack-deepsat")= if the local proxy is running).
-- First real =cj/mcp-ensure-started= invocation from =cj/toggle-gptel=.
-
-*Exit:* manual smoke -- =C-; a t= opens GPTel without blocking; within 30 s, drawio (or slack-deepsat) tools appear in =gptel-menu= grouped by category; calling a tool returns expected output; killing the subprocess externally surfaces as =failed= in =cj/mcp--server-status=.
-
-**** TODO [#B] Phase 5 -- Status UX + commands + doctor (static)
-
-*Goal:* ship the full server-management UX so partial-availability and failures are visible.
-
-*Entry:* Phase 4 proves a real connection works.
-
-*Deliverables:*
-- Section 7 of =ai-mcp.el= (UI).
-- Commands: =cj/mcp-status= (echo-area summary keyed off =cj/mcp--state=), =cj/mcp-list-tools= (tabulated buffer with failed servers at top in red face; keys =g r c RET q=), =cj/mcp-doctor= (static mode only -- capability, =npx=/=uvx=, Claude config, per-server env, local endpoints; output buffer keys =c r q=), =cj/mcp-wait-until-ready=, =cj/mcp-hub= (thin wrapper that ensures startup first), =cj/mcp-restart-failed=, =cj/mcp-restart-server=, =cj/mcp-stop-all=.
-- Keymap: =C-; a C= subprefix bound in =ai-config.el='s autoload section. Keys =h s l r R S d w=.
-- which-key labels for every binding.
-- =kill-emacs-hook= registration for =cj/mcp-stop-all=.
-- Investigation: does =gptel-menu= refresh after mid-call tool registration? Document the answer in =ai-mcp.el= commentary; if it requires close+reopen, add to known UX caveats.
-
-*Exit:* all keymap bindings work; audit buffer surfaces failed servers prominently; doctor identifies each scenario in the manual test matrix; status command shows the right state for each phase transition.
-
-**** TODO [#B] Phase 6 -- HTTP servers (linear, notion)
-
-*Goal:* add the two HTTP-transport servers with in-protocol OAuth.
-
-*Entry:* Phase 5 UX shipped.
-
-*Deliverables:*
-- Add =linear= and =notion= back to =cj/mcp-enabled-servers=.
-- Doctor gains live-auth-check mode (=C-u C-; a C d=): invokes a single safe read per auth class to verify OAuth tokens haven't silently expired. Static checks first; live probe only fires after static passes.
-- OAuth recovery pattern matcher surfaces auth URLs in =cj/mcp-status= on first connect.
-
-*Exit:* first connect surfaces the OAuth URL through the recovery pattern; after browser handshake completes, subsequent connects succeed without prompt; live-auth-check correctly identifies a deliberately revoked token; both servers appear ready in the audit buffer.
-
-**** TODO [#B] Phase 7 -- Env-dependent stdio servers (figma, google-*)
+Task: survey the modes/modules Craig works in and identify where a =?= -> curated-help-menu (transient) makes sense. Candidates: any major-mode buffer with single-key bindings and no good discovery affordance -- calibredb (done), nov, dirvish, mu4e, ghostel/term, signel, pearl/linear, ELFeed, etc. For each, note whether =?= is free or already a help dispatch, and whether a curated menu (vs the package's own) adds value. Establish it as a convention (and maybe a small helper/macro to define a curated =?= menu consistently).
-*Goal:* add the remaining five env-dependent servers.
+** TODO [#C] Fix up test runner :feature:refactor:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+*** 2026-05-16 Sat @ 11:15:51 -0500 Ideas
+**** Current State
+=modules/test-runner.el= is a solid first pass for an Emacs-config-specific ERT
+workflow:
+- project-scoped focus lists
+- run all vs focused mode
+- run ERT test at point
+- load all test files
+- clear ERT tests from other project roots
+- keybindings under =C-; t=
-*Entry:* Phase 6 HTTP servers connect cleanly.
+The universal test-running direction is currently split across modules:
+- =test-runner.el= owns ERT focus/state/UI.
+- =dev-fkeys.el= owns F6 language detection and command generation for Elisp,
+ Python, Go, and partial TypeScript.
-*Deliverables:*
-- Add =figma=, =google-calendar=, =google-docs-personal=, =google-docs-work=, =google-keep= to =cj/mcp-enabled-servers=.
-- Verify env-merge from =~/.claude.json= for each (the mtime-cached reader from Phase 1).
-- Verify figma's =:secret-args= splicing places the API key correctly without echoing it.
-- Manual smoke: simulate token expiry on one Google server; recovery message points at "re-auth via Claude Code, then C-; a C r SERVER".
+That split is the biggest architectural pressure point. The test runner should
+eventually own runner discovery, scopes, command construction, result handling,
+and UI. F6 should become a thin entry point into the runner.
-*Exit:* all 9 servers reach =ready= state on a clean machine. Sentinel-grep check across status / audit / hub / errors / audit-log shows zero secret leakage. Doctor's live-auth covers each auth class (oauth, token, args-token, in-protocol, local, none).
+**** Critical Design Issues
+***** Too ERT-specific at the core
+The current state model is named generically, but most operations assume:
+- test files live in =test/= or =tests/=
+- files match =test-*.el=
+- tests are ERT forms
+- individual tests can be selected by ERT selector regex
+- loading tests into the current Emacs process is acceptable
-**** TODO [#B] Phase 8 -- Privacy + audit polish
+This makes the module hard to extend cleanly to pytest, Jest, Vitest, Go, Rust,
+or shell test runners. The common abstraction should be "test run request" and
+"test runner adapter", not "ERT file list".
-*Goal:* land the final UX polish and documentation.
+***** In-process ERT causes state contamination
+=cj/test-load-all= and focused runs load test files into the current Emacs
+session. This is fast and ergonomic, but it can leak:
+- global variables
+- advice
+- loaded features
+- overridden functions
+- ERT test definitions
+- load-path mutations
-*Entry:* all 9 servers working.
+The runner should support two ERT execution modes:
+- =interactive= / in-process for fast local TDD
+- =isolated= / batch Emacs for reliable verification
-*Deliverables:*
-- Audit buffer privacy header: "Tool results land in =gptel-tools= responses; saved conversations persist them. Use =cj/gptel-autosave-toggle= per buffer to opt out."
-- =cj/mcp-tool-audit-log-enabled= defcustom + log writer (=~/.emacs.d/data/mcp-tool-log/YYYY-MM-DD.log= -- metadata only, one line per call, daily rotation).
-- =ai-mcp.el= commentary updated with the code-organization outline as a table of contents.
-- Final pass on tests covering saved-conversation behavior (autosave persists MCP tool results; toggling off prevents persistence).
+The isolated path should be preferred for "before commit", CI parity, and
+agent-driven verification.
-*Exit:* all 10 acceptance criteria from the spec pass. Manual matrix run end-to-end on a fresh Emacs. Working tree clean.
+***** Test discovery is regex-based and fragile
+=cj/test--extract-test-names= scans files with a regex for =ert-deftest=.
+That misses or mishandles:
+- macro-generated tests
+- commented forms in unusual shapes
+- multiline or reader-conditional forms
+- non-ERT Elisp tests such as Buttercup
+- stale ERT tests already loaded in the session
-*** TODO [#C] Wrap the gh CLI as a GPTel tool
+Better approach:
+- for ERT in isolated mode, let ERT discover tests after loading files
+- for source navigation, use syntax-aware forms where possible
+- store discovered tests as structured records with file, line, name, framework,
+ tags, and runner
-**** 2026-05-16 Sat @ 16:20:00 -0500 Spec
+***** Path containment has at least one suspicious edge
+=cj/test--do-focus-add-file= checks:
-Design doc: [[id:a124dd0f-1f40-4533-aeb8-595d93e20865][docs/specs/gptel-gh-tool-spec.org]]
+#+begin_src elisp
+(string-prefix-p (file-truename testdir) (file-truename filepath))
+#+end_src
-*** TODO [#C] GPTel should autosave regularly after a conversation is saved
-*** TODO [#B] Org Workflow Related Tools
+That should use =cj/test--file-in-directory-p= or ensure the directory has a
+trailing slash. Otherwise sibling paths with a shared prefix are a recurring
+class of bug.
-Affordances that expose the Org workspace -- agenda state, capture
-targets, org-roam nodes and backlinks, dailies, drill review state --
-to the agent as structured context, not raw .org buffer text.
+***** Runner commands are shell strings too early
+=cj/--f6-test-runner-cmd-for= returns shell command strings. That makes it
+harder to:
+- inspect command parts
+- safely quote arguments
+- offer command editing
+- run via =make-process= / =compilation-start= without shell ambiguity
+- attach metadata
+- rerun exact invocations
+- convert commands into UI labels
-**** TODO [#B] Agenda state tools :feature:
+Prefer a structured command object:
-Read scheduled / deadline / waiting tasks for a date range; query by
-tag, priority, or TODO keyword; list what's blocking today. Lets the
-agent answer "what's on the critical path this week" without me
-pasting agenda output, and feeds the daily-prep / wrap-up workflows.
+#+begin_src elisp
+(:program "pytest"
+ :args ("tests/test_foo.py" "-q")
+ :default-directory "/project/"
+ :env (("PYTHONPATH" . "..."))
+ :runner pytest
+ :scope file)
+#+end_src
-**** TODO [#B] Org-roam node tools :feature:
+Render to a shell string only at the final compilation boundary.
-Resolve a topic to its node; return body + backlinks; list nodes by
-tag; surface dailies for a date range. Lets the agent reason over
-the personal knowledge graph and write back into it via the capture
-tools below.
+***** F6 and =C-; t= workflows duplicate the same domain
+F6 already handles "all tests" and "current file's tests" for multiple
+languages. =C-; t= handles ERT-only focus and run state. These should converge
+on one runner service:
+- F6: quick entry point
+- =C-; t=: full runner menu
+- both call the same scope/adapter engine
-**** TODO [#B] Capture creation tools :feature:
+***** Test directory discovery is too narrow
+Current discovery prefers =test/= then =tests/=, with a global fallback. Real
+projects often need:
+- Python: =tests/=, package-local =test_*.py=, =pytest.ini=, =pyproject.toml=
+- JS/TS: =package.json= scripts, =vitest.config.*=, =jest.config.*=,
+ =*.test.ts=, =*.spec.ts=
+- Go: package directories, =go.mod=
+- Rust: =Cargo.toml=, integration tests under =tests/=
+- Elisp packages: =Makefile=, =Eask=, =ert-runner=, Buttercup, =tests/=
-Drive =org-capture= from a template key + body string. Lets the
-agent file inbox items, reading notes, journal entries, or roam
-nodes without me leaving the chat. Tight pairing with the
-=cj/org-capture= optimization task in todo.org.
+Discovery should be adapter-specific and project-config-aware.
-**** TODO [#B] Org-drill review tools :feature:
+***** No structured result model
+=cj/test-last-results= exists but is not meaningfully populated. A powerful
+runner needs a normalized result model:
+- run id
+- started/finished timestamps
+- status: passed/failed/errored/cancelled/skipped/xfail/xpass
+- command
+- runner adapter
+- scope
+- exit code
+- duration
+- failed test records
+- file/line locations
+- raw output buffer
+- coverage artifact paths
-Surface next-due drill cards in =drill-dir=; let the agent quiz on a
-topic and report performance. Useful for prompted recall sessions
-("ask me five medical-Spanish cards") and for "did this card stick"
-analysis.
+This enables last-failed, failures-first, summaries, dashboards, and AI-assisted
+failure explanation.
-*** TODO [#B] Git Related Tools
+***** No failure parser / navigation layer
+Compilation buffers are useful, but the runner should parse common failure
+formats and provide:
+- next/previous failure
+- jump to source line
+- failure summary buffer
+- copy failure context
+- rerun failed test at point
+- annotate failing tests in source buffers
-Affordances that expose magit's structured view of a repo -- sections,
-staged-vs-unstaged, commit metadata, rebase / conflict state -- as
-first-class tools rather than asking the model to reason over raw
-diff text.
+Adapters can provide regexes/parsers for ERT, pytest, Jest/Vitest, Go, Rust,
+and shell.
-**** TODO [#B] Section-aware git tools :feature:
+***** Missing watch/rerun modes
+Modern test runners optimize the feedback loop:
+- pytest supports selecting tests, markers, last-failed, failures-first,
+ stepwise, fixtures, xfail/skip, plugins, and cache state.
+- Jest/Vitest support watch workflows, changed-file selection, coverage,
+ snapshots, and rich interactive filtering. Vitest also defaults to watch in
+ development and run mode in CI.
+- Go and Rust runners commonly support package-level runs, regex selection,
+ race/coverage flags, and cached test behavior.
-Expose Magit sections as first-class GPTel tools: current section type,
-heading, file, hunk range, and content; sibling sections under the same
-file; staged / unstaged / untracked status; commit metadata around the
-selected commit or branch; the exact staged patch that would be
-committed. Lets prompts say "review the file section at point" or
-"explain this hunk in the context of adjacent hunks" without manual
-context-copying.
+The Emacs runner should expose the subset that maps well to editor workflows:
+- current test
+- current file
+- related test file
+- focused set
+- last failed
+- failed first
+- changed since git base
+- watch current scope
+- full project
+- coverage for current scope
-**** TODO [#B] Commit intent workbench :feature:
+**** Proposed Architecture
+***** Core Types
+Use plain plists initially; promote to =cl-defstruct= only if helpful.
-Transient that builds a commit intentionally:
-1. Agent reads unstaged + staged changes.
-2. Agent proposes coherent commit groups.
-3. User selects groups in a Magit-style buffer.
-4. Agent stages those paths or hunks only after confirmation.
-5. Agent generates a message reflecting the selected intent.
+#+begin_src elisp
+;; Test runner adapter
+(:id pytest
+ :name "pytest"
+ :languages (python)
+ :detect cj/test-pytest-detect
+ :discover cj/test-pytest-discover
+ :build-command cj/test-pytest-build-command
+ :parse-results cj/test-pytest-parse-results
+ :capabilities (:current-test :file :project :last-failed :coverage :watch))
-Addresses the common case of two or three unrelated edits in one
-working tree -- a single commit-message generator can't handle that
-cleanly.
+;; Test run request
+(:project-root "/repo/"
+ :language python
+ :framework pytest
+ :scope file
+ :file "/repo/tests/test_api.py"
+ :test-name "test_create_user"
+ :extra-args ("-q")
+ :profile default)
-**** TODO [#B] Patch narrative buffer :feature:
+;; Test run result
+(:run-id "..."
+ :status failed
+ :exit-code 1
+ :duration 2.14
+ :failures (...)
+ :output-buffer "*test pytest*"
+ :artifacts (...))
+#+end_src
-Generate an Org buffer that explains a change set as a reviewable
-narrative:
-- "What changed" by subsystem.
-- "Why it appears to have changed" inferred from names, tests, and docs.
-- "Risk areas" with links back to Magit file sections.
-- "Suggested verification" using local Makefile targets when present.
+***** Adapter Registry
+Create a registry like:
-Reusable artifact: paste into a PR description, save with an AI
-session, or file into org-roam.
+#+begin_src elisp
+(defvar cj/test-runner-adapters nil)
+(cj/test-register-adapter 'pytest ...)
+(cj/test-register-adapter 'ert ...)
+(cj/test-register-adapter 'vitest ...)
+#+end_src
-**** TODO [#B] Review-thread simulator :feature:
+Runner selection should consider:
+- buffer file extension
+- project files
+- explicit user override
+- available executables
+- package manager scripts
+- existing Makefile targets
-Before opening a PR, create a local review buffer with inline comments
-attached to Magit diff positions. The agent writes comments as if
-reviewing someone else's patch:
-- Comments grouped by severity.
-- Each comment links to file and line.
-- Resolved comments check off in Org.
-- Accepted suggestions apply through the existing text-update tools.
+***** Scope Model
+Make scopes explicit and shared across languages:
+- =test-at-point=
+- =current-file=
+- =related-file=
+- =focused-files=
+- =last-failed=
+- =changed=
+- =package/module=
+- =project=
+- =coverage=
+- =watch=
-Makes "review my diff" less ephemeral and avoids losing useful findings
-inside a chat transcript.
+Each adapter can say which scopes it supports. Unsupported scopes should produce
+clear user-errors with suggestions.
-**** TODO [#B] Rebase and conflict coach :feature:
+***** Command Builder Pipeline
+1. Detect project.
+2. Detect language/framework candidates.
+3. Resolve user-requested scope.
+4. Build structured command object.
+5. Optionally let user edit command.
+6. Run via =compilation-start= or =make-process=.
+7. Parse output/result artifacts.
+8. Store normalized result.
+9. Update UI/modeline/messages/failure buffer.
-When Magit enters a rebase, cherry-pick, merge, or conflict state,
-expose an agent command that reads:
-- Git operation state from =.git/=.
-- Conflict markers in the worktree.
-- Relevant commits from =git log --merge= or the rebase todo.
-- The current Magit status sections.
+***** Keep Makefile Support But Do Not Require It
+For this Emacs config, =make test-file= and =make test-name= are useful and
+should remain the default Elisp isolated path. But adapter detection should
+support:
+- direct =emacs --batch= ERT invocation
+- =make test=
+- =make test-file=
+- =make test-name=
+- Eask
+- Buttercup
-The agent explains the conflict in domain terms and proposes a
-resolution patch; the actual edit and =git add= stay under explicit
-user control.
+**** Elisp-Specific Improvements
+***** Add isolated ERT runs
+Support batch commands for:
+- all project tests
+- one test file
+- one test name
+- focused files
+- last failed, once result parsing exists
-**** TODO [#B] Regression archaeology :feature:
+Use the same Makefile targets in this repo, but design the adapter so other
+Elisp projects can run without this Makefile.
-Magit transient that runs a bisect-like reasoning workflow:
-- Ask for a symptom and a known-good / known-bad range.
-- Summarize candidate commits in small batches.
-- Use tests or user-provided repro commands when available.
-- Maintain a bisect journal in an Org buffer.
+***** Support Buttercup/Eask Later
+Buttercup uses BDD-style =describe= / =it= suites and is common in Elisp
+package testing. Eask is often used to run package tests. Add adapter slots
+for these instead of hard-coding ERT forever.
-Even when the agent can't run the whole bisect, it keeps the
-investigation structured and preserves why each commit was judged
-good or bad.
+***** Avoid unnecessary global ERT deletion
+=cj/ert-clear-tests= is a pragmatic fix for project contamination, but the
+stronger long-term answer is isolated runs plus project-scoped discovery. Keep
+the cleanup command, but do not make correctness depend on deleting global ERT
+state.
-**** TODO [#B] Messaging Related Tools
+**** Python / pytest Ideas
+- Detect pytest by =pyproject.toml=, =pytest.ini=, =tox.ini=, =setup.cfg=, or
+ presence of =tests/=.
+- Build commands for:
+ - project: =pytest=
+ - file: =pytest path/to/test_file.py=
+ - test at point: =pytest path/to/test_file.py::test_name=
+ - class method: =pytest path::TestClass::test_method=
+ - marker: =pytest -m marker=
+ - last failed: =pytest --lf=
+ - failed first: =pytest --ff=
+ - stop after first: =pytest -x=
+ - coverage: =pytest --cov=...=
+- Parse output for failing node ids and =file:line= references.
+- Read pytest cache for last-failed where useful.
+- Offer marker completion by parsing =pytest --markers= or config files.
+- Surface xfail/skip separately from hard failures.
-Affordances over mu4e, Slack, Telegram, and ERC. Same shape across
-protocols: read recent threads, search by sender / topic, compose a
-draft from a prompt + thread context, leave the send under explicit
-user control.
+**** TypeScript / JavaScript Ideas
+***** Detection
+Detect runner by project files and scripts:
+- =vitest.config.ts/js/mts/mjs=
+- =jest.config.ts/js/mjs/cjs=
+- =package.json= scripts: =test=, =test:watch=, =vitest=, =jest=
+- lockfile/package manager: =pnpm-lock.yaml=, =yarn.lock=, =package-lock.json=,
+ =bun.lockb=
-***** TODO [#B] Mu4e thread and compose tools :feature:
+Prefer project scripts over raw =npx= when present:
+- =pnpm test -- path=
+- =npm test -- path=
+- =yarn test path=
+- =bun test path=
-Read the message at point and surrounding thread (with attachments
-summarized); query the inbox by =from:= / =subject:= / date range;
-compose a draft from a prompt + thread context using =org-msg=.
-Pairs with the existing =mu4e-org-contacts-integration.el=.
+***** Scopes
+- current file: =vitest run path= or =jest path=
+- test at point: use nearest =it= / =test= / =describe= string and pass =-t=
+- watch current file
+- changed tests where runner supports it
+- coverage current file/project
+- update snapshots
-***** TODO [#B] Slack thread and compose tools :feature:
+***** Result Parsing
+Parse:
+- failing test names
+- file paths and line numbers
+- snapshot failures
+- coverage summary
-Read channel / DM / thread history through =emacs-slack=; search by
-user or channel; compose a draft message but leave sending to me.
-Mirrors the mu4e shape so the agent's interface is uniform across
-messaging protocols.
+Treat snapshot updates as an explicit command, not an automatic side effect.
-***** TODO [#B] Telegram and IRC read tools :feature:
+**** Go Ideas
+- Detect =go.mod=.
+- Current file/source: run package =go test ./pkg=.
+- Test at point: nearest =func TestXxx= and run =go test ./pkg -run '^TestXxx$'=.
+- Bench at point: nearest =BenchmarkXxx= and run =go test -bench '^BenchmarkXxx$'=.
+- Add toggles for =-race=, =-cover=, =-count=1=, =-v=.
+- Parse =file.go:line:= output and package failure summaries.
-Same shape as Slack for =telega= (Telegram) and =erc= (IRC):
-recent-message reads, search, and draft compose. Bundled because
-the API shape is identical even if the underlying clients differ.
+**** Rust Ideas
+- Detect =Cargo.toml=.
+- Use =cargo test= by default, optionally =cargo nextest run= when available.
+- Current test at point: nearest =#[test]= function.
+- Current file/module where possible.
+- Integration test file: =cargo test --test name=.
+- Support =-- --nocapture= toggle.
+- Parse compiler/test failures and =file:line= links.
-***** TODO [#B] Contact resolution tools :feature:
+**** Shell / Generic Ideas
+- Adapter for Makefile targets:
+ - detect =make test=, =make check=, =make coverage=
+ - expose project-level commands even when language-specific detection fails
+- Adapter for arbitrary project command configured in dir-locals or a project
+ config plist.
+- Let users register custom command templates per project:
-Resolve a name to email / Slack ID / Telegram handle via
-=org-contacts= and the configured address books. Removes the
-"who's this person again" friction from the compose flows above.
+#+begin_src elisp
+((:name "unit"
+ :command ("npm" "run" "test:unit" "--" "{file}"))
+ (:name "integration"
+ :command ("pytest" "tests/integration" "-q")))
+#+end_src
-**** TODO [#B] File and Buffer Related Tools
+**** UI Ideas
+***** Transient Menu
+Replace or complement the raw keymap with a =transient= menu:
+- scope: current test/file/focused/last failed/project
+- runner: auto/ert/pytest/vitest/jest/go/cargo/make
+- toggles: watch, coverage, debug, fail-fast, verbose, update snapshots
+- actions: run, rerun, edit command, show failures, open report
-Affordances that expose the user's actual workspace -- open buffers,
-narrowed regions, marked files, vterm / eshell sessions -- as
-structured context. Stops the model from asking "what file are you
-looking at" or "what region is selected."
+***** Result Buffer
+Create a normalized =*Test Results*= buffer:
+- latest status per project
+- command and duration
+- pass/fail/skip counts
+- failure list with clickable =file:line=
+- actions to rerun failed/current/all
+- links to coverage artifacts
-***** TODO [#B] Buffer state tools :feature:
+***** Modeline / Headerline Signal
+Show the last run status for the current project:
+- green passed
+- red failed
+- yellow running
+- gray no run
-List visible buffers with major-mode + file (when any); read the
-narrowed region instead of the whole buffer; report point + mark
-positions and the active region's text. The single most-asked
-question between turns becomes a tool call.
+Keep it quiet and optional.
-***** TODO [#B] Dirvish / Dired tools :feature:
+***** History
+Store recent run requests per project:
+- rerun last
+- rerun last failed
+- choose previous command
+- compare duration/status against previous run
-Read marked files, sort state, and filter state from a Dired or
-Dirvish buffer. Lets the agent operate on "the files I just marked"
-rather than "files in this directory" -- a real distinction in any
-review or refactor workflow.
+**** Configuration Ideas
+- =cj/test-runner-default-scope=
+- =cj/test-runner-prefer-isolated-elisp=
+- =cj/test-runner-project-overrides=
+- =cj/test-runner-known-adapters=
+- =cj/test-runner-enable-watch=
+- =cj/test-runner-result-retention=
+- per-project override through =.dir-locals.el=
-***** TODO [#B] Vterm session tools :feature:
+Example:
-Recent command output from a named vterm session; scroll-history
-search. Pairs naturally with the =ai-vterm= design: the agent
-running in one project's vterm can read another project's vterm
-without leaving the chat.
+#+begin_src elisp
+((nil . ((cj/test-runner-project-overrides
+ . (:adapter pytest
+ :default-args ("-q")
+ :coverage-args ("--cov=src"))))))
+#+end_src
-***** TODO [#B] Eshell session tools :feature:
+**** Safety And Robustness
+- Use structured commands until the final boundary.
+- Quote only at render time.
+- Avoid shell when =make-process= / =process-file= is sufficient.
+- Keep command preview/editing available for surprising cases.
+- Detect missing executables before running.
+- Add timeouts/cancel commands for long-running or hung tests.
+- Do not silently fall back from a missing runner to a different runner unless
+ the fallback is visible in the command preview.
+- Avoid mutating global =load-path= permanently.
+- Keep remote/TRAMP behavior explicit; do not accidentally run local commands
+ for remote projects.
-Same shape as the vterm tools for =eshell= sessions -- last-command
-output, history search, current directory. Most useful for
-agent-driven inspection of long-running pipelines.
+**** Coverage Integration
+Tie this into the existing coverage work:
+- run coverage for current file/scope
+- open latest coverage report
+- summarize uncovered lines for current file
+- support Elisp SimpleCov/Undercover, pytest-cov, Vitest coverage, Go cover,
+ and Rust coverage later
+- store coverage artifact paths in the normalized run result
-**** TODO [#B] Filesystem Related Tools
+**** AI-Assisted Debugging Ideas
+- Summarize failing tests from the parsed failure records and raw output.
+- Include command, changed files, failure snippets, and relevant source/test
+ locations.
+- Redact env vars, tokens, Authorization headers, and secrets before sending to
+ =gptel=.
+- Add commands:
+ - =cj/test-runner-explain-failure=
+ - =cj/test-runner-suggest-related-tests=
+ - =cj/test-runner-summarize-coverage-gap=
-Affordances that let the agent operate on actual files on disk and
-run common CLI utilities -- pandoc, ffmpeg, imagemagick, ripgrep,
-fd, jq -- rather than relying on me to paste content or run
-commands by hand.
+**** Migration Plan
+***** Phase 1: Internal cleanup
+- Fix the task typo and rename current ERT-specific functions or wrap them under
+ an ERT adapter.
+- Move F6 language detection/command construction from =dev-fkeys.el= into
+ =test-runner.el= or a new =test-runner-core.el=.
+- Replace shell-string command builders with structured command plists.
+- Fix path containment in =cj/test--do-focus-add-file=.
+- Make =cj/test-last-results= real for ERT runs.
-*Design tension to resolve before any of these ship: one tool per
-utility, or one generic =run_shell_command=?*
+***** Phase 2: ERT adapter
+- Implement adapter registry.
+- Add ERT adapter with in-process and isolated modes.
+- Preserve all current keybindings by routing them through the adapter.
+- Add failure/result normalization for ERT.
+- Add "rerun last" and "rerun failed" for ERT.
-The shortlist's first pass DEFERRED a generic =run_shell_command=:
-sandboxing to HOME + /tmp with a denylist for destructive ops is
-straightforward, but the denylist can never be exhaustive, and
-"confirmation for everything else" becomes click-fatigue.
+***** Phase 3: Python and JS/TS adapters
+- Add pytest adapter.
+- Add Vitest/Jest adapter with package-manager/script detection.
+- Support current file and test-at-point for both.
+- Add parser/navigation for common failures.
-The children below take the other path -- *one gptel tool per
-binary*, with a strictly-typed argv shape (e.g.
-=pandoc_convert(input_path, output_format)=, not
-=pandoc_convert(args_string)=). Each tool:
+***** Phase 4: UI and watch modes
+- Add transient menu.
+- Add result buffer.
+- Add cancellation and rerun history.
+- Add watch commands where supported.
-- Validates its own paths (must be under HOME, outputs in a
- sandboxed dir).
-- Rejects dangerous flags explicitly (pandoc =--filter=, ffmpeg's
- =-protocol_whitelist= chicanery, imagemagick's policy bypasses).
-- Runs via =call-process= with an argv list -- no shell parsing,
- no string-interpolation injection.
-- Caps output and reports truncation inline.
+***** Phase 5: Coverage and AI
+- Connect coverage commands to adapter capabilities.
+- Add failure summarization with redaction.
+- Add coverage-gap summarization.
-The trade-off is breadth: every new CLI tool means a new gptel tool
-file. Acceptable because (a) the list of utilities I actually need
-agent access to is small (~8 below covers most of it), and (b) each
-wrapper gets type-checked argv and a focused description the model
-can reason over, which is genuinely better than a free-form
-=run_shell_command(string)=.
+**** Acceptance Criteria For First Fix-Up Pass
+- Existing ERT workflow still works.
+- F6 and =C-; t= use the same underlying runner API.
+- Current-file test command generation is covered for Elisp, Python, Go,
+ TypeScript, and JavaScript.
+- At least one isolated ERT command path exists.
+- Path containment checks are robust against sibling-prefix paths and symlinks.
+- Runner requests and results are represented as data, not only messages.
+- Missing runner/tool errors are clear and actionable.
+- Tests cover adapter detection, command building, scope resolution, result
+ storage, and key interactive paths.
-The =eshell_submit= entry at the end is the escape hatch for one-
-off needs the wrappers don't cover -- =:confirm t= always.
+** TODO [#C] Keymap consolidation — resolve decisions, run Phase 1-2 :feature:refactor:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-13
+:END:
+Spec: [[id:540bf06b-16b8-46c6-b459-c40d1b9c795d][keybinding-console-safety-spec-doing.org]]. Phase 0 (revert 4a1ecf64) is done and pushed. Decisions D1-D5 are open TODOs in the spec; D2/D4/D5 gate the primary work (Phase 1 prune via Appendix D, Phase 2 consolidate + retire the translation block), while D1/D3 (the console-safe prefix) gate only the optional Phase 3 and can stay open indefinitely. Resolve D2/D4/D5, then run Phase 1-2. Appendix D is the keybinding pruning checklist. Add a =#+TODO: TODO | DONE SUPERSEDED CANCELLED= header line to the spec if adopting those decision keywords (rulesets convention update, 2026-06-12).
-Adjacent categories: the existing =gptel-tools/= file CRUD
-(=read_text_file=, =write_text_file=, =update_text_file=,
-=list_directory_files=, =move_to_trash=) is the foundation this
-category extends. =web_fetch= is the network-fetch counterpart.
+** TODO [#C] Ledger-config audit + guardrail UX :feature:
+Now that =modules/ledger-config.el= is wired (6ec857ae), audit it thoroughly — correctness first, then especially the data-entry UX. Goal (Craig): a workflow with enough guardrails that it's hard to make a costly mistake in a financial file. Audit surface: clean-on-save behavior (does =ledger-mode-clean-buffer= ever reorder/rewrite in a surprising way; is the demoted-error swallow hiding real problems), flycheck-ledger coverage (unbalanced transactions, bad account names) and whether it surfaces clearly, reconcile safety, the report set, company-ledger account/payee completion as a typo guard, and any add-transaction entry flow. Identify gaps, then design the guardrails (validation on save, completion to prevent account-name drift, a confirm before destructive reconcile, etc.). The correctness/gap audit can run solo; the UX guardrail choices need Craig's preferences, so not tagged :solo:. Priority [#C] is a placeholder — bump if ledger becomes active daily use.
-***** TODO [#B] Document conversion (pandoc) :feature:
+** TODO [#C] ai-term multi-LLM support — Claude / Codex / ollama :feature:
+Allow creating an ai-term that launches any of Claude, Codex, or a local LLM via ollama, switchable at session start. From rulesets/Craig via the roam inbox. Spec note: =inbox/PROCESSED-2026-06-23-2123-from-rulesets-ai-term-multi-llm-support-from-craig.org=.
+** TODO [#C] ai-term: multi-backend (Claude / Codex / local ollama) :feature:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-22
+:END:
+Allow creating an ai-term backed by any of Claude, Codex, or a local LLM via ollama, with the backend chosen seamlessly at the start of the session. ai-term currently assumes Claude; generalize the launch path so the agent backend is a selectable parameter and switching between them at session start is frictionless. Routed here from the rulesets roam-inbox item "multiple agent source improvements" (its bullet 3 asked to send emacs this note); the item's other bullets — naming the agent so non-Claude agents aren't called "Claude", and tightening workflow wording for Codex's more literal reading — stay with rulesets.
-Convert between markdown, org, html, pdf, docx, latex, epub, plain
-text. Most common use: "extract this docx to markdown so I can
-read it inline." Strict argv: input path, output format, optional
-output path. Reject =--filter= and =--lua-filter= (arbitrary code
-execution). Output written to a sandbox dir unless explicit
-override.
+** TODO [#C] Migrate tests off mocking primitives (native-comp robustness) :test:refactor:solo:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+Long-term test-quality work surfaced by re-enabling native-comp (2026-06-20). When a test redefines a C primitive or a native-compiled function (=cl-letf=/=fset=/=advice-add=), native-comp routes native callers through a trampoline, which interacts badly with mocks in three ways: trampoline-build failure under =--batch=, silent mock-bypass (native callers ignore the redefinition), and arity mismatch (the trampoline calls the mock with the primitive's max arity).
-***** TODO [#B] Image manipulation (imagemagick) :feature:
+Done 2026-06-21 (the immediate fix): swept every arity-narrow subr mock to =(lambda (&rest _) ...)= (188 sites) and added =tests/test-meta-subr-mock-arity.el=, which fails =make test= on any arity-narrow subr mock. That kills the arity mode (the only one we've hit) and enforces it going forward.
-Resize, format-convert, get-metadata (=identify=), optionally crop /
-rotate / annotate. Common use: "resize this PNG to a thumbnail" or
-"convert these HEICs to JPEGs." Strict argv per operation.
-Reject pre-validated dangerous formats (the historical EXR / SVG /
-MVG CVE surface) unless explicitly enabled. ImageMagick's
-=policy.xml= is the underlying defense; the wrapper enforces it at
-the tool boundary too.
+This task is the durable fix the ecosystem and =elisp-testing.md= point to: restructure tests so they don't redefine primitives at all — inject dependencies, drive real state (temp-file fixtures, real buffers), or test pure helpers. That closes the two latent modes (build-failure, silent-bypass) the variadic sweep leaves open. Big, incremental, low-urgency.
-***** TODO [#B] Audio / video processing (ffmpeg) :feature:
+Full mechanism, the three failure modes, the research (Emacs bug#51140, bug#61880, buttercup #230, Debian #1021842, the emacs-29 redefine-primitive warning, the manual on =native-comp-enable-subr-trampolines=), and the decision: [[file:docs/native-comp-subr-mocking.org][docs/native-comp-subr-mocking.org]].
-Trim, transcode, extract audio, get-metadata (=ffprobe=). Paths
-under HOME only; reject network-protocol inputs (=http:= / =rtmp:=
-/ =rtsp:=) so the model can't pull from arbitrary sources. Pairs
-with the existing transcription module -- the same "extract audio
-from video" path =cj/transcribe-media= uses internally.
+** TODO [#C] buffer-differs save prompt: 4-way yes/no/diff/cancel :feature:next:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+The "buffer differs from file" confirmation currently gives only yes/no. Craig wants a 4-way choice with explicit consequences: yes (be explicit it overwrites), no (be explicit it discards this action and continues), diff (show a graphical difftastic diff, then return to this prompt), cancel (stop the action, leave the buffer untouched). Needs the exact prompt identified first (which save/overwrite path raises "buffer differs") and a design for the diff-then-return loop. difftastic + cj/diff-buffer-with-file infrastructure already exist. From the roam inbox 2026-06-16.
+** TODO [#C] emacs: tag tasks by module name for sorting :refactor:studio:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+Replace topic tagging with single-word module tags: :studio: for everything under scripts/theme-studio/, module-named tags elsewhere, :multi: for cross-area work. Drop bug/enhancement-style tags since work should be chosen on other bases. This changes the current six-tag convention, so update the priority-scheme section to document it, rewrite the task-audit workflow to reconcile tasks against the module scheme, then run the audit. Queue for end of session. From the roam inbox.
+** TODO [#C] Build debug-profiling.el module :feature:solo:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
-***** TODO [#B] Content search (ripgrep) :feature:
+Reusable profiling infrastructure for targeted slow-command investigation. Consolidates scattered profiler bindings (currently in =modules/config-utilities.el=) and adds two pure-helper-backed entry points: "profile next command" and "time region or sexp." Designed via =/brainstorm= 2026-04-26.
-=rg= wrapper with path / glob filtering, result-count cap, optional
-literal-vs-regex mode. Pure read. Was in the shortlist's ADOPT
-bucket as =search_in_files=. Highest-leverage filesystem tool by
-expected call frequency -- "where in this repo is X" is the
-question I paste agent output for most often.
+Design: [[id:c713b431-ae14-498d-aba9-b84d52f981b6][docs/specs/debug-profiling-spec.org]]
-***** TODO [#B] File discovery (fd) :feature:
+Implement via =/start-work= against the design — branch =feat/debug-profiling=, commits decomposed along the test-first split-for-testability boundary. Once shipped, use it as the v1 exercise on the queued [#B] org-capture target-building investigation.
-=fd= (or =find= fallback) wrapper, capped result count. Pure
-read, lower stakes than =search_in_files= (filenames only, no
-content). Common pairing: =find_file_by_name= then
-=read_text_file=.
+** TODO [#C] Evaluate jamescherti essential-emacs-packages list :quick:solo:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+Review [[https://www.jamescherti.com/essential-emacs-packages/][James Cherti's essential Emacs packages]] for anything worth installing. Cross-check each candidate against what is already in the config (=modules/= + =init.el=), skip the ones already present, and shortlist the genuinely new ones with a one-line rationale. Future-installation research, not a commitment to install.
-***** TODO [#B] Metadata extraction (file / exiftool) :feature:
+** TODO [#C] Extend F2 "preview" convention across modes :feature:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
-=file= for MIME-type detection; =exiftool= for image / video /
-audio metadata. Lets the agent answer "what is this file" or
-"when was this photo taken" without me opening external tools.
-Pure read.
+F2 is the universal preview key. Currently bound only in markdown-mode (markdown-preview, in =modules/markdown-config.el=). Org-reveal lives on =C-; o R= via =cj/org-map=, not F2. Extend F2 to other modes where a "preview" action is natural:
-***** TODO [#B] Structured data processing (jq / yq) :feature:
+- Hugo blog (hugo-config.el) — preview the post in browser
+- HTML / web-mode — open in browser
+- Reveal presentations - preview in browser
+- Any other mode with a natural "preview this" action
-=jq= for JSON, =yq= for YAML / TOML. Filter / project / transform
-structured data into a smaller, more focused view before reading.
-Strictly read-only -- output goes to the chat, not to disk. The
-agent often wants "the third element of .results" from a JSON file
-and this is much cheaper than pasting the whole thing.
+Keep the binding mode-local so F2 stays available as a global candidate where no preview makes sense.
-***** TODO [#B] Eshell command submission :feature:
+** TODO [#C] Gold text in auto-dimmed buffers :bug:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+Some auto-dimmed document buffers render text in gold; source unknown. Likely a face-remapping or overlay interaction with the theme. Blocked on the face/font diagnostic tool above for diagnosis. From the roam inbox.
+** TODO [#C] Google Contacts ↔ org-contacts sync investigation :feature:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+From the 2026-06-11 brainstorm. Goal: keep [[file:~/sync/org/contacts.org][contacts.org]] (real org-contacts: PROPERTIES drawers, mu4e completion, org-roam links) in sync with Google Contacts. Google side is solid — official People API (OAuth2, incremental syncToken) or CardDAV; no ToS risk. The hard parts are local: (1) identity — entries have no UID, so two-way needs a GOOGLE_ID property per entry plus a one-time fuzzy reconciliation of the two populated datasets (name/email/phone matching); (2) field mapping — space-separated multi-email in one property, free-text body notes, inconsistent phone formats (normalization decision); (3) conflict policy. First decision gates the rest: one-way Google→org read model (simple) vs true two-way. Candidate architectures: vdirsyncer (proven two-way engine w/ Google support; build only the vCard↔org translation, evaluate org-vcard fidelity) vs a direct People API script with sync state in org properties. Output: recommendation doc in docs/design/ naming direction + the normalization/conflict decisions for Craig. Not :solo: — the one-way-vs-two-way call and normalization policy are Craig's.
-Submit a single eshell command line, return output (capped).
-=:confirm t= always -- this is the escape hatch where the
-strictly-typed wrappers above don't fit, so each invocation needs
-my eyeball. Eshell parses in-process (no /bin/sh fork) so the
-security surface is narrower than a shell command runner, but it's
-still effectively arbitrary execution -- treat it as such.
+** TODO [#C] Google Voice in Emacs — SMS + dialer investigation :feature:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+From the 2026-06-11 messenger-unification brainstorm. Google Voice has no official API; the viable routes ride the Matrix bridge ecosystem's reverse engineering (mautrix-gvoice). Research pass to establish the 2026 state of play: (1) is mautrix-gvoice healthy and what does its auth flow look like now; (2) any better-maintained alternative (CLI/daemon) for the signel-pattern architecture (external daemon + JSON-RPC + thin Emacs chat client); (3) does call initiation (ring-linked-phone-then-connect, Emacs as dialer) survive in the current protocol — two-way audio in Emacs is out of scope (WebRTC); (4) ToS/account-flag risk assessment for Craig's account. Output: a recommendation doc in docs/design/ naming the architecture (signel-pattern daemon vs Matrix bridge + ement.el) or a no-go with reasons. If go, GV becomes a registered backend under the messenger-unification convention (see the [#B] task below).
-**** TODO [#B] Media and Reading Related Tools
+** TODO [#C] Org-noter custom workflow — fix and finish :feature:bug:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
-Affordances over non-code content: feeds, PDFs, EPUBs, music. The
-agent's job here is summarize / extract / queue, not produce.
+Continue debugging and testing the custom org-noter workflow from 2025-11-21 session.
+This is partially implemented but has known issues that need fixing before it's usable.
-***** TODO [#B] Elfeed entry tools :feature:
+*Last worked on:* 2025-11-21
+*Current status:* Implementation complete but has bugs, needs testing
-Read entry body; list unread by feed or tag; mark read after a
-summary lands in a roam node or inbox. Enables "give me the
-non-noise headlines from this week's feeds" flows.
+*Known issues to fix:*
-***** TODO [#B] PDF and EPUB text tools :feature:
+1. /Double notes buffer appearing when pressing 'i' to insert note/
+ - When user presses 'i' in document to insert a note, two notes buffers appear
+ - Expected: single notes buffer appears
+ - Need to debug why the insert-note function is creating duplicate buffers
-Extract plain text from a PDF page or page range (via =pdftotext=)
-and from an EPUB (via the existing nov-mode pipeline). Lets the
-agent summarize / quote a research paper or book chapter without
-me pasting passages.
+2. /Toggle behavior refinement needed/
+ - The toggle between document and notes needs refinement
+ - May have edge cases with window management
+ - Need to test various scenarios
-***** TODO [#B] EMMS playback and queue tools :feature:
+*Testing needed:*
-Current track, queue contents, playback state; queue or play a
-path; compose a playlist from a prompt ("play something focusing
-that's not Nick Cave"). Light tools, but a frequent friction
-point.
+1. /EPUB files/ - Test with EPUB documents (primary use case)
+2. /Reopening existing notes/ - Verify it works when notes file already exists
+3. /Starting from notes file/ - Test opening document from an existing notes file
+4. /PDF files/ - Verify compatibility with PDF workflow
+5. /Edge cases:/
+ - Multiple windows open
+ - Splitting behavior
+ - Window focus after operations
-**** TODO [#B] Development Workflow Related Tools
+*Implementation files:*
+- =modules/org-noter-config.el= - Custom workflow implementation
+- Contains custom functions for document/notes toggling and insertion
-Affordances over the dev loop: compilation output, test invocation,
-coverage / profile data, flycheck / flymake diagnostics.
+*Context:*
+This custom workflow is designed to make org-noter more ergonomic for Craig's reading/annotation
+workflow. It simplifies the toggle between document and notes, and streamlines note insertion.
+The core functionality is implemented but needs debugging before it's production-ready.
-***** TODO [#B] Compilation buffer tools :feature:
+**Next Steps:**
+1. Debug the double buffer issue when pressing 'i'
+2. Test all scenarios listed above
+3. Refine toggle behavior based on testing
+4. Document the final keybindings and workflow
-Read the most recent =compile= buffer output; parse error locations
-to =file:line=; summarize what broke. Pairs with the F6 test-runner
-flow -- "tell me what's failing" becomes a single agent turn
-instead of paste + parse.
+** TODO [#C] Pick and wire a debug backend for F5 :feature:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
-***** TODO [#B] Project test invocation tools :feature:
+#+begin_src emacs-lisp
+ Give me an idea of the amount of work and complexity and what allows for a consistent UX across languages.
+#+end_src
-Run =make test-file FILE=X= / =make test-name TEST=Y= /
-project-equivalent and return results. Currently each agent guesses
-the project convention; expose the canonical invocation explicitly
-per project so the agent can run focused tests itself.
+*** 2026-05-15 Fri @ 19:19:21 -0500 Inital Goals
+Bind F5 globally to a debug entry point. Backend choice is the hard part:
-***** TODO [#B] Coverage and profile tools :feature:
+- dape (Debug Adapter Protocol for Emacs) — modern, multi-language via DAP. Single UX across Python, Go, TS, Rust, etc. Less mature than DAP clients in other editors.
+- realgud — wraps multiple debuggers (pdb, gdb, node --inspect, etc.). More mature; UX varies by backend.
+- Language-specific stacks — dap-mode (python-mode + dap), delve for go, ts-node --inspect, etc. Best per-language UX; most config work.
-Read the most recent SimpleCov JSON or profile dump. Lets the
-agent answer "what's still uncovered after this push" or "what
-function dominates startup time" against real measured data.
+F5 itself will be simple (start/resume debug). Likely modifier variants once the backend is picked:
+- C-F5 toggle breakpoint at point
+- M-F5 eval expression in debug context (or step-over shortcut)
-***** TODO [#B] Diagnostic tools (flycheck / flymake) :feature:
+Evaluate against these projects' languages: elisp (edebug already works), Python, Go, TS, shell. Shell debug is usually print-based; skip.
-Surface current-buffer or project-wide errors and warnings. Useful
-both as a "what's broken right now" check and as input to the
-patch-narrative buffer / commit-intent workbench above.
+Do this after the F-key rework ticket ships so F5 is the only hole left.
-**** TODO [#C] gptel-magit activation fails on velox :bug:quick:
+** TODO [#C] Review and rebind M-S- keybindings :refactor:
:PROPERTIES:
-:LAST_REVIEWED: 2026-06-01
+:LAST_REVIEWED: 2026-06-21
:END:
-Surfaced 2026-05-25 while diagnosing an unrelated load failure over SSH. velox-specific — the workstation has a current gptel and does not show it.
-
-At startup (and reproducibly in batch) velox logs: "Unable to activate package `gptel-magit'. Required package `gptel-0.9.8' is unavailable." gptel-magit depends on gptel >= 0.9.8 and velox's installed gptel is older or missing, so it can't activate. A startup warning, not a blocker.
-
-Reproduce:
-: emacs --batch --no-site-file -L . -L modules --eval "(package-initialize)" --eval "(message \"done\")" 2>&1 | grep -i gptel
-Next step: check the installed gptel version (=(assq 'gptel package-alist)= or =M-x package-list-packages=), update gptel to >= 0.9.8, then re-evaluate gptel-magit activation. If gptel was pinned/held on velox, reconcile the pin against the gptel-magit dependency.
+Changed from M-uppercase to M-S-lowercase for terminal compatibility.
+These may override useful defaults - review and pick better bindings:
+- M-S-b calibredb (was overriding backward-word)
+- M-S-c time-zones (was overriding capitalize-word)
+- M-S-d dwim-shell-menu (was overriding kill-word)
+- M-S-e eww (was overriding forward-sentence)
+- M-S-f fontaine (was overriding forward-word)
+- M-S-h split-below
+- M-S-i edit-indirect
+- M-S-k show-kill-ring (was overriding kill-sentence)
+- M-S-l switch-themes (was overriding downcase-word)
+- M-S-m kill-all-buffers
+- M-S-o kill-other-window
+- M-S-r elfeed
+- M-S-s window-swap
+- M-S-t toggle-split (was overriding transpose-words)
+- M-S-u winner-undo (was overriding upcase-word)
+- M-S-v split-right (was overriding scroll-down)
+- M-S-w wttrin (was overriding kill-ring-save)
+- M-S-y yank-media (was overriding yank-pop)
+- M-S-z undo-kill-buffer (was overriding zap-to-char)
** PROJECT [#C] Music Open Work
Parent grouping the open music / EMMS issues; close each child independently.
-*** VERIFY [#C] music: extract faces for music config :refactor:quick:solo:next:
+*** VERIFY [#C] music: extract faces for music config :refactor:quick:next:
Needs from Craig: this is theme-side work, not a config edit — the music-config faces were already stripped (2026-06-14), so "extracting" them means DEFINING them in the theme (theme-studio JSON / build-theme) for playlist name, status, the per-button on/off pair, per-key symbol+text, and other labels. That needs the actual color choices and which theme(s) to add them to. Give me the palette intent (or say "pick sensible defaults in WIP") and I'll add the face definitions.
Pull the music-config faces out to the theme (the config no longer defines faces directly): playlist name, status (paused, etc.), two mode colors per "button" (on vs off), a per-key symbol+text color, and a color for all other labels. Pairs with the 2026-06-14 face-stripping work (music-config faces were removed there and are currently undefined until the theme defines them). From the roam inbox 2026-06-15.
*** TODO [#C] music: show song information in the modeline :feature:
@@ -3412,577 +3774,875 @@ Restart the daemon, open a GUI frame, trigger an encrypted decrypt, confirm =pin
*** TODO [#C] Archive the original L3813 task
After this work lands, mark the original "Finish terminal GPG pinentry configuration" task DONE with a =CLOSED:= stamp and a one-line note pointing at this parent task.
-** TODO [#A] Unified popup placement and dismissal rules :feature:
-All transient popups should follow one set of principles. Placement: when the Emacs frame is wider than tall, the popup rises from the right; when square or taller, from the bottom — settle the aspect-ratio threshold and the pop-out percentage. Dismissal: C-c C-c when there's an accept action, C-c C-k when there's a cancel, otherwise =q= closes the window. This generalizes two existing tasks — ai-term adaptive placement (the aspect-ratio docking) and the messenger window/key unification spec (the C-c C-c / C-c C-k dismissal) — into one config-wide policy. From the roam inbox.
+** DOING [#C] google-keep in-editor integration — build, module-to-package :feature:
+v1 (read-only) implemented and tested (Phases 1-3): the gkeepapi Python bridge (=scripts/google-keep/keep-bridge.py=, 12 tests), the elisp core + =cj/keep-refresh= renderer with atomic writes and async make-process (=modules/google-keep-config.el=, 15 ERT tests), un-orphaned under a =C-c k= prefix, graceful warning when gkeepapi/token/auth is missing. The pure JSON-to-org core is kept extractable per the spec. Live fetch needs the one-time gkeepapi + master-token setup — see "Google Keep v1 live setup and first fetch" under Manual testing and validation.
+Next: v2 (read-write — create/edit back to Keep, with a staleness guard) per the spec, the immediate follow-on once the live read is confirmed. Later: list/checkbox rendering, package extraction.
+Spec: [[file:docs/specs/google-keep-emacs-integration-spec.org][google-keep-emacs-integration-spec.org]] (Ready, 2 review rounds; all five decisions resolved 2026-06-25).
+Offline (from the roam inbox, "pocketbook" framing): make the integration usable without network — a local cache of fetched notes for offline read, and queued writes replayed on reconnect. Folds the standalone "a Google Keep integration that works offline" idea into v2+ scope.
+** TODO [#D] Slack message buffers in a reused popup window :quick:
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-25
+:END:
+Display slack.el message and thread buffers in a dedicated popup window (side or bottom) and reuse that one window instead of spawning a new window per buffer. Likely a =display-buffer-alist= rule (or popper integration) in =modules/slack-config.el=. Status (2026-06-25): =cj/slack--display-buffer= already reuses one non-selected window; the remaining piece is a *dedicated* side/bottom window. Craig's call — keep the current reuse behavior for now and fold the dedicated-window placement into the "Unified popup and messenger UX" work (same window-placement decision should cover Slack, not be solved piecemeal here).
-** TODO [#A] Unify Signel and All Messengers into one UX :feature:
+** TODO [#D] Theme Studio nerd-icons vNext follow-ups :feature:
+Deferred from [[file:docs/specs/theme-studio-nerd-icons-colors-spec.org][theme-studio-nerd-icons-colors-spec.org]]: extend the legend to
+buffer-mode and command/symbol categories if the file set proves insufficient;
+add a "reset to nerd-icons native palette" button.
+** TODO [#D] Dashboard over-scroll: pin last line to window bottom :bug:
:PROPERTIES:
-:LAST_REVIEWED: 2026-06-16
+:LAST_REVIEWED: 2026-05-22
:END:
-Spec: [[file:docs/specs/messenger-unification-spec.org][messenger-unification-spec.org]] ([[id:4bfc2011-8ffc-4765-8886-91df12141171][by id]], Draft, 2026-06-11; keybinding-alphabet section + smoke-first parity added 2026-06-16). One library (=cj-messenger-lib.el=) gives every messenger the same shape: chat windows rise from the bottom (the signel rule, generalized), C-c C-c confirms, C-c C-k cancels, C-c C-a attaches — dispatched per backend through a registry + minor mode. Signel already conforms (reference backend); telega and slack join in phases 2-3; ERC later. All eight decisions settled 2026-06-11 (cancel closes an idle window; telega's filter-cancel shadow accepted; slack rooms join the bottom rule). Spec held open — Craig has more ideas to fold in before it's marked Ready.
+Triggered by: 2026-05-20 Dashboard buffer too long follow-up.
-** TODO [#B] agenda sources: roam Projects missing, no existence filtering :bug:solo:
-From the 2026-06 config audit, =modules/org-agenda-config.el=:
-- =:182-191= — commentary and docstrings promise org-roam nodes tagged "Project" as agenda sources, but =cj/--org-agenda-scan-files= never scans them, and files added by the roam finalize-hook are wiped on the next =cj/build-org-agenda-list= cache rebuild (≤1h). Add a roam Project pass (mirror =org-refile-config.el:101-109=) or correct the docs.
-- =:186,456= — agenda file list built unconditionally (inbox/calendars may not exist on a fresh machine) and =org-agenda-skip-unavailable-files= is unset — the exact interactive-prompt class that once hung the chime daemon. Filter with =file-exists-p= + set the var as backstop.
+After the opens-at-top fix (=4ac1b81=), the dashboard can still be
+scrolled past its content: the banner image makes the buffer just over
+one screenful, so the wheel / =C-v= / =M->= pull the last line up and
+leave empty space below it. Craig wants scrolling to stop once the
+trailing line reaches the window bottom (no void) while still allowing
+scroll-down to reach content below the window.
-** TODO [#B] Auto-dim: org headings, links, and tags do not dim in unfocused windows :bug:
-auto-dim-other-buffers-affected-faces (auto-dim-config.el) remaps font-lock and a few org faces to the flat dim face, but not org-level-1..8, org-link, or org-tag, so headings, links (seen in daily-prep.org), and tags like :solo: stay lit when the window loses focus. Decide the dim approach: a flat-dim remap like font-lock (quick) versus dedicated -dim variants surfaced through org-faces / theme-studio (richer, matches the keyword work; Craig flagged org-tags may want the org-faces treatment). Consolidates three roam-inbox captures.
-** TODO [#B] "? = curated help menu" convention across modes :feature:
-From the calibredb keybindings work 2026-06-06. The pattern that worked: in a modal/major-mode buffer (calibredb), bind =?= to a curated transient of the frequent workflows, and move the package's own full dispatch to =H=. It fixes the "I can't discover the keys" problem that which-key can't help with (which-key only pops up after a prefix, not for top-level single keys in a mode-map).
+Findings from the 2026-05-20 investigation:
+- =pixel-scroll-precision-mode= is off, so this is standard line-based
+ scroll overshoot (the tall banner image inflates the rendered height).
+- A =window-start= clamp does not work: =window-start= only lands on
+ line boundaries, so it can't express a position partway into the
+ banner image — it either blocks all scrolling or leaves the void.
+- A =recenter -1= pin on =post-command-hook= does not work: it fires on
+ every command, so it fights item navigation (the cursor can't reach
+ the projects / bookmarks / recents).
+- Right design: clamp only on actual scroll commands — advise
+ =mwheel-scroll= / =scroll-up-command= / =scroll-down-command= /
+ =end-of-buffer= to =recenter -1= when over-scrolled, never on
+ navigation commands.
+- Live experiment scratch file: =~/dashboard-overscroll-experiment.el=.
-Task: survey the modes/modules Craig works in and identify where a =?= -> curated-help-menu (transient) makes sense. Candidates: any major-mode buffer with single-key bindings and no good discovery affordance -- calibredb (done), nov, dirvish, mu4e, ghostel/term, signel, pearl/linear, ELFeed, etc. For each, note whether =?= is free or already a help dispatch, and whether a curated menu (vs the package's own) adds value. Establish it as a convention (and maybe a small helper/macro to define a curated =?= menu consistently).
+** TODO [#D] Emacs Packages — Curl-Friendly Web Service Wrappers
+Ideas for new Emacs packages following the same pattern as wttrin: HTTP GET to a simple web service, render results in a buffer, optionally show summary in the mode-line. All of these share the async fetch + caching infrastructure already proven in wttrin.
+Captured On: [2026-04-04 Sat]
+*** TODO Stock Market / Finance Package (Finnhub or Alpha Vantage)
+Build a stock watchlist and quote viewer for Emacs. User defines a list of symbols; package fetches quotes and renders a formatted table in a dedicated buffer. Optional mode-line ticker showing one or more symbols rotating on a timer.
-** TODO [#B] Dupre diff-changed / diff-refine-changed legibility :bug:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-11
-:END:
-Surfaced 2026-06-07 from a pearl session designing its modified-ticket indicator (pearl marks a changed field by inheriting =diff-changed=). dupre's =diff-refine-changed= is bright gold (#ffd700) under near-white text (#f0fef0) -- WCAG contrast ~1.35, unreadable as a plain background. It only looks fine inside diff-mode because diff-mode overlays its own dark foreground. =diff-changed= (#875f00 amber) is ~5.49, readable but off the modus model. Every modus variant keeps both faces legible (contrast 9-16) by pairing a dark low-saturation background with a hue-matched foreground.
+**** Features
+- Customizable watchlist: user defines a list of stock symbols in a defcustom; package fetches and displays all of them in a single buffer
+- Formatted quote table: symbol, company name, current price, daily change (absolute and percent), volume — color-coded green/red for gains/losses
+- ASCII sparkline charts: inline mini-charts showing intraday or multi-day price movement using Unicode block characters (▁▂▃▅▇ style)
+- Mode-line ticker: rotating display of one or more symbols with price and change indicator, similar to wttrin's weather widget — click to open the full watchlist buffer
+- Detail view: press RET on a symbol to see extended data — open/high/low/close, 52-week range, market cap, P/E ratio (data availability depends on backend)
+- Auto-refresh with market awareness: background timer fetches new data during market hours; pauses on weekends and after-hours to conserve API calls
+- Unit/currency preference: display prices in local currency if the backend supports it
+- Cache layer: same pattern as wttrin — serve cached data instantly, refresh in background, show staleness indicator when data is old
+- Interactive symbol lookup: ~M-x stock-add-symbol~ with completion against a symbol database or search endpoint
-Ask:
-1. Rework dupre's =diff-changed= and =diff-refine-changed= on modus lines: dark low-saturation background, legible foreground (plain default fg for simplicity, or hue-tinted per modus -- decide), and keep refine slightly stronger than changed (refine is the word-level emphasis inside a changed region; modus keeps them distinct).
-2. While there, audit dupre's broader diff/palette faces against modus conventions (background/foreground tinting, contrast targets) and flag where it diverges.
+**** What you'd learn
+- JSON parsing in elisp (~json-parse-buffer~, ~json-read~) — these APIs return JSON, not plain text, so this is the main new skill vs. wttrin
+- ASCII chart rendering — drawing sparklines or simple price charts with Unicode block characters in a buffer
+- API key management in elisp — storing keys in ~auth-source~ or custom variables, passing them as query params
-Reference values -- modus-vivendi: refine-changed bg #4a4a00 fg #efef80, changed bg #363300 fg #efef80. modus-operandi: refine-changed bg #fac090 fg #553d00, changed bg #ffdfa9 fg #553d00.
+**** Where the complexity lives
+- Rendering: No pre-formatted ASCII comes back from the API. You'd build the table layout and any chart visualization yourself. This is the bulk of the work.
+- Market hours awareness: Knowing when to fetch (pre-market, regular, after-hours, weekends) to avoid wasting API calls.
+- Rate limiting: Free tiers are tight. Finnhub gives 60 calls/min which is generous; Alpha Vantage gives only 25/day on the free tier. Caching strategy matters more here than in wttrin.
-Side-by-side legibility render: [[file:assets/2026-06-07-dupre-diff-face-legibility-compare.png][assets/2026-06-07-dupre-diff-face-legibility-compare.png]].
-** TODO [#B] erc-yank silently publishes >5-line pastes as public gists :bug:
-=modules/erc-config.el:345= — C-y in any ERC buffer auto-creates a public gist for anything over 5 lines: clipboard content goes to a public URL with no confirmation, and no executable-find guard for =gist= (errors mid-send if absent). Privacy trap. Add a =yes-or-no-p= gate or drop the package for plain C-y. From the 2026-06 config audit.
+**** Candidate backends
+- Finnhub (finnhub.io): Free API key, 60 calls/min, real-time US quotes. JSON only. Best rate limit of the free options.
+- Alpha Vantage (alphavantage.co): Free API key, 25 calls/day. Supports CSV output which is trivial to parse — no JSON needed. Good for daily summaries, bad for frequent polling.
+- Twelve Data (twelvedata.com): Free key, 800 calls/day, 8/min. Covers stocks, forex, crypto, ETFs. JSON and CSV.
-** TODO [#B] F7 diff-aware coverage classifies every changed file "not tracked" :bug:solo:
-=modules/coverage-core.el:252= — =cj/--coverage-intersect= joins covered×changed by exact string key, but simplecov.json keys are ABSOLUTE paths while the git-diff parser returns repo-RELATIVE ones — zero matches ever, so working-tree/staged/branch scopes report ":tracked nil" for everything and F7's main feature is inert (whole-project scope works, same-source keys). Unit tests hand-build matching keys so they pass; add one integration test feeding a real undercover report + real diff. Normalize both sides to repo-relative. From the 2026-06 config audit.
+**** Downsides
+- API key requirement adds friction for users (signup, config). Not as frictionless as wttrin.
+- Rate limits mean you can't poll aggressively. Stale data is the norm on free tiers.
+- Financial APIs change or shut down. Yahoo Finance's unofficial API has broken repeatedly over the years. Even paid services deprecate endpoints. Expect maintenance.
+- Finnhub and Alpha Vantage are US-market-centric. International coverage varies.
+
+**** Effort: Medium-High
+The fetch/cache layer is straightforward (reuse wttrin patterns). The rendering layer (tables, charts, color-coding gains/losses) is where most of the time goes. Expect this to be a real project, not a weekend hack.
+
+**** Name candidates (backronyms)
+Pick one. All are recursive (self-referential) in the style of CHIME.
+- BULL — *BULL Updates Live Listings*
+- MINT — *MINT Indexes Noteworthy Tickers*
+- QUOTE — *QUOTE Updates Ongoing Ticker Estimates*
+- ASSET — *ASSET Surfaces Stock Exchange Tickers*
+- MOAT — *MOAT Monitors Active Tickers*
+- TRADE — *TRADE Reveals Active Daily Equities*
+- BELL — *BELL Exhibits Live Listings*
+- CHART — *CHART Highlights Asset Rate Tickers*
+- BOARD — *BOARD Oversees Asset Rate Data*
+- VAULT — *VAULT Aggregates Underlying Listing Tickers*
+
+*** TODO rate.sx Wrapper — Cryptocurrency Rates
+Wrap Igor Chubin's rate.sx service. This is the lowest-effort, highest-pattern-match option — rate.sx works exactly like wttr.in. Returns colored ASCII tables with sparkline charts. Same ~User-Agent: curl~ trick, same ANSI escape codes.
+
+**** Features
+- Full crypto dashboard: ~M-x rate-sx~ opens a buffer with a colored ASCII table of top cryptocurrencies — name, price, 24h change, market cap, and sparkline charts — all rendered by the service
+- Single coin lookup: ~M-x rate-sx-coin~ prompts for a coin name (e.g., ~eth~, ~btc~) and displays its detailed view
+- Plain price fetch: query ~rate.sx/1BTC~ to get a single numeric price — useful for mode-line display or programmatic use from other elisp
+- Mode-line widget: show the price of one or more coins in the mode-line with periodic background refresh, similar to wttrin's weather indicator
+- Customizable coin list: user picks which coins appear in the dashboard via a defcustom
+- Currency base selection: rate.sx supports displaying prices in different fiat currencies
+- ANSI color rendering: reuse wttrin's ~xterm-color~ pipeline to convert the service's colored ASCII output into Emacs faces
+- Cache with background refresh: same timer-based pattern as wttrin — data stays warm, buffer opens instantly
+
+**** What you'd learn
+- Very little new — this is almost a copy of wttrin with different URL construction. Good first project if you want to validate the pattern before tackling stocks.
+- Could explore sharing infrastructure between wttrin and this package (common async fetch, caching, ANSI rendering).
+
+**** Where the complexity lives
+- Minimal. The service does the formatting. Your job is URL construction, fetch, ANSI-to-faces conversion (already solved in wttrin via ~xterm-color~), and buffer display.
+- Coin selection UX: letting users pick which coins to show, custom vs. top-N, etc.
+
+**** Downsides
+- Single point of failure: rate.sx is one person's side project. If Chubin takes it down, the package is dead. No fallback.
+- Crypto-only. No traditional stocks, forex, or commodities.
+- Less useful than a stock package for most people.
+
+**** Effort: Low
+Could reuse 70-80% of wttrin's code. A weekend project if you're focused.
+
+*** TODO Frankfurter Currency Exchange Package
+Wrap the Frankfurter API (frankfurter.dev) for fiat currency conversion and historical rates. ECB data, open source, no API key.
+
+**** Features
+- Quick conversion: ~M-x currency-convert~ prompts for amount, base currency, and target currency — displays the result in the echo area (e.g., "100 USD = 91.34 EUR")
+- Multi-target conversion table: convert one amount against several currencies at once, rendered as an aligned table in a dedicated buffer
+- Historical rate lookup: query a specific date's exchange rate — useful for expense reports, invoicing, or curiosity
+- Rate trend view: fetch a date range and display a table or ASCII sparkline showing how a currency pair moved over days/weeks/months
+- Latest rates dashboard: ~M-x currency-latest~ shows today's rates for a user-defined set of currency pairs in a buffer
+- Interactive currency selection: completing-read over the ~30 supported currencies with full names (e.g., "USD — United States Dollar")
+- Mode-line rate display: optionally show one currency pair's rate in the mode-line with daily background refresh
+- Cache layer: rates only update once per business day, so caching is especially effective — fetch once, serve all day
+
+**** What you'd learn
+- JSON parsing in elisp (the API returns JSON, not formatted text)
+- Table rendering — building aligned currency tables with ~format~ and text properties
+- Historical data display — the API supports date ranges, so you could show rate trends over time
+
+**** Where the complexity lives
+- Rendering: You'd build the table and any trend visualization yourself.
+- Date handling in elisp for historical queries (~encode-time~, ~format-time-string~, etc.).
+- UX: interactive base/target currency selection with completion.
+
+**** Downsides
+- ECB data updates once per business day. No real-time rates — this is reference data, not trading data.
+- Covers ~30 currencies (major fiats). No crypto, no exotic currencies.
+- Frankfurter is open-source and self-hostable, which is good for longevity, but the public instance could still go away.
+
+**** Effort: Low-Medium
+JSON parsing adds a step vs. wttrin's plain text, but the API is clean and well-documented. Straightforward project.
+
+*** TODO ipinfo.io — IP and Geolocation Lookup
+~curl ipinfo.io~ returns JSON with your public IP, city, region, country, ISP, and timezone. No auth needed for basic lookups (1000 requests/day unauthenticated).
+
+**** Features
+- My IP: ~M-x ipinfo~ fetches your public IP and geolocation, displays a formatted summary in a buffer or the echo area — IP, city, region, country, ISP, timezone, coordinates
+- Arbitrary IP lookup: ~M-x ipinfo-lookup~ prompts for an IP address and shows the same geolocation detail
+- Copy IP to kill ring: one-keystroke convenience for grabbing your public IP
+- Open in browser map: command to open the returned lat/long coordinates in OpenStreetMap or Google Maps via ~browse-url~
+- Hostname resolution: the API also returns the reverse DNS hostname for an IP
+- Mode-line IP display: optionally show your current public IP in the mode-line (useful when switching between networks/VPNs)
+- Org-mode integration: insert IP/geo info as an org property block or table row at point
+
+**** What you'd learn
+- Minimal new skills — simple JSON response, single fetch, render in buffer or echo area.
+- Could add map integration (open coordinates in browser or an Emacs map package).
+
+**** Where the complexity lives
+- Almost nowhere. This is the simplest possible package. Fetch JSON, format it, display it.
+- If you want to look up arbitrary IPs (not just your own), add a prompt with completion history.
+
+**** Downsides
+- Very niche utility. You look up your IP occasionally, not daily.
+- Free tier is generous (1000/day) but authenticated lookups require a token for enriched data.
+- Privacy-conscious users may not want to send their IP to a third party (though they already do by virtue of connecting).
+
+**** Effort: Very Low
+An afternoon project. Good as a learning exercise for the fetch-parse-render pattern if you haven't done JSON APIs in elisp before.
+
+*** TODO icanhazdadjoke.com — Dad Jokes in Emacs
+~curl -H "Accept: text/plain" https://icanhazdadjoke.com~ returns a single plain-text joke. No auth, no key, no rate limit concerns for casual use.
+
+**** Features
+- Random joke: ~M-x dad-joke~ fetches a random joke and displays it in the echo area — minimal disruption, maximum groan
+- Joke buffer: ~M-x dad-joke-buffer~ opens a dedicated buffer with a joke, nicely formatted with a large font face. Press ~n~ for the next joke, ~q~ to quit
+- Search jokes: ~M-x dad-joke-search~ prompts for a term (e.g., "cat") and displays matching jokes in a buffer — the API supports ~?term=~ search
+- Startup joke: optional hook to display a dad joke in the echo area or scratch buffer on Emacs startup
+- Org-mode insertion: ~M-x dad-joke-insert~ inserts a joke at point — for lightening up documentation or commit messages
+- Kill ring: ~M-x dad-joke-yank~ fetches a joke and puts it directly in the kill ring for pasting elsewhere
+
+**** What you'd learn
+- Nothing technically new — this is the simplest possible HTTP-GET-to-buffer pattern.
+- Good excuse to experiment with fun presentation: display in echo area, dedicated buffer, or even as a startup message.
+
+**** Where the complexity lives
+- It doesn't. Fetch a string, display it. The API also supports search (~?term=dog~) if you want to add that.
+
+**** Downsides
+- Toy project. Zero practical utility beyond morale.
+- The joke quality is... dad jokes.
+
+**** Effort: Trivial
+An hour, maybe two if you add search and a nice buffer layout. Publishable on MELPA as a novelty package.
+
+*** TODO qrenco.de — QR Code Generator
+Chubin's QR code service. ~curl qrenco.de/hello~ returns a QR code rendered in Unicode block characters. Encodes arbitrary text, URLs, WiFi credentials, etc.
+
+**** Features
+- Encode text: ~M-x qr-encode~ prompts for a string and displays the QR code in a dedicated buffer using Unicode block characters
+- Encode region: ~M-x qr-encode-region~ encodes the currently selected text — quick way to QR-ify a URL, password, or snippet
+- Encode URL at point: ~M-x qr-encode-url~ detects the URL under point (via ~thing-at-point~) and generates a QR code for it
+- WiFi QR codes: ~M-x qr-wifi~ prompts for SSID, password, and encryption type, then generates the standard WiFi QR format (~WIFI:T:WPA;S:MyNetwork;P:password;;~) — scan to join a network
+- Buffer font management: automatically sets the buffer to a monospace font with consistent Unicode block rendering (same approach as wttrin's Liberation Mono override)
+- Copy as text: yank the QR code's block characters to the kill ring for pasting into emails, READMEs, or chat
+- Adjustable size: the service supports size parameters — expose this as a prefix argument or defcustom
+
+**** What you'd learn
+- Handling Unicode block character output (not ANSI colors this time, but character-level rendering)
+- Interactive input patterns — prompting for text to encode, or encoding the current region/URL at point
+
+**** Where the complexity lives
+- Font and character width: QR codes require a monospace font where the block characters render at consistent widths. Some Emacs font configurations break this. You'd need to set the buffer font explicitly (like wttrin does).
+- The service sometimes returns ANSI codes for inverted colors. May need ~xterm-color~ or manual processing.
+
+**** Downsides
+- Same single-point-of-failure risk as rate.sx — one person's service.
+- QR codes in a terminal/buffer are inherently lower resolution than image-based ones. Scanning reliability depends on terminal font size and screen.
+- Niche use case. Most people generate QR codes infrequently.
+
+**** Effort: Low
+Similar to rate.sx in scope. The fetch is trivial; font handling and display are the main considerations.
+
+*** TODO dns.toys — Multi-Tool Utility via DNS
+dns.toys answers queries over DNS instead of HTTP. ~dig 100USD-EUR.fx @dns.toys~ returns currency conversion, ~dig mumbai.time @dns.toys~ returns world time, ~dig 42km-mi.unit @dns.toys~ does unit conversion. Also supports base conversion, math constants, and more.
+
+**** Features
+- Currency conversion: ~M-x dns-toys-currency~ prompts for amount and currency pair (e.g., "100 USD to EUR"), displays result in echo area
+- World time: ~M-x dns-toys-time~ prompts for a city name and shows the current local time — faster than searching online, no browser needed
+- Unit conversion: ~M-x dns-toys-unit~ prompts for a value and unit pair (e.g., "42 km to mi"), returns the conversion
+- Base conversion: ~M-x dns-toys-base~ converts between decimal, hex, octal, and binary (e.g., "100 dec to hex")
+- Math constants: ~M-x dns-toys-constant~ looks up pi, e, tau, etc. — niche but handy in a calc session
+- Unified command: ~M-x dns-toys~ with a smart prompt that detects query type from input format, dispatching to the right DNS query automatically
+- Echo area results: all results display in the echo area by default for quick non-disruptive answers, with an optional dedicated buffer for history
+- Async queries: use ~start-process~ with sentinels so ~dig~ calls don't block Emacs
+
+**** What you'd learn
+- Calling external processes from elisp (~call-process~ or ~start-process~ to invoke ~dig~) instead of ~url-retrieve~. This is a meaningfully different integration pattern from wttrin.
+- Parsing DNS TXT record output — dig returns structured but noisy output; you'd extract the answer section.
+- Building a multi-function package — this one service covers currency, time, units, and base conversion, so the UX needs a dispatch mechanism (separate commands, or a unified prompt with type detection).
+
+**** Where the complexity lives
+- Output parsing: ~dig~ output is not designed for human consumption. You'd parse the ANSWER SECTION, strip TTL/class/type fields, and extract the payload string.
+- Latency: DNS queries are fast but ~call-process~ on ~dig~ has subprocess overhead. For interactive use this is fine; for mode-line updates you'd want async (~start-process~ with a sentinel).
+- Feature breadth: The temptation is to wrap every dns.toys feature. Scoping to a focused set (currency + time + units) keeps it manageable.
+
+**** Downsides
+- Requires ~dig~ installed (standard on Linux/macOS, not on Windows). Limits portability.
+- dns.toys is a single maintainer's project. Same fragility concern as rate.sx and qrenco.de.
+- DNS protocol means no rich formatting — just short text strings. The results are useful but visually plain.
+- Some networks/firewalls block non-standard DNS queries, which would silently break the package.
+
+**** Effort: Low-Medium
+The individual queries are trivial. The interesting work is building a clean multi-function UX and handling the process-based (vs. HTTP-based) integration pattern. Good project for learning elisp process management.
+
+*** TODO cheat.sh Integration — Programming Cheat Sheets
+~curl cheat.sh/tar~ returns a syntax-highlighted cheat sheet. Supports language-specific queries like ~cheat.sh/python/lambda~. Already has some Emacs integrations (cheat-sh.el exists) but could be worth a custom implementation if existing packages don't fit your workflow.
+
+**** Features
+- Quick lookup: ~M-x cheat-sh~ prompts for a topic (e.g., "tar", "git/stash") and displays a syntax-highlighted cheat sheet in a dedicated buffer
+- Language-scoped queries: ~M-x cheat-sh-lang~ prompts for language then topic (e.g., ~python/lambda~, ~go/goroutine~) with two-stage completion
+- Context-aware lookup: detect the current buffer's major mode and scope the query to that language automatically — in a Python buffer, querying "lambda" goes to ~cheat.sh/python/lambda~
+- ANSI-to-faces rendering: convert the service's syntax-highlighted ANSI output to proper Emacs font-lock faces using ~xterm-color~ (same pipeline as wttrin)
+- Navigation: browse related topics from within the buffer — follow-up queries without returning to the minibuffer. Previous/next topic history with ~p~ / ~n~
+- Completion against the topic list: fetch and cache ~cheat.sh/:list~ to provide completing-read over all available topics
+- Offline cache: optionally cache previously viewed cheat sheets for offline access or instant re-display
+- Region query: select a command or function name and look it up directly with ~M-x cheat-sh-region~
+
+**** What you'd learn
+- ANSI syntax highlighting → Emacs faces (same skill as wttrin)
+- Deep completion support: cheat.sh has a massive topic tree. Building good interactive completion for ~cheat.sh/{language}/{topic}~ is a UX challenge.
+
+**** Where the complexity lives
+- Completion and navigation: the value is in making it fast to find the right cheat sheet. ~cheat.sh/:list~ returns thousands of entries.
+- Existing packages: ~cheat-sh.el~ already exists on MELPA. You'd need a reason to build your own (better caching, offline support, integration with your workflow).
+
+**** Downsides
+- Overlaps with existing Emacs packages. Check ~cheat-sh.el~ before building.
+- The service aggregates from many sources. Quality is inconsistent across topics.
+
+**** Effort: Medium
+If building from scratch. Low if extending or wrapping an existing package. The completion UX is where the effort goes.
+** TODO [#D] Localrepo refresh / update script :feature:
+No dedicated update path today — refreshing a pinned package means ad-hoc =cp= from the local elpa mirrors. Document the current shape and decide whether a =scripts/refresh-localrepo.sh= is worth writing. Cross-linked from =docs/design/localrepo.org=.
+
+** TODO [#D] Native-comp .eln cache strategy :feature:
+The native-comp =.eln= cache is Emacs-version-specific; an Emacs upgrade invalidates everything. Document the cache location, what an upgrade triggers, and whether a warm-the-cache script is worth shipping. Cross-linked from =docs/design/localrepo.org=.
+
+** TODO [#D] Polish reveal.js presentation setup :feature:
+
+Three small reveal.js improvements; collected into one task because each on its own is too small to track separately.
+
+1. *Image insertion helper.* Function to insert images with proper org-reveal attributes (sizing, background images, etc.) without having to remember the syntax.
+2. *Default font sizing for slide elements.* Configure reveal.js font sizes for headings, body text, code blocks, etc. — better defaults via =org-reveal-head-preamble= CSS or a custom theme.
+3. *Custom dupre reveal.js theme.* CSS theme using the colors from =themes/dupre-palette.el=. Install into =reveal.js/css/theme/= for use with =#+REVEAL_THEME: dupre=.
+
+** TODO [#D] System-tool dependency install script :feature:
+=ripgrep=, =fd=, =pandoc=, =prettier=, =pyright=, and other binaries that =cj/executable-find-or-warn= flags at module load are not in =package.el='s reach. Document the required-tool set and ship a setup script (or =pacman=/=apt= invocation set). Cross-linked from =docs/design/localrepo.org=.
-** TODO [#B] Fix up test runner :bug:
+** TODO [#D] Treesitter grammar offline cache :feature:
+Treesitter grammars are downloaded by =treesit-auto= on first use and live outside the localrepo. For true offline reproducibility, cache the grammars next to the localrepo (a =.localrepo/treesitter/= tier, or a separate mirror script). Cross-linked from =docs/design/localrepo.org=.
+
+** TODO [#C] Webm previews not rendering in dirvish :bug:solo:
+Dirvish computes a valid MD5-hashed cache path and =ffmpegthumbnailer= thumbnails the webm fine by hand, but dirvish's async cache generation never lands the jpg, so no preview shows. Root-cause the async step: trace the =(cache . CMD)= recipe dispatch and sentinel (=dirvish-shell-preview-proc-s=, =dirvish--make-proc=) to find why the generated jpg is never written or displayed.
+
+** TODO [#C] Completion category for the mu4e attachment picker :feature:solo:
+The Save-attachment picker (=mu4e-attachments.el=) has bare candidates worth a category. Add a custom category plus a table annotation-function showing each attachment's MIME type and size; confirm the mu4e part-plist keys first. Helper =cj/completion-table-annotated= is in =system-lib=.
+
+** TODO [#C] Completion categories for the file-basename pickers :feature:solo:
+Eight =completing-read= pickers list bare file basenames, so marginalia can't annotate them: chrono-tools sounds, org-drill flashcards, help-config Info files, test-runner tests, music-config files, vc-config clone dirs, plus hugo drafts and org-agenda projects. For each, either make the candidates absolute paths so the standard =file= category resolves them, or tag a custom category with a small annotator. Decide per site. Helper =cj/completion-table= is in =system-lib=.
+
+** TODO [#D] Claude Code unterminated-color bleed (upstream)
+Claude Code truncates a colored span without a reset, so the color bleeds down the EAT buffer. The newline-reset workaround (=cj/eat-reset-sgr-at-newline=) contains the streaming case but not cursor-positioned / full-screen rendering, and a full EAT-side fix would break legitimate cross-line color. The clean fix is upstream -- report it to Claude Code with a minimal repro.
+
+** TODO [#D] occur/xref font-lock coloring watch :bug:
+=occur= and =xref= enable font-lock themselves, not via =global-font-lock-mode=, so the exclusion fix does not apply and they show source-line fontification on purpose. No action unless a result ever renders with colors that do not match its source buffer, in which case investigate the real mechanism.
+
+* Emacs Someday/Maybe
+
+** TODO [#D] GPTel orphan tasks and useful ideas :feature:
:PROPERTIES:
-:LAST_REVIEWED: 2026-06-06
+:LAST_REVIEWED: 2026-06-01
:END:
-*** 2026-05-16 Sat @ 11:15:51 -0500 Ideas
-**** Current State
-=modules/test-runner.el= is a solid first pass for an Emacs-config-specific ERT
-workflow:
-- project-scoped focus lists
-- run all vs focused mode
-- run ERT test at point
-- load all test files
-- clear ERT tests from other project roots
-- keybindings under =C-; t=
-The universal test-running direction is currently split across modules:
-- =test-runner.el= owns ERT focus/state/UI.
-- =dev-fkeys.el= owns F6 language detection and command generation for Elisp,
- Python, Go, and partial TypeScript.
+On 2026-06-23 gptel was archived out of the live config (its modules,
+tools, tests, and specs moved to archive/gptel/) because it sees little
+use. This subtree was the gptel agentic-tool feature backlog. I kept it
+here in Someday/Maybe instead of deleting it: most of the child ideas
+below are agent-tool concepts that are not gptel-specific (org-roam node
+tools, git section tools, ripgrep / pandoc / ffmpeg / jq wrappers,
+messaging and buffer-state tools) and would carry over to the ai-term
+Claude agents or an MCP tool layer if that path is taken. They are
+reference, not active work.
-That split is the biggest architectural pressure point. The test runner should
-eventually own runner discovery, scopes, command construction, result handling,
-and UI. F6 should become a thin entry point into the runner.
+Categories below thematize the agent affordances the design doc
+[[file:docs/design/gptel-agentic-tool-ideas.org][gptel-agentic-tool-ideas.org]]
+points at -- Git, Org, messaging, file / buffer / workspace state,
+media, and the dev loop. The shortlist's first-batch ADOPT tools
+(git_status / git_log / git_diff / web_fetch) already shipped; the
+themes below are next-tier work where the agent treats Emacs as a
+structured workspace, not a text terminal. Per-theme spec lives in
+the task body once written; implementation tasks land as siblings
+of the spec heading once the spec is approved. The magit-backend
+reimplementation of the shipped git tools is tracked separately in
+[[id:bd47c9a8-aae1-4a3d-ad5b-b8767f2fd580][gptel-git-tools-magit-backend-spec.org]].
-**** Critical Design Issues
-***** Too ERT-specific at the core
-The current state model is named generically, but most operations assume:
-- test files live in =test/= or =tests/=
-- files match =test-*.el=
-- tests are ERT forms
-- individual tests can be selected by ERT selector regex
-- loading tests into the current Emacs process is acceptable
+*** TODO [#C] Wire Up MCP.el so That GPTel Has Access to MCP Servers via GPTel Tools
-This makes the module hard to extend cleanly to pytest, Jest, Vitest, Go, Rust,
-or shell test runners. The common abstraction should be "test run request" and
-"test runner adapter", not "ERT file list".
+**** 2026-05-16 Sat @ 15:44:36 -0500 Spec
-***** In-process ERT causes state contamination
-=cj/test-load-all= and focused runs load test files into the current Emacs
-session. This is fast and ergonomic, but it can leak:
-- global variables
-- advice
-- loaded features
-- overridden functions
-- ERT test definitions
-- load-path mutations
+Design doc: [[id:b4c274c5-8572-4a7b-b657-d315712bd6af][docs/specs/mcp-el-gptel-integration-spec-doing.org]]
-The runner should support two ERT execution modes:
-- =interactive= / in-process for fast local TDD
-- =isolated= / batch Emacs for reliable verification
+**** 2026-05-17 Sun @ 14:14:34 -0500 Landed ai-mcp.el pure-helper foundation
-The isolated path should be preferred for "before commit", CI parity, and
-agent-driven verification.
+Commit =54d231be=. Sections 1 (constants + defcustoms) and 3 (pure helpers) of the seven-section outline. 41 ERT tests, all green. Refactor audit caught two duplications during Phase 4 and folded them into the same commit (=cj/mcp--get-server-entry= and =cj/mcp--name-matches-p=). Phase 1.5 (confirmation contract) is next.
-***** Test discovery is regex-based and fragile
-=cj/test--extract-test-names= scans files with a regex for =ert-deftest=.
-That misses or mishandles:
-- macro-generated tests
-- commented forms in unusual shapes
-- multiline or reader-conditional forms
-- non-ERT Elisp tests such as Buttercup
-- stale ERT tests already loaded in the session
+**** TODO [#C] Phase 1.5 -- GPTel confirmation contract
-Better approach:
-- for ERT in isolated mode, let ERT discover tests after loading files
-- for source navigation, use syntax-aware forms where possible
-- store discovered tests as structured records with file, line, name, framework,
- tags, and runner
+*Goal:* flip =gptel-confirm-tool-calls= to ='auto= and gate the existing local tools that need it.
-***** Path containment has at least one suspicious edge
-=cj/test--do-focus-add-file= checks:
+*Entry:* Phase 1 module exists and helpers tested.
-#+begin_src elisp
-(string-prefix-p (file-truename testdir) (file-truename filepath))
-#+end_src
+*DECISION (cj):* which of the existing local tools register with =:confirm t= once ='auto= is in effect? Reads (=read_buffer=, =read_text_file=, =list_directory_files=, =git_status=, =git_log=, =git_diff=) clearly stay =:confirm nil=. Judgment calls:
+- =web_fetch= -- fetches arbitrary URLs the agent supplies. Spec recommends gating.
+- =write_text_file= -- writes any path under =$HOME= with agent-supplied content.
+- =update_text_file= -- modifies an existing file with an agent-supplied transform.
+- =move_to_trash= -- moves a path to trash (reversible but disruptive).
-That should use =cj/test--file-in-directory-p= or ensure the directory has a
-trailing slash. Otherwise sibling paths with a shared prefix are a recurring
-class of bug.
+*Deliverables:*
+- =ai-mcp.el= setup section runs =(setq gptel-confirm-tool-calls 'auto)=.
+- Remove =(setq gptel-confirm-tool-calls nil)= from =modules/ai-config.el:386= with a comment pointing at =ai-mcp.el=.
+- For each tool the decision marks "gate," add =:confirm t= to its =gptel-make-tool= form.
+- Tests in =tests/test-ai-mcp-confirm-contract.el= asserting: =gptel-confirm-tool-calls= is ='auto= after load; write-classified stub MCP tool with =:confirm t= triggers the confirm branch in =gptel-send='s dispatch (stub the prompt); read-classified MCP tool with =:confirm nil= does not; =git_log= (=:confirm nil=) still runs without prompting; each newly-gated local tool does prompt.
-***** Runner commands are shell strings too early
-=cj/--f6-test-runner-cmd-for= returns shell command strings. That makes it
-harder to:
-- inspect command parts
-- safely quote arguments
-- offer command editing
-- run via =make-process= / =compilation-start= without shell ambiguity
-- attach metadata
-- rerun exact invocations
-- convert commands into UI labels
+*Exit:* tests green. Manual smoke: open GPTel, call a gated tool, confirm prompt appears. Call =git_log=, no prompt.
-Prefer a structured command object:
+**** TODO [#B] Phase 2 -- Compat layer + registration pipeline (fake inventory)
-#+begin_src elisp
-(:program "pytest"
- :args ("tests/test_foo.py" "-q")
- :default-directory "/project/"
- :env (("PYTHONPATH" . "..."))
- :runner pytest
- :scope file)
-#+end_src
+*Goal:* implement the mcp.el compat wrappers and the tool-registration pipeline against stubbed =mcp-server-connections=.
-Render to a shell string only at the final compilation boundary.
+*Entry:* Phase 1.5 proves gptel respects per-tool =:confirm= slot.
-***** F6 and =C-; t= workflows duplicate the same domain
-F6 already handles "all tests" and "current file's tests" for multiple
-languages. =C-; t= handles ERT-only focus and run state. These should converge
-on one runner service:
-- F6: quick entry point
-- =C-; t=: full runner menu
-- both call the same scope/adapter engine
+*Deliverables:*
+- Section 4 of =ai-mcp.el= (compat layer): =cj/mcp--server-status=, =cj/mcp--server-tools=, =cj/mcp--server-name=, =cj/mcp--assert-capabilities=. Each helper documents the upstream commit / file location it targets.
+- Section 5 of =ai-mcp.el= (registration pipeline): =cj/mcp--register-tool=, =cj/mcp--register-server-tools=, =cj/mcp--deregister-server-tools=, =cj/mcp--rewrite-plist=, =cj/mcp--registered-tools= hash.
+- All MCP tools register with =:async t=.
+- Tests in =tests/test-ai-mcp-registration.el=.
-***** Test directory discovery is too narrow
-Current discovery prefers =test/= then =tests/=, with a global fallback. Real
-projects often need:
-- Python: =tests/=, package-local =test_*.py=, =pytest.ini=, =pyproject.toml=
-- JS/TS: =package.json= scripts, =vitest.config.*=, =jest.config.*=,
- =*.test.ts=, =*.spec.ts=
-- Go: package directories, =go.mod=
-- Rust: =Cargo.toml=, integration tests under =tests/=
-- Elisp packages: =Makefile=, =Eask=, =ert-runner=, Buttercup, =tests/=
+*Exit:* with a stubbed =mcp-server-connections=, registration produces correctly prefixed =mcp__SERVER__TOOL= entries in =gptel-tools=; closures call =mcp-call-tool SERVER REMOTE-NAME= (verified by stubbing =mcp-async-call-tool=); deregistration removes only MCP-owned tools and leaves a pre-populated local =git_log= entry intact; re-registration replaces function pointer without duplicating menu entries; confirm overrides win over patterns.
-Discovery should be adapter-specific and project-config-aware.
+**** TODO [#B] Phase 3 -- Async state machine + timer-race timeout wrapper
-***** No structured result model
-=cj/test-last-results= exists but is not meaningfully populated. A powerful
-runner needs a normalized result model:
-- run id
-- started/finished timestamps
-- status: passed/failed/errored/cancelled/skipped/xfail/xpass
-- command
-- runner adapter
-- scope
-- exit code
-- duration
-- failed test records
-- file/line locations
-- raw output buffer
-- coverage artifact paths
+*Goal:* implement the lifecycle state machine and the per-call timer-race timeout.
-This enables last-failed, failures-first, summaries, dashboards, and AI-assisted
-failure explanation.
+*Entry:* Phase 2 registration works against stubs.
-***** No failure parser / navigation layer
-Compilation buffers are useful, but the runner should parse common failure
-formats and provide:
-- next/previous failure
-- jump to source line
-- failure summary buffer
-- copy failure context
-- rerun failed test at point
-- annotate failing tests in source buffers
+*Deliverables:*
+- Section 6 of =ai-mcp.el= (async state machine): =cj/mcp--state=, =cj/mcp--server-status= alist, =cj/mcp--stall-timer=, =cj/mcp-ensure-started=, =cj/mcp--on-hub-callback=, =cj/mcp--poll-status=, =cj/mcp--start-stall-timer=, =cj/mcp--build-status-from-specs=.
+- =cj/mcp--wrap-async-with-timeout= (timer/callback race; both branches set =done= before invoking gptel callback so late responses are ignored).
+- Tests in =tests/test-ai-mcp-async.el=.
-Adapters can provide regexes/parsers for ERT, pytest, Jest/Vitest, Go, Rust,
-and shell.
+*Exit:* =cj/mcp-ensure-started= returns in <100 ms with delayed-callback stubs; stall timer fires for stuck servers; timer-race wrapper handles all three orderings (MCP-first, timer-first, late-MCP-after-timer); async error path (=:error-callback= without inited callback) reaches =failed= state via polling.
-***** Missing watch/rerun modes
-Modern test runners optimize the feedback loop:
-- pytest supports selecting tests, markers, last-failed, failures-first,
- stepwise, fixtures, xfail/skip, plugins, and cache state.
-- Jest/Vitest support watch workflows, changed-file selection, coverage,
- snapshots, and rich interactive filtering. Vitest also defaults to watch in
- development and run mode in CI.
-- Go and Rust runners commonly support package-level runs, regex selection,
- race/coverage flags, and cached test behavior.
+**** TODO [#B] Phase 4 -- First real connection (drawio or slack-deepsat)
-The Emacs runner should expose the subset that maps well to editor workflows:
-- current test
-- current file
-- related test file
-- focused set
-- last failed
-- failed first
-- changed since git base
-- watch current scope
-- full project
-- coverage for current scope
+*Goal:* wire one real no-auth server end-to-end against actual mcp.el and prove the stubbed Phase 3 behavior matches reality.
-**** Proposed Architecture
-***** Core Types
-Use plain plists initially; promote to =cl-defstruct= only if helpful.
+*Entry:* Phase 3 async works against stubs.
-#+begin_src elisp
-;; Test runner adapter
-(:id pytest
- :name "pytest"
- :languages (python)
- :detect cj/test-pytest-detect
- :discover cj/test-pytest-discover
- :build-command cj/test-pytest-build-command
- :parse-results cj/test-pytest-parse-results
- :capabilities (:current-test :file :project :last-failed :coverage :watch))
+*Deliverables:*
+- Add =use-package mcp= to =ai-mcp.el= (MELPA active, =:load-path= for local checkout commented).
+- =cj/mcp--assert-capabilities= called at load time; signals clearly if mcp.el is too old.
+- Set =cj/mcp-enabled-servers= temporarily to =("drawio")= (or =("slack-deepsat")= if the local proxy is running).
+- First real =cj/mcp-ensure-started= invocation from =cj/toggle-gptel=.
-;; Test run request
-(:project-root "/repo/"
- :language python
- :framework pytest
- :scope file
- :file "/repo/tests/test_api.py"
- :test-name "test_create_user"
- :extra-args ("-q")
- :profile default)
+*Exit:* manual smoke -- =C-; a t= opens GPTel without blocking; within 30 s, drawio (or slack-deepsat) tools appear in =gptel-menu= grouped by category; calling a tool returns expected output; killing the subprocess externally surfaces as =failed= in =cj/mcp--server-status=.
-;; Test run result
-(:run-id "..."
- :status failed
- :exit-code 1
- :duration 2.14
- :failures (...)
- :output-buffer "*test pytest*"
- :artifacts (...))
-#+end_src
+**** TODO [#B] Phase 5 -- Status UX + commands + doctor (static)
-***** Adapter Registry
-Create a registry like:
+*Goal:* ship the full server-management UX so partial-availability and failures are visible.
-#+begin_src elisp
-(defvar cj/test-runner-adapters nil)
-(cj/test-register-adapter 'pytest ...)
-(cj/test-register-adapter 'ert ...)
-(cj/test-register-adapter 'vitest ...)
-#+end_src
+*Entry:* Phase 4 proves a real connection works.
-Runner selection should consider:
-- buffer file extension
-- project files
-- explicit user override
-- available executables
-- package manager scripts
-- existing Makefile targets
+*Deliverables:*
+- Section 7 of =ai-mcp.el= (UI).
+- Commands: =cj/mcp-status= (echo-area summary keyed off =cj/mcp--state=), =cj/mcp-list-tools= (tabulated buffer with failed servers at top in red face; keys =g r c RET q=), =cj/mcp-doctor= (static mode only -- capability, =npx=/=uvx=, Claude config, per-server env, local endpoints; output buffer keys =c r q=), =cj/mcp-wait-until-ready=, =cj/mcp-hub= (thin wrapper that ensures startup first), =cj/mcp-restart-failed=, =cj/mcp-restart-server=, =cj/mcp-stop-all=.
+- Keymap: =C-; a C= subprefix bound in =ai-config.el='s autoload section. Keys =h s l r R S d w=.
+- which-key labels for every binding.
+- =kill-emacs-hook= registration for =cj/mcp-stop-all=.
+- Investigation: does =gptel-menu= refresh after mid-call tool registration? Document the answer in =ai-mcp.el= commentary; if it requires close+reopen, add to known UX caveats.
-***** Scope Model
-Make scopes explicit and shared across languages:
-- =test-at-point=
-- =current-file=
-- =related-file=
-- =focused-files=
-- =last-failed=
-- =changed=
-- =package/module=
-- =project=
-- =coverage=
-- =watch=
+*Exit:* all keymap bindings work; audit buffer surfaces failed servers prominently; doctor identifies each scenario in the manual test matrix; status command shows the right state for each phase transition.
-Each adapter can say which scopes it supports. Unsupported scopes should produce
-clear user-errors with suggestions.
+**** TODO [#B] Phase 6 -- HTTP servers (linear, notion)
-***** Command Builder Pipeline
-1. Detect project.
-2. Detect language/framework candidates.
-3. Resolve user-requested scope.
-4. Build structured command object.
-5. Optionally let user edit command.
-6. Run via =compilation-start= or =make-process=.
-7. Parse output/result artifacts.
-8. Store normalized result.
-9. Update UI/modeline/messages/failure buffer.
+*Goal:* add the two HTTP-transport servers with in-protocol OAuth.
-***** Keep Makefile Support But Do Not Require It
-For this Emacs config, =make test-file= and =make test-name= are useful and
-should remain the default Elisp isolated path. But adapter detection should
-support:
-- direct =emacs --batch= ERT invocation
-- =make test=
-- =make test-file=
-- =make test-name=
-- Eask
-- Buttercup
+*Entry:* Phase 5 UX shipped.
-**** Elisp-Specific Improvements
-***** Add isolated ERT runs
-Support batch commands for:
-- all project tests
-- one test file
-- one test name
-- focused files
-- last failed, once result parsing exists
+*Deliverables:*
+- Add =linear= and =notion= back to =cj/mcp-enabled-servers=.
+- Doctor gains live-auth-check mode (=C-u C-; a C d=): invokes a single safe read per auth class to verify OAuth tokens haven't silently expired. Static checks first; live probe only fires after static passes.
+- OAuth recovery pattern matcher surfaces auth URLs in =cj/mcp-status= on first connect.
-Use the same Makefile targets in this repo, but design the adapter so other
-Elisp projects can run without this Makefile.
+*Exit:* first connect surfaces the OAuth URL through the recovery pattern; after browser handshake completes, subsequent connects succeed without prompt; live-auth-check correctly identifies a deliberately revoked token; both servers appear ready in the audit buffer.
-***** Support Buttercup/Eask Later
-Buttercup uses BDD-style =describe= / =it= suites and is common in Elisp
-package testing. Eask is often used to run package tests. Add adapter slots
-for these instead of hard-coding ERT forever.
+**** TODO [#B] Phase 7 -- Env-dependent stdio servers (figma, google-*)
-***** Avoid unnecessary global ERT deletion
-=cj/ert-clear-tests= is a pragmatic fix for project contamination, but the
-stronger long-term answer is isolated runs plus project-scoped discovery. Keep
-the cleanup command, but do not make correctness depend on deleting global ERT
-state.
+*Goal:* add the remaining five env-dependent servers.
-**** Python / pytest Ideas
-- Detect pytest by =pyproject.toml=, =pytest.ini=, =tox.ini=, =setup.cfg=, or
- presence of =tests/=.
-- Build commands for:
- - project: =pytest=
- - file: =pytest path/to/test_file.py=
- - test at point: =pytest path/to/test_file.py::test_name=
- - class method: =pytest path::TestClass::test_method=
- - marker: =pytest -m marker=
- - last failed: =pytest --lf=
- - failed first: =pytest --ff=
- - stop after first: =pytest -x=
- - coverage: =pytest --cov=...=
-- Parse output for failing node ids and =file:line= references.
-- Read pytest cache for last-failed where useful.
-- Offer marker completion by parsing =pytest --markers= or config files.
-- Surface xfail/skip separately from hard failures.
+*Entry:* Phase 6 HTTP servers connect cleanly.
-**** TypeScript / JavaScript Ideas
-***** Detection
-Detect runner by project files and scripts:
-- =vitest.config.ts/js/mts/mjs=
-- =jest.config.ts/js/mjs/cjs=
-- =package.json= scripts: =test=, =test:watch=, =vitest=, =jest=
-- lockfile/package manager: =pnpm-lock.yaml=, =yarn.lock=, =package-lock.json=,
- =bun.lockb=
+*Deliverables:*
+- Add =figma=, =google-calendar=, =google-docs-personal=, =google-docs-work=, =google-keep= to =cj/mcp-enabled-servers=.
+- Verify env-merge from =~/.claude.json= for each (the mtime-cached reader from Phase 1).
+- Verify figma's =:secret-args= splicing places the API key correctly without echoing it.
+- Manual smoke: simulate token expiry on one Google server; recovery message points at "re-auth via Claude Code, then C-; a C r SERVER".
-Prefer project scripts over raw =npx= when present:
-- =pnpm test -- path=
-- =npm test -- path=
-- =yarn test path=
-- =bun test path=
+*Exit:* all 9 servers reach =ready= state on a clean machine. Sentinel-grep check across status / audit / hub / errors / audit-log shows zero secret leakage. Doctor's live-auth covers each auth class (oauth, token, args-token, in-protocol, local, none).
-***** Scopes
-- current file: =vitest run path= or =jest path=
-- test at point: use nearest =it= / =test= / =describe= string and pass =-t=
-- watch current file
-- changed tests where runner supports it
-- coverage current file/project
-- update snapshots
+**** TODO [#B] Phase 8 -- Privacy + audit polish
-***** Result Parsing
-Parse:
-- failing test names
-- file paths and line numbers
-- snapshot failures
-- coverage summary
+*Goal:* land the final UX polish and documentation.
-Treat snapshot updates as an explicit command, not an automatic side effect.
+*Entry:* all 9 servers working.
-**** Go Ideas
-- Detect =go.mod=.
-- Current file/source: run package =go test ./pkg=.
-- Test at point: nearest =func TestXxx= and run =go test ./pkg -run '^TestXxx$'=.
-- Bench at point: nearest =BenchmarkXxx= and run =go test -bench '^BenchmarkXxx$'=.
-- Add toggles for =-race=, =-cover=, =-count=1=, =-v=.
-- Parse =file.go:line:= output and package failure summaries.
+*Deliverables:*
+- Audit buffer privacy header: "Tool results land in =gptel-tools= responses; saved conversations persist them. Use =cj/gptel-autosave-toggle= per buffer to opt out."
+- =cj/mcp-tool-audit-log-enabled= defcustom + log writer (=~/.emacs.d/data/mcp-tool-log/YYYY-MM-DD.log= -- metadata only, one line per call, daily rotation).
+- =ai-mcp.el= commentary updated with the code-organization outline as a table of contents.
+- Final pass on tests covering saved-conversation behavior (autosave persists MCP tool results; toggling off prevents persistence).
-**** Rust Ideas
-- Detect =Cargo.toml=.
-- Use =cargo test= by default, optionally =cargo nextest run= when available.
-- Current test at point: nearest =#[test]= function.
-- Current file/module where possible.
-- Integration test file: =cargo test --test name=.
-- Support =-- --nocapture= toggle.
-- Parse compiler/test failures and =file:line= links.
+*Exit:* all 10 acceptance criteria from the spec pass. Manual matrix run end-to-end on a fresh Emacs. Working tree clean.
-**** Shell / Generic Ideas
-- Adapter for Makefile targets:
- - detect =make test=, =make check=, =make coverage=
- - expose project-level commands even when language-specific detection fails
-- Adapter for arbitrary project command configured in dir-locals or a project
- config plist.
-- Let users register custom command templates per project:
+*** TODO [#C] Wrap the gh CLI as a GPTel tool
-#+begin_src elisp
-((:name "unit"
- :command ("npm" "run" "test:unit" "--" "{file}"))
- (:name "integration"
- :command ("pytest" "tests/integration" "-q")))
-#+end_src
+**** 2026-05-16 Sat @ 16:20:00 -0500 Spec
-**** UI Ideas
-***** Transient Menu
-Replace or complement the raw keymap with a =transient= menu:
-- scope: current test/file/focused/last failed/project
-- runner: auto/ert/pytest/vitest/jest/go/cargo/make
-- toggles: watch, coverage, debug, fail-fast, verbose, update snapshots
-- actions: run, rerun, edit command, show failures, open report
+Design doc: [[id:a124dd0f-1f40-4533-aeb8-595d93e20865][docs/specs/gptel-gh-tool-spec.org]]
-***** Result Buffer
-Create a normalized =*Test Results*= buffer:
-- latest status per project
-- command and duration
-- pass/fail/skip counts
-- failure list with clickable =file:line=
-- actions to rerun failed/current/all
-- links to coverage artifacts
+*** TODO [#C] GPTel should autosave regularly after a conversation is saved
+*** TODO [#B] Org Workflow Related Tools
-***** Modeline / Headerline Signal
-Show the last run status for the current project:
-- green passed
-- red failed
-- yellow running
-- gray no run
+Affordances that expose the Org workspace -- agenda state, capture
+targets, org-roam nodes and backlinks, dailies, drill review state --
+to the agent as structured context, not raw .org buffer text.
-Keep it quiet and optional.
+**** TODO [#B] Agenda state tools :feature:
-***** History
-Store recent run requests per project:
-- rerun last
-- rerun last failed
-- choose previous command
-- compare duration/status against previous run
+Read scheduled / deadline / waiting tasks for a date range; query by
+tag, priority, or TODO keyword; list what's blocking today. Lets the
+agent answer "what's on the critical path this week" without me
+pasting agenda output, and feeds the daily-prep / wrap-up workflows.
-**** Configuration Ideas
-- =cj/test-runner-default-scope=
-- =cj/test-runner-prefer-isolated-elisp=
-- =cj/test-runner-project-overrides=
-- =cj/test-runner-known-adapters=
-- =cj/test-runner-enable-watch=
-- =cj/test-runner-result-retention=
-- per-project override through =.dir-locals.el=
+**** TODO [#B] Org-roam node tools :feature:
-Example:
+Resolve a topic to its node; return body + backlinks; list nodes by
+tag; surface dailies for a date range. Lets the agent reason over
+the personal knowledge graph and write back into it via the capture
+tools below.
-#+begin_src elisp
-((nil . ((cj/test-runner-project-overrides
- . (:adapter pytest
- :default-args ("-q")
- :coverage-args ("--cov=src"))))))
-#+end_src
+**** TODO [#B] Capture creation tools :feature:
-**** Safety And Robustness
-- Use structured commands until the final boundary.
-- Quote only at render time.
-- Avoid shell when =make-process= / =process-file= is sufficient.
-- Keep command preview/editing available for surprising cases.
-- Detect missing executables before running.
-- Add timeouts/cancel commands for long-running or hung tests.
-- Do not silently fall back from a missing runner to a different runner unless
- the fallback is visible in the command preview.
-- Avoid mutating global =load-path= permanently.
-- Keep remote/TRAMP behavior explicit; do not accidentally run local commands
- for remote projects.
+Drive =org-capture= from a template key + body string. Lets the
+agent file inbox items, reading notes, journal entries, or roam
+nodes without me leaving the chat. Tight pairing with the
+=cj/org-capture= optimization task in todo.org.
-**** Coverage Integration
-Tie this into the existing coverage work:
-- run coverage for current file/scope
-- open latest coverage report
-- summarize uncovered lines for current file
-- support Elisp SimpleCov/Undercover, pytest-cov, Vitest coverage, Go cover,
- and Rust coverage later
-- store coverage artifact paths in the normalized run result
+**** TODO [#B] Org-drill review tools :feature:
-**** AI-Assisted Debugging Ideas
-- Summarize failing tests from the parsed failure records and raw output.
-- Include command, changed files, failure snippets, and relevant source/test
- locations.
-- Redact env vars, tokens, Authorization headers, and secrets before sending to
- =gptel=.
-- Add commands:
- - =cj/test-runner-explain-failure=
- - =cj/test-runner-suggest-related-tests=
- - =cj/test-runner-summarize-coverage-gap=
+Surface next-due drill cards in =drill-dir=; let the agent quiz on a
+topic and report performance. Useful for prompted recall sessions
+("ask me five medical-Spanish cards") and for "did this card stick"
+analysis.
-**** Migration Plan
-***** Phase 1: Internal cleanup
-- Fix the task typo and rename current ERT-specific functions or wrap them under
- an ERT adapter.
-- Move F6 language detection/command construction from =dev-fkeys.el= into
- =test-runner.el= or a new =test-runner-core.el=.
-- Replace shell-string command builders with structured command plists.
-- Fix path containment in =cj/test--do-focus-add-file=.
-- Make =cj/test-last-results= real for ERT runs.
+*** TODO [#B] Git Related Tools
-***** Phase 2: ERT adapter
-- Implement adapter registry.
-- Add ERT adapter with in-process and isolated modes.
-- Preserve all current keybindings by routing them through the adapter.
-- Add failure/result normalization for ERT.
-- Add "rerun last" and "rerun failed" for ERT.
+Affordances that expose magit's structured view of a repo -- sections,
+staged-vs-unstaged, commit metadata, rebase / conflict state -- as
+first-class tools rather than asking the model to reason over raw
+diff text.
-***** Phase 3: Python and JS/TS adapters
-- Add pytest adapter.
-- Add Vitest/Jest adapter with package-manager/script detection.
-- Support current file and test-at-point for both.
-- Add parser/navigation for common failures.
+**** TODO [#B] Section-aware git tools :feature:
-***** Phase 4: UI and watch modes
-- Add transient menu.
-- Add result buffer.
-- Add cancellation and rerun history.
-- Add watch commands where supported.
+Expose Magit sections as first-class GPTel tools: current section type,
+heading, file, hunk range, and content; sibling sections under the same
+file; staged / unstaged / untracked status; commit metadata around the
+selected commit or branch; the exact staged patch that would be
+committed. Lets prompts say "review the file section at point" or
+"explain this hunk in the context of adjacent hunks" without manual
+context-copying.
-***** Phase 5: Coverage and AI
-- Connect coverage commands to adapter capabilities.
-- Add failure summarization with redaction.
-- Add coverage-gap summarization.
+**** TODO [#B] Commit intent workbench :feature:
-**** Acceptance Criteria For First Fix-Up Pass
-- Existing ERT workflow still works.
-- F6 and =C-; t= use the same underlying runner API.
-- Current-file test command generation is covered for Elisp, Python, Go,
- TypeScript, and JavaScript.
-- At least one isolated ERT command path exists.
-- Path containment checks are robust against sibling-prefix paths and symlinks.
-- Runner requests and results are represented as data, not only messages.
-- Missing runner/tool errors are clear and actionable.
-- Tests cover adapter detection, command building, scope resolution, result
- storage, and key interactive paths.
+Transient that builds a commit intentionally:
+1. Agent reads unstaged + staged changes.
+2. Agent proposes coherent commit groups.
+3. User selects groups in a Magit-style buffer.
+4. Agent stages those paths or hunks only after confirmation.
+5. Agent generates a message reflecting the selected intent.
-** TODO [#B] jumper: register collisions and dead-marker errors :bug:solo:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-13
-:END:
-Two related defects from the 2026-06 config audit:
-- =modules/jumper.el:155= — removal shifts the vector without renumbering registers, so a later store allocates a register still held by a surviving location and silently overwrites it. Allocate the first free register char in the live slice; =set-register nil= on removal so freed markers don't pin buffers.
-- =modules/jumper.el:117,132= — guards check =(markerp marker)= but not =(buffer-live-p (marker-buffer marker))=; after killing a buffer holding a location, M-SPC SPC and M-SPC j signal wrong-type errors. Treat dead entries as skippable/removable.
-Also =jumper.el:178= — the promised single-location toggle never toggles back ('already-there branch should =jump-to-register= z when set).
+Addresses the common case of two or three unrelated edits in one
+working tree -- a single commit-message generator can't handle that
+cleanly.
+
+**** TODO [#B] Patch narrative buffer :feature:
+
+Generate an Org buffer that explains a change set as a reviewable
+narrative:
+- "What changed" by subsystem.
+- "Why it appears to have changed" inferred from names, tests, and docs.
+- "Risk areas" with links back to Magit file sections.
+- "Suggested verification" using local Makefile targets when present.
+
+Reusable artifact: paste into a PR description, save with an AI
+session, or file into org-roam.
+
+**** TODO [#B] Review-thread simulator :feature:
+
+Before opening a PR, create a local review buffer with inline comments
+attached to Magit diff positions. The agent writes comments as if
+reviewing someone else's patch:
+- Comments grouped by severity.
+- Each comment links to file and line.
+- Resolved comments check off in Org.
+- Accepted suggestions apply through the existing text-update tools.
+
+Makes "review my diff" less ephemeral and avoids losing useful findings
+inside a chat transcript.
+
+**** TODO [#B] Rebase and conflict coach :feature:
+
+When Magit enters a rebase, cherry-pick, merge, or conflict state,
+expose an agent command that reads:
+- Git operation state from =.git/=.
+- Conflict markers in the worktree.
+- Relevant commits from =git log --merge= or the rebase todo.
+- The current Magit status sections.
+
+The agent explains the conflict in domain terms and proposes a
+resolution patch; the actual edit and =git add= stay under explicit
+user control.
+
+**** TODO [#B] Regression archaeology :feature:
+
+Magit transient that runs a bisect-like reasoning workflow:
+- Ask for a symptom and a known-good / known-bad range.
+- Summarize candidate commits in small batches.
+- Use tests or user-provided repro commands when available.
+- Maintain a bisect journal in an Org buffer.
+
+Even when the agent can't run the whole bisect, it keeps the
+investigation structured and preserves why each commit was judged
+good or bad.
+
+**** TODO [#B] Messaging Related Tools
+
+Affordances over mu4e, Slack, Telegram, and ERC. Same shape across
+protocols: read recent threads, search by sender / topic, compose a
+draft from a prompt + thread context, leave the send under explicit
+user control.
+
+***** TODO [#B] Mu4e thread and compose tools :feature:
+
+Read the message at point and surrounding thread (with attachments
+summarized); query the inbox by =from:= / =subject:= / date range;
+compose a draft from a prompt + thread context using =org-msg=.
+Pairs with the existing =mu4e-org-contacts-integration.el=.
+
+***** TODO [#B] Slack thread and compose tools :feature:
+
+Read channel / DM / thread history through =emacs-slack=; search by
+user or channel; compose a draft message but leave sending to me.
+Mirrors the mu4e shape so the agent's interface is uniform across
+messaging protocols.
+
+***** TODO [#B] Telegram and IRC read tools :feature:
+
+Same shape as Slack for =telega= (Telegram) and =erc= (IRC):
+recent-message reads, search, and draft compose. Bundled because
+the API shape is identical even if the underlying clients differ.
+
+***** TODO [#B] Contact resolution tools :feature:
+
+Resolve a name to email / Slack ID / Telegram handle via
+=org-contacts= and the configured address books. Removes the
+"who's this person again" friction from the compose flows above.
+
+**** TODO [#B] File and Buffer Related Tools
+
+Affordances that expose the user's actual workspace -- open buffers,
+narrowed regions, marked files, vterm / eshell sessions -- as
+structured context. Stops the model from asking "what file are you
+looking at" or "what region is selected."
+
+***** TODO [#B] Buffer state tools :feature:
+
+List visible buffers with major-mode + file (when any); read the
+narrowed region instead of the whole buffer; report point + mark
+positions and the active region's text. The single most-asked
+question between turns becomes a tool call.
+
+***** TODO [#B] Dirvish / Dired tools :feature:
+
+Read marked files, sort state, and filter state from a Dired or
+Dirvish buffer. Lets the agent operate on "the files I just marked"
+rather than "files in this directory" -- a real distinction in any
+review or refactor workflow.
+
+***** TODO [#B] Vterm session tools :feature:
+
+Recent command output from a named vterm session; scroll-history
+search. Pairs naturally with the =ai-vterm= design: the agent
+running in one project's vterm can read another project's vterm
+without leaving the chat.
+
+***** TODO [#B] Eshell session tools :feature:
-** TODO [#B] Keymap consolidation — resolve decisions, run Phase 1-2 :feature:refactor:solo:
+Same shape as the vterm tools for =eshell= sessions -- last-command
+output, history search, current directory. Most useful for
+agent-driven inspection of long-running pipelines.
+
+**** TODO [#B] Filesystem Related Tools
+
+Affordances that let the agent operate on actual files on disk and
+run common CLI utilities -- pandoc, ffmpeg, imagemagick, ripgrep,
+fd, jq -- rather than relying on me to paste content or run
+commands by hand.
+
+*Design tension to resolve before any of these ship: one tool per
+utility, or one generic =run_shell_command=?*
+
+The shortlist's first pass DEFERRED a generic =run_shell_command=:
+sandboxing to HOME + /tmp with a denylist for destructive ops is
+straightforward, but the denylist can never be exhaustive, and
+"confirmation for everything else" becomes click-fatigue.
+
+The children below take the other path -- *one gptel tool per
+binary*, with a strictly-typed argv shape (e.g.
+=pandoc_convert(input_path, output_format)=, not
+=pandoc_convert(args_string)=). Each tool:
+
+- Validates its own paths (must be under HOME, outputs in a
+ sandboxed dir).
+- Rejects dangerous flags explicitly (pandoc =--filter=, ffmpeg's
+ =-protocol_whitelist= chicanery, imagemagick's policy bypasses).
+- Runs via =call-process= with an argv list -- no shell parsing,
+ no string-interpolation injection.
+- Caps output and reports truncation inline.
+
+The trade-off is breadth: every new CLI tool means a new gptel tool
+file. Acceptable because (a) the list of utilities I actually need
+agent access to is small (~8 below covers most of it), and (b) each
+wrapper gets type-checked argv and a focused description the model
+can reason over, which is genuinely better than a free-form
+=run_shell_command(string)=.
+
+The =eshell_submit= entry at the end is the escape hatch for one-
+off needs the wrappers don't cover -- =:confirm t= always.
+
+Adjacent categories: the existing =gptel-tools/= file CRUD
+(=read_text_file=, =write_text_file=, =update_text_file=,
+=list_directory_files=, =move_to_trash=) is the foundation this
+category extends. =web_fetch= is the network-fetch counterpart.
+
+***** TODO [#B] Document conversion (pandoc) :feature:
+
+Convert between markdown, org, html, pdf, docx, latex, epub, plain
+text. Most common use: "extract this docx to markdown so I can
+read it inline." Strict argv: input path, output format, optional
+output path. Reject =--filter= and =--lua-filter= (arbitrary code
+execution). Output written to a sandbox dir unless explicit
+override.
+
+***** TODO [#B] Image manipulation (imagemagick) :feature:
+
+Resize, format-convert, get-metadata (=identify=), optionally crop /
+rotate / annotate. Common use: "resize this PNG to a thumbnail" or
+"convert these HEICs to JPEGs." Strict argv per operation.
+Reject pre-validated dangerous formats (the historical EXR / SVG /
+MVG CVE surface) unless explicitly enabled. ImageMagick's
+=policy.xml= is the underlying defense; the wrapper enforces it at
+the tool boundary too.
+
+***** TODO [#B] Audio / video processing (ffmpeg) :feature:
+
+Trim, transcode, extract audio, get-metadata (=ffprobe=). Paths
+under HOME only; reject network-protocol inputs (=http:= / =rtmp:=
+/ =rtsp:=) so the model can't pull from arbitrary sources. Pairs
+with the existing transcription module -- the same "extract audio
+from video" path =cj/transcribe-media= uses internally.
+
+***** TODO [#B] Content search (ripgrep) :feature:
+
+=rg= wrapper with path / glob filtering, result-count cap, optional
+literal-vs-regex mode. Pure read. Was in the shortlist's ADOPT
+bucket as =search_in_files=. Highest-leverage filesystem tool by
+expected call frequency -- "where in this repo is X" is the
+question I paste agent output for most often.
+
+***** TODO [#B] File discovery (fd) :feature:
+
+=fd= (or =find= fallback) wrapper, capped result count. Pure
+read, lower stakes than =search_in_files= (filenames only, no
+content). Common pairing: =find_file_by_name= then
+=read_text_file=.
+
+***** TODO [#B] Metadata extraction (file / exiftool) :feature:
+
+=file= for MIME-type detection; =exiftool= for image / video /
+audio metadata. Lets the agent answer "what is this file" or
+"when was this photo taken" without me opening external tools.
+Pure read.
+
+***** TODO [#B] Structured data processing (jq / yq) :feature:
+
+=jq= for JSON, =yq= for YAML / TOML. Filter / project / transform
+structured data into a smaller, more focused view before reading.
+Strictly read-only -- output goes to the chat, not to disk. The
+agent often wants "the third element of .results" from a JSON file
+and this is much cheaper than pasting the whole thing.
+
+***** TODO [#B] Eshell command submission :feature:
+
+Submit a single eshell command line, return output (capped).
+=:confirm t= always -- this is the escape hatch where the
+strictly-typed wrappers above don't fit, so each invocation needs
+my eyeball. Eshell parses in-process (no /bin/sh fork) so the
+security surface is narrower than a shell command runner, but it's
+still effectively arbitrary execution -- treat it as such.
+
+**** TODO [#B] Media and Reading Related Tools
+
+Affordances over non-code content: feeds, PDFs, EPUBs, music. The
+agent's job here is summarize / extract / queue, not produce.
+
+***** TODO [#B] Elfeed entry tools :feature:
+
+Read entry body; list unread by feed or tag; mark read after a
+summary lands in a roam node or inbox. Enables "give me the
+non-noise headlines from this week's feeds" flows.
+
+***** TODO [#B] PDF and EPUB text tools :feature:
+
+Extract plain text from a PDF page or page range (via =pdftotext=)
+and from an EPUB (via the existing nov-mode pipeline). Lets the
+agent summarize / quote a research paper or book chapter without
+me pasting passages.
+
+***** TODO [#B] EMMS playback and queue tools :feature:
+
+Current track, queue contents, playback state; queue or play a
+path; compose a playlist from a prompt ("play something focusing
+that's not Nick Cave"). Light tools, but a frequent friction
+point.
+
+**** TODO [#B] Development Workflow Related Tools
+
+Affordances over the dev loop: compilation output, test invocation,
+coverage / profile data, flycheck / flymake diagnostics.
+
+***** TODO [#B] Compilation buffer tools :feature:
+
+Read the most recent =compile= buffer output; parse error locations
+to =file:line=; summarize what broke. Pairs with the F6 test-runner
+flow -- "tell me what's failing" becomes a single agent turn
+instead of paste + parse.
+
+***** TODO [#B] Project test invocation tools :feature:
+
+Run =make test-file FILE=X= / =make test-name TEST=Y= /
+project-equivalent and return results. Currently each agent guesses
+the project convention; expose the canonical invocation explicitly
+per project so the agent can run focused tests itself.
+
+***** TODO [#B] Coverage and profile tools :feature:
+
+Read the most recent SimpleCov JSON or profile dump. Lets the
+agent answer "what's still uncovered after this push" or "what
+function dominates startup time" against real measured data.
+
+***** TODO [#B] Diagnostic tools (flycheck / flymake) :feature:
+
+Surface current-buffer or project-wide errors and warnings. Useful
+both as a "what's broken right now" check and as input to the
+patch-narrative buffer / commit-intent workbench above.
+
+**** CANCELLED [#B] gptel-magit activation fails on velox :bug:quick:
:PROPERTIES:
-:LAST_REVIEWED: 2026-06-13
+:LAST_REVIEWED: 2026-06-01
:END:
-Spec: [[id:540bf06b-16b8-46c6-b459-c40d1b9c795d][keybinding-console-safety-spec-doing.org]]. Phase 0 (revert 4a1ecf64) is done and pushed. Decisions D1-D5 are open TODOs in the spec; D2/D4/D5 gate the primary work (Phase 1 prune via Appendix D, Phase 2 consolidate + retire the translation block), while D1/D3 (the console-safe prefix) gate only the optional Phase 3 and can stay open indefinitely. Resolve D2/D4/D5, then run Phase 1-2. Appendix D is the keybinding pruning checklist. Add a =#+TODO: TODO | DONE SUPERSEDED CANCELLED= header line to the spec if adopting those decision keywords (rulesets convention update, 2026-06-12).
+Surfaced 2026-05-25 while diagnosing an unrelated load failure over SSH. velox-specific — the workstation has a current gptel and does not show it.
+
+At startup (and reproducibly in batch) velox logs: "Unable to activate package `gptel-magit'. Required package `gptel-0.9.8' is unavailable." gptel-magit depends on gptel >= 0.9.8 and velox's installed gptel is older or missing, so it can't activate. A startup warning, not a blocker.
+
+Reproduce:
+: emacs --batch --no-site-file -L . -L modules --eval "(package-initialize)" --eval "(message \"done\")" 2>&1 | grep -i gptel
+
+Next step: check the installed gptel version (=(assq 'gptel package-alist)= or =M-x package-list-packages=), update gptel to >= 0.9.8, then re-evaluate gptel-magit activation. If gptel was pinned/held on velox, reconcile the pin against the gptel-magit dependency.
-** TODO [#B] ledger-config is orphaned — ledger-mode never configured :bug:quick:
-Nothing requires =modules/ledger-config.el= (verified by grep), so .dat/.ledger/.journal open without ledger-mode, reports, or flycheck-ledger. The module looks finished, not staged (unlike duet-config, which documents its pre-alpha orphaning). Decide: wire into init.el (+ =cj/executable-find-or-warn= for the ledger binary) or delete. From the 2026-06 config audit.
-** TODO [#C] buffer-differs save prompt: 4-way yes/no/diff/cancel :feature:next:
-The "buffer differs from file" confirmation currently gives only yes/no. Craig wants a 4-way choice with explicit consequences: yes (be explicit it overwrites), no (be explicit it discards this action and continues), diff (show a graphical difftastic diff, then return to this prompt), cancel (stop the action, leave the buffer untouched). Needs the exact prompt identified first (which save/overwrite path raises "buffer differs") and a design for the diff-then-return loop. difftastic + cj/diff-buffer-with-file infrastructure already exist. From the roam inbox 2026-06-16.
-** TODO [#C] emacs: tag tasks by module name for sorting :refactor:studio:
-Replace topic tagging with single-word module tags: :studio: for everything under scripts/theme-studio/, module-named tags elsewhere, :multi: for cross-area work. Drop bug/enhancement-style tags since work should be chosen on other bases. This changes the current six-tag convention, so update the priority-scheme section to document it, rewrite the task-audit workflow to reconcile tasks against the module scheme, then run the audit. Queue for end of session. From the roam inbox.
** TODO [#C] Build an Org-native API workspace :feature:test:
:PROPERTIES:
-:LAST_REVIEWED: 2026-06-02
+:LAST_REVIEWED: 2026-06-21
:END:
+Moved to Someday/Maybe on 2026-06-23 when gptel was archived. This
+design used gptel for its AI-assisted parts (restclient-ai.el, API
+summaries, the AI-debugging ideas); with gptel archived those modules
+are orphaned. The non-AI parts (OpenAPI import, request execution,
+response capture) still stand on their own, so I shelved the whole design
+here rather than dropping it. Pull it back to Open Work if the non-AI
+core is worth building.
+
Build an Emacs-native API workspace layer that keeps =restclient.el= useful for
lightweight request execution while adding OpenAPI import, Org notebooks,
response capture, inline images, and =gptel=-assisted API documentation.
@@ -4315,486 +4975,6 @@ First pass can skip or mark as unsupported:
6. Open scratch buffer (C-; R n), type a request manually, execute
7. which-key shows "REST client" menu under C-; R
-** TODO [#C] Build debug-profiling.el module :feature:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-02
-:END:
-
-Reusable profiling infrastructure for targeted slow-command investigation. Consolidates scattered profiler bindings (currently in =modules/config-utilities.el=) and adds two pure-helper-backed entry points: "profile next command" and "time region or sexp." Designed via =/brainstorm= 2026-04-26.
-
-Design: [[id:c713b431-ae14-498d-aba9-b84d52f981b6][docs/specs/debug-profiling-spec.org]]
-
-Implement via =/start-work= against the design — branch =feat/debug-profiling=, commits decomposed along the test-first split-for-testability boundary. Once shipped, use it as the v1 exercise on the queued [#B] org-capture target-building investigation.
-
-** TODO [#C] Evaluate jamescherti essential-emacs-packages list :quick:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-11
-:END:
-Review [[https://www.jamescherti.com/essential-emacs-packages/][James Cherti's essential Emacs packages]] for anything worth installing. Cross-check each candidate against what is already in the config (=modules/= + =init.el=), skip the ones already present, and shortlist the genuinely new ones with a one-line rationale. Future-installation research, not a commitment to install.
-
-** TODO [#C] Extend F2 "preview" convention across modes :feature:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-02
-:END:
-
-F2 is the universal preview key. Currently bound only in markdown-mode (markdown-preview, in =modules/markdown-config.el=). Org-reveal lives on =C-; o R= via =cj/org-map=, not F2. Extend F2 to other modes where a "preview" action is natural:
-
-- Hugo blog (hugo-config.el) — preview the post in browser
-- HTML / web-mode — open in browser
-- Reveal presentations - preview in browser
-- Any other mode with a natural "preview this" action
-
-Keep the binding mode-local so F2 stays available as a global candidate where no preview makes sense.
-
-** TODO [#C] face-diagnostic: face-name buttons + header allowlist :feature:
-Two v1 follow-ups on the shipped face/font diagnostic: render the face names in the report as buttons that call describe-face (the spec's "For the user" buttons; v1 shows them as plain text), and add face-diagnostic to the module-header allowlist in tests/test-init-module-headers.el now that it's required in init.el. Spec: [[id:98f065cf-8bd5-46a0-ac24-da94d66855ad][face-font-diagnostic-popup-spec-implemented.org]].
-** TODO [#C] Gold text in auto-dimmed buffers :bug:
-Some auto-dimmed document buffers render text in gold; source unknown. Likely a face-remapping or overlay interaction with the theme. Blocked on the face/font diagnostic tool above for diagnosis. From the roam inbox.
-** TODO [#C] Google Contacts ↔ org-contacts sync investigation :feature:
-From the 2026-06-11 brainstorm. Goal: keep [[file:~/sync/org/contacts.org][contacts.org]] (real org-contacts: PROPERTIES drawers, mu4e completion, org-roam links) in sync with Google Contacts. Google side is solid — official People API (OAuth2, incremental syncToken) or CardDAV; no ToS risk. The hard parts are local: (1) identity — entries have no UID, so two-way needs a GOOGLE_ID property per entry plus a one-time fuzzy reconciliation of the two populated datasets (name/email/phone matching); (2) field mapping — space-separated multi-email in one property, free-text body notes, inconsistent phone formats (normalization decision); (3) conflict policy. First decision gates the rest: one-way Google→org read model (simple) vs true two-way. Candidate architectures: vdirsyncer (proven two-way engine w/ Google support; build only the vCard↔org translation, evaluate org-vcard fidelity) vs a direct People API script with sync state in org properties. Output: recommendation doc in docs/design/ naming direction + the normalization/conflict decisions for Craig. Not :solo: — the one-way-vs-two-way call and normalization policy are Craig's.
-
-** TODO [#C] Google Voice in Emacs — SMS + dialer investigation :feature:
-From the 2026-06-11 messenger-unification brainstorm. Google Voice has no official API; the viable routes ride the Matrix bridge ecosystem's reverse engineering (mautrix-gvoice). Research pass to establish the 2026 state of play: (1) is mautrix-gvoice healthy and what does its auth flow look like now; (2) any better-maintained alternative (CLI/daemon) for the signel-pattern architecture (external daemon + JSON-RPC + thin Emacs chat client); (3) does call initiation (ring-linked-phone-then-connect, Emacs as dialer) survive in the current protocol — two-way audio in Emacs is out of scope (WebRTC); (4) ToS/account-flag risk assessment for Craig's account. Output: a recommendation doc in docs/design/ naming the architecture (signel-pattern daemon vs Matrix bridge + ement.el) or a no-go with reasons. If go, GV becomes a registered backend under the messenger-unification convention (see the [#B] task below).
-
-** TODO [#C] latexmk workflow never activates (two breaks) :bug:quick:solo:
-=modules/latex-config.el:66= — =:hook (TeX-mode-hook . ...)= gets use-package's =-hook= suffix appended (unbound symbol not ending in =-mode=), registering on nonexistent =TeX-mode-hook-hook=, so =TeX-command-default "latexmk"= is never set. Independently =:80= auctex-latexmk is =:defer t= with no trigger, so =auctex-latexmk-setup= never runs and "latexmk" isn't in TeX-command-list. Fix hook name to =TeX-mode=; change auctex-latexmk to =:after tex=. From the 2026-06 config audit.
-
-** TODO [#C] Org-noter custom workflow — fix and finish :feature:bug:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-02
-:END:
-
-Continue debugging and testing the custom org-noter workflow from 2025-11-21 session.
-This is partially implemented but has known issues that need fixing before it's usable.
-
-*Last worked on:* 2025-11-21
-*Current status:* Implementation complete but has bugs, needs testing
-
-*Known issues to fix:*
-
-1. /Double notes buffer appearing when pressing 'i' to insert note/
- - When user presses 'i' in document to insert a note, two notes buffers appear
- - Expected: single notes buffer appears
- - Need to debug why the insert-note function is creating duplicate buffers
-
-2. /Toggle behavior refinement needed/
- - The toggle between document and notes needs refinement
- - May have edge cases with window management
- - Need to test various scenarios
-
-*Testing needed:*
-
-1. /EPUB files/ - Test with EPUB documents (primary use case)
-2. /Reopening existing notes/ - Verify it works when notes file already exists
-3. /Starting from notes file/ - Test opening document from an existing notes file
-4. /PDF files/ - Verify compatibility with PDF workflow
-5. /Edge cases:/
- - Multiple windows open
- - Splitting behavior
- - Window focus after operations
-
-*Implementation files:*
-- =modules/org-noter-config.el= - Custom workflow implementation
-- Contains custom functions for document/notes toggling and insertion
-
-*Context:*
-This custom workflow is designed to make org-noter more ergonomic for Craig's reading/annotation
-workflow. It simplifies the toggle between document and notes, and streamlines note insertion.
-The core functionality is implemented but needs debugging before it's production-ready.
-
-**Next Steps:**
-1. Debug the double buffer issue when pressing 'i'
-2. Test all scenarios listed above
-3. Refine toggle behavior based on testing
-4. Document the final keybindings and workflow
-
-** TODO [#C] Pick and wire a debug backend for F5 :feature:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-01
-:END:
-
-#+begin_src emacs-lisp
- Give me an idea of the amount of work and complexity and what allows for a consistent UX across languages.
-#+end_src
-
-*** 2026-05-15 Fri @ 19:19:21 -0500 Inital Goals
-Bind F5 globally to a debug entry point. Backend choice is the hard part:
-
-- dape (Debug Adapter Protocol for Emacs) — modern, multi-language via DAP. Single UX across Python, Go, TS, Rust, etc. Less mature than DAP clients in other editors.
-- realgud — wraps multiple debuggers (pdb, gdb, node --inspect, etc.). More mature; UX varies by backend.
-- Language-specific stacks — dap-mode (python-mode + dap), delve for go, ts-node --inspect, etc. Best per-language UX; most config work.
-
-F5 itself will be simple (start/resume debug). Likely modifier variants once the backend is picked:
-- C-F5 toggle breakpoint at point
-- M-F5 eval expression in debug context (or step-over shortcut)
-
-Evaluate against these projects' languages: elisp (edebug already works), Python, Go, TS, shell. Shell debug is usually print-based; skip.
-
-Do this after the F-key rework ticket ships so F5 is the only hole left.
-
-** TODO [#C] Review and rebind M-S- keybindings :refactor:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-01
-:END:
-
-Changed from M-uppercase to M-S-lowercase for terminal compatibility.
-These may override useful defaults - review and pick better bindings:
-- M-S-b calibredb (was overriding backward-word)
-- M-S-c time-zones (was overriding capitalize-word)
-- M-S-d dwim-shell-menu (was overriding kill-word)
-- M-S-e eww (was overriding forward-sentence)
-- M-S-f fontaine (was overriding forward-word)
-- M-S-h split-below
-- M-S-i edit-indirect
-- M-S-k show-kill-ring (was overriding kill-sentence)
-- M-S-l switch-themes (was overriding downcase-word)
-- M-S-m kill-all-buffers
-- M-S-o kill-other-window
-- M-S-r elfeed
-- M-S-s window-swap
-- M-S-t toggle-split (was overriding transpose-words)
-- M-S-u winner-undo (was overriding upcase-word)
-- M-S-v split-right (was overriding scroll-down)
-- M-S-w wttrin (was overriding kill-ring-save)
-- M-S-y yank-media (was overriding yank-pop)
-- M-S-z undo-kill-buffer (was overriding zap-to-char)
-
-** TODO [#C] Slack message buffers in a reused popup window :quick:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-05
-:END:
-Display slack.el message and thread buffers in a dedicated popup window (side or bottom) and reuse that one window instead of spawning a new window per buffer. Likely a =display-buffer-alist= rule (or popper integration) in =modules/slack-config.el=.
-
-** TODO [#C] the preview splits an already split window into 3 temporarily. :bug:
-looks strange. potentially problematic for ai-terms.
-
-** TODO [#C] TRAMP/dirvish "?" for remote dates — verify the fix per host :bug:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-06-02
-:END:
-
-Root cause is traced (see the dated investigation entry below). What's left needs a live remote: open each remote host in dirvish and run the three diagnostic evals to find which gate is closed, then close it.
-
-Diagnostics (run with point in a remote dirvish buffer):
-- =M-: (dirvish-prop :remote-async)= — nil means =tramp-direct-async-process-p= is failing for this method/host, so dirvish's remote attribute fetch never runs.
-- =M-: (dirvish-prop :gnuls)= — nil means the remote has no GNU =ls= (the =ls --version= probe failed), so the parser gate stays shut. Likely on truenas (FreeBSD).
-- =M-: (tramp-direct-async-process-p)= — confirms whether direct-async is actually active for the connection.
-
-Likely fixes, by which gate is closed:
-- =:gnuls= nil → install GNU coreutils on the remote (FreeBSD: =pkg install coreutils=) and make =ls= resolve to GNU on the TRAMP path, or accept "?" on that host.
-
- - Constraint: nothing gets installed on the remote host, so the =:gnuls= gate is resolved by accepting "?" on that host rather than installing coreutils.
-- =:remote-async= nil → the scp/sshx method isn't advertising direct-async; switch to a method that supports it or check =tramp-direct-async-process= is taking effect for that protocol.
-
-Files involved: =modules/tramp-config.el=, =modules/dirvish-config.el=.
-
-*** 2026-05-22 Fri @ 20:24:44 -0500 Traced the root cause through dirvish source
-Remote dates/sizes don't come from the dired =ls= listing or =dired-listing-switches=. They come from =dirvish-data-for-dir= (=dirvish-tramp.el:95=), which runs =ls -1lahi= on the remote and parses the columns into the attribute cache. That method only fires when both =(dirvish-prop :remote-async)= is a number and =(dirvish-prop :gnuls)= is a string. When either gate is shut, dirvish falls back to its default, which deliberately skips =(file-attributes f-name)= for remote files (=dirvish.el:904=, a perf guard) — leaving attrs nil, so the file-size and file-time widgets render "?" (=dirvish-widgets.el:216,247=).
-
-That explains why every prior fix missed: dired-listing-switches feed a different code path entirely, and disabling =tramp-direct-async-process= shuts the =:remote-async= gate, which is the one path that populates remote attributes — exactly backwards. The config already enables direct-async for ssh/sshx (=tramp-config.el:79-88=), so the remaining closed gate is per-host: =:gnuls= (no GNU ls on FreeBSD-based truenas) or direct-async not taking effect for the method. Could not verify on a live remote from the work session — handed the per-host diagnostics up into the task body.
-
-** TODO [#D] Dashboard over-scroll: pin last line to window bottom :bug:
-:PROPERTIES:
-:LAST_REVIEWED: 2026-05-22
-:END:
-Triggered by: 2026-05-20 Dashboard buffer too long follow-up.
-
-After the opens-at-top fix (=4ac1b81=), the dashboard can still be
-scrolled past its content: the banner image makes the buffer just over
-one screenful, so the wheel / =C-v= / =M->= pull the last line up and
-leave empty space below it. Craig wants scrolling to stop once the
-trailing line reaches the window bottom (no void) while still allowing
-scroll-down to reach content below the window.
-
-Findings from the 2026-05-20 investigation:
-- =pixel-scroll-precision-mode= is off, so this is standard line-based
- scroll overshoot (the tall banner image inflates the rendered height).
-- A =window-start= clamp does not work: =window-start= only lands on
- line boundaries, so it can't express a position partway into the
- banner image — it either blocks all scrolling or leaves the void.
-- A =recenter -1= pin on =post-command-hook= does not work: it fires on
- every command, so it fights item navigation (the cursor can't reach
- the projects / bookmarks / recents).
-- Right design: clamp only on actual scroll commands — advise
- =mwheel-scroll= / =scroll-up-command= / =scroll-down-command= /
- =end-of-buffer= to =recenter -1= when over-scrolled, never on
- navigation commands.
-- Live experiment scratch file: =~/dashboard-overscroll-experiment.el=.
-
-** TODO [#D] Emacs Packages — Curl-Friendly Web Service Wrappers
-Ideas for new Emacs packages following the same pattern as wttrin: HTTP GET to a simple web service, render results in a buffer, optionally show summary in the mode-line. All of these share the async fetch + caching infrastructure already proven in wttrin.
-Captured On: [2026-04-04 Sat]
-*** TODO Stock Market / Finance Package (Finnhub or Alpha Vantage)
-Build a stock watchlist and quote viewer for Emacs. User defines a list of symbols; package fetches quotes and renders a formatted table in a dedicated buffer. Optional mode-line ticker showing one or more symbols rotating on a timer.
-
-**** Features
-- Customizable watchlist: user defines a list of stock symbols in a defcustom; package fetches and displays all of them in a single buffer
-- Formatted quote table: symbol, company name, current price, daily change (absolute and percent), volume — color-coded green/red for gains/losses
-- ASCII sparkline charts: inline mini-charts showing intraday or multi-day price movement using Unicode block characters (▁▂▃▅▇ style)
-- Mode-line ticker: rotating display of one or more symbols with price and change indicator, similar to wttrin's weather widget — click to open the full watchlist buffer
-- Detail view: press RET on a symbol to see extended data — open/high/low/close, 52-week range, market cap, P/E ratio (data availability depends on backend)
-- Auto-refresh with market awareness: background timer fetches new data during market hours; pauses on weekends and after-hours to conserve API calls
-- Unit/currency preference: display prices in local currency if the backend supports it
-- Cache layer: same pattern as wttrin — serve cached data instantly, refresh in background, show staleness indicator when data is old
-- Interactive symbol lookup: ~M-x stock-add-symbol~ with completion against a symbol database or search endpoint
-
-**** What you'd learn
-- JSON parsing in elisp (~json-parse-buffer~, ~json-read~) — these APIs return JSON, not plain text, so this is the main new skill vs. wttrin
-- ASCII chart rendering — drawing sparklines or simple price charts with Unicode block characters in a buffer
-- API key management in elisp — storing keys in ~auth-source~ or custom variables, passing them as query params
-
-**** Where the complexity lives
-- Rendering: No pre-formatted ASCII comes back from the API. You'd build the table layout and any chart visualization yourself. This is the bulk of the work.
-- Market hours awareness: Knowing when to fetch (pre-market, regular, after-hours, weekends) to avoid wasting API calls.
-- Rate limiting: Free tiers are tight. Finnhub gives 60 calls/min which is generous; Alpha Vantage gives only 25/day on the free tier. Caching strategy matters more here than in wttrin.
-
-**** Candidate backends
-- Finnhub (finnhub.io): Free API key, 60 calls/min, real-time US quotes. JSON only. Best rate limit of the free options.
-- Alpha Vantage (alphavantage.co): Free API key, 25 calls/day. Supports CSV output which is trivial to parse — no JSON needed. Good for daily summaries, bad for frequent polling.
-- Twelve Data (twelvedata.com): Free key, 800 calls/day, 8/min. Covers stocks, forex, crypto, ETFs. JSON and CSV.
-
-**** Downsides
-- API key requirement adds friction for users (signup, config). Not as frictionless as wttrin.
-- Rate limits mean you can't poll aggressively. Stale data is the norm on free tiers.
-- Financial APIs change or shut down. Yahoo Finance's unofficial API has broken repeatedly over the years. Even paid services deprecate endpoints. Expect maintenance.
-- Finnhub and Alpha Vantage are US-market-centric. International coverage varies.
-
-**** Effort: Medium-High
-The fetch/cache layer is straightforward (reuse wttrin patterns). The rendering layer (tables, charts, color-coding gains/losses) is where most of the time goes. Expect this to be a real project, not a weekend hack.
-
-**** Name candidates (backronyms)
-Pick one. All are recursive (self-referential) in the style of CHIME.
-- BULL — *BULL Updates Live Listings*
-- MINT — *MINT Indexes Noteworthy Tickers*
-- QUOTE — *QUOTE Updates Ongoing Ticker Estimates*
-- ASSET — *ASSET Surfaces Stock Exchange Tickers*
-- MOAT — *MOAT Monitors Active Tickers*
-- TRADE — *TRADE Reveals Active Daily Equities*
-- BELL — *BELL Exhibits Live Listings*
-- CHART — *CHART Highlights Asset Rate Tickers*
-- BOARD — *BOARD Oversees Asset Rate Data*
-- VAULT — *VAULT Aggregates Underlying Listing Tickers*
-
-*** TODO rate.sx Wrapper — Cryptocurrency Rates
-Wrap Igor Chubin's rate.sx service. This is the lowest-effort, highest-pattern-match option — rate.sx works exactly like wttr.in. Returns colored ASCII tables with sparkline charts. Same ~User-Agent: curl~ trick, same ANSI escape codes.
-
-**** Features
-- Full crypto dashboard: ~M-x rate-sx~ opens a buffer with a colored ASCII table of top cryptocurrencies — name, price, 24h change, market cap, and sparkline charts — all rendered by the service
-- Single coin lookup: ~M-x rate-sx-coin~ prompts for a coin name (e.g., ~eth~, ~btc~) and displays its detailed view
-- Plain price fetch: query ~rate.sx/1BTC~ to get a single numeric price — useful for mode-line display or programmatic use from other elisp
-- Mode-line widget: show the price of one or more coins in the mode-line with periodic background refresh, similar to wttrin's weather indicator
-- Customizable coin list: user picks which coins appear in the dashboard via a defcustom
-- Currency base selection: rate.sx supports displaying prices in different fiat currencies
-- ANSI color rendering: reuse wttrin's ~xterm-color~ pipeline to convert the service's colored ASCII output into Emacs faces
-- Cache with background refresh: same timer-based pattern as wttrin — data stays warm, buffer opens instantly
-
-**** What you'd learn
-- Very little new — this is almost a copy of wttrin with different URL construction. Good first project if you want to validate the pattern before tackling stocks.
-- Could explore sharing infrastructure between wttrin and this package (common async fetch, caching, ANSI rendering).
-
-**** Where the complexity lives
-- Minimal. The service does the formatting. Your job is URL construction, fetch, ANSI-to-faces conversion (already solved in wttrin via ~xterm-color~), and buffer display.
-- Coin selection UX: letting users pick which coins to show, custom vs. top-N, etc.
-
-**** Downsides
-- Single point of failure: rate.sx is one person's side project. If Chubin takes it down, the package is dead. No fallback.
-- Crypto-only. No traditional stocks, forex, or commodities.
-- Less useful than a stock package for most people.
-
-**** Effort: Low
-Could reuse 70-80% of wttrin's code. A weekend project if you're focused.
-
-*** TODO Frankfurter Currency Exchange Package
-Wrap the Frankfurter API (frankfurter.dev) for fiat currency conversion and historical rates. ECB data, open source, no API key.
-
-**** Features
-- Quick conversion: ~M-x currency-convert~ prompts for amount, base currency, and target currency — displays the result in the echo area (e.g., "100 USD = 91.34 EUR")
-- Multi-target conversion table: convert one amount against several currencies at once, rendered as an aligned table in a dedicated buffer
-- Historical rate lookup: query a specific date's exchange rate — useful for expense reports, invoicing, or curiosity
-- Rate trend view: fetch a date range and display a table or ASCII sparkline showing how a currency pair moved over days/weeks/months
-- Latest rates dashboard: ~M-x currency-latest~ shows today's rates for a user-defined set of currency pairs in a buffer
-- Interactive currency selection: completing-read over the ~30 supported currencies with full names (e.g., "USD — United States Dollar")
-- Mode-line rate display: optionally show one currency pair's rate in the mode-line with daily background refresh
-- Cache layer: rates only update once per business day, so caching is especially effective — fetch once, serve all day
-
-**** What you'd learn
-- JSON parsing in elisp (the API returns JSON, not formatted text)
-- Table rendering — building aligned currency tables with ~format~ and text properties
-- Historical data display — the API supports date ranges, so you could show rate trends over time
-
-**** Where the complexity lives
-- Rendering: You'd build the table and any trend visualization yourself.
-- Date handling in elisp for historical queries (~encode-time~, ~format-time-string~, etc.).
-- UX: interactive base/target currency selection with completion.
-
-**** Downsides
-- ECB data updates once per business day. No real-time rates — this is reference data, not trading data.
-- Covers ~30 currencies (major fiats). No crypto, no exotic currencies.
-- Frankfurter is open-source and self-hostable, which is good for longevity, but the public instance could still go away.
-
-**** Effort: Low-Medium
-JSON parsing adds a step vs. wttrin's plain text, but the API is clean and well-documented. Straightforward project.
-
-*** TODO ipinfo.io — IP and Geolocation Lookup
-~curl ipinfo.io~ returns JSON with your public IP, city, region, country, ISP, and timezone. No auth needed for basic lookups (1000 requests/day unauthenticated).
-
-**** Features
-- My IP: ~M-x ipinfo~ fetches your public IP and geolocation, displays a formatted summary in a buffer or the echo area — IP, city, region, country, ISP, timezone, coordinates
-- Arbitrary IP lookup: ~M-x ipinfo-lookup~ prompts for an IP address and shows the same geolocation detail
-- Copy IP to kill ring: one-keystroke convenience for grabbing your public IP
-- Open in browser map: command to open the returned lat/long coordinates in OpenStreetMap or Google Maps via ~browse-url~
-- Hostname resolution: the API also returns the reverse DNS hostname for an IP
-- Mode-line IP display: optionally show your current public IP in the mode-line (useful when switching between networks/VPNs)
-- Org-mode integration: insert IP/geo info as an org property block or table row at point
-
-**** What you'd learn
-- Minimal new skills — simple JSON response, single fetch, render in buffer or echo area.
-- Could add map integration (open coordinates in browser or an Emacs map package).
-
-**** Where the complexity lives
-- Almost nowhere. This is the simplest possible package. Fetch JSON, format it, display it.
-- If you want to look up arbitrary IPs (not just your own), add a prompt with completion history.
-
-**** Downsides
-- Very niche utility. You look up your IP occasionally, not daily.
-- Free tier is generous (1000/day) but authenticated lookups require a token for enriched data.
-- Privacy-conscious users may not want to send their IP to a third party (though they already do by virtue of connecting).
-
-**** Effort: Very Low
-An afternoon project. Good as a learning exercise for the fetch-parse-render pattern if you haven't done JSON APIs in elisp before.
-
-*** TODO icanhazdadjoke.com — Dad Jokes in Emacs
-~curl -H "Accept: text/plain" https://icanhazdadjoke.com~ returns a single plain-text joke. No auth, no key, no rate limit concerns for casual use.
-
-**** Features
-- Random joke: ~M-x dad-joke~ fetches a random joke and displays it in the echo area — minimal disruption, maximum groan
-- Joke buffer: ~M-x dad-joke-buffer~ opens a dedicated buffer with a joke, nicely formatted with a large font face. Press ~n~ for the next joke, ~q~ to quit
-- Search jokes: ~M-x dad-joke-search~ prompts for a term (e.g., "cat") and displays matching jokes in a buffer — the API supports ~?term=~ search
-- Startup joke: optional hook to display a dad joke in the echo area or scratch buffer on Emacs startup
-- Org-mode insertion: ~M-x dad-joke-insert~ inserts a joke at point — for lightening up documentation or commit messages
-- Kill ring: ~M-x dad-joke-yank~ fetches a joke and puts it directly in the kill ring for pasting elsewhere
-
-**** What you'd learn
-- Nothing technically new — this is the simplest possible HTTP-GET-to-buffer pattern.
-- Good excuse to experiment with fun presentation: display in echo area, dedicated buffer, or even as a startup message.
-
-**** Where the complexity lives
-- It doesn't. Fetch a string, display it. The API also supports search (~?term=dog~) if you want to add that.
-
-**** Downsides
-- Toy project. Zero practical utility beyond morale.
-- The joke quality is... dad jokes.
-
-**** Effort: Trivial
-An hour, maybe two if you add search and a nice buffer layout. Publishable on MELPA as a novelty package.
-
-*** TODO qrenco.de — QR Code Generator
-Chubin's QR code service. ~curl qrenco.de/hello~ returns a QR code rendered in Unicode block characters. Encodes arbitrary text, URLs, WiFi credentials, etc.
-
-**** Features
-- Encode text: ~M-x qr-encode~ prompts for a string and displays the QR code in a dedicated buffer using Unicode block characters
-- Encode region: ~M-x qr-encode-region~ encodes the currently selected text — quick way to QR-ify a URL, password, or snippet
-- Encode URL at point: ~M-x qr-encode-url~ detects the URL under point (via ~thing-at-point~) and generates a QR code for it
-- WiFi QR codes: ~M-x qr-wifi~ prompts for SSID, password, and encryption type, then generates the standard WiFi QR format (~WIFI:T:WPA;S:MyNetwork;P:password;;~) — scan to join a network
-- Buffer font management: automatically sets the buffer to a monospace font with consistent Unicode block rendering (same approach as wttrin's Liberation Mono override)
-- Copy as text: yank the QR code's block characters to the kill ring for pasting into emails, READMEs, or chat
-- Adjustable size: the service supports size parameters — expose this as a prefix argument or defcustom
-
-**** What you'd learn
-- Handling Unicode block character output (not ANSI colors this time, but character-level rendering)
-- Interactive input patterns — prompting for text to encode, or encoding the current region/URL at point
-
-**** Where the complexity lives
-- Font and character width: QR codes require a monospace font where the block characters render at consistent widths. Some Emacs font configurations break this. You'd need to set the buffer font explicitly (like wttrin does).
-- The service sometimes returns ANSI codes for inverted colors. May need ~xterm-color~ or manual processing.
-
-**** Downsides
-- Same single-point-of-failure risk as rate.sx — one person's service.
-- QR codes in a terminal/buffer are inherently lower resolution than image-based ones. Scanning reliability depends on terminal font size and screen.
-- Niche use case. Most people generate QR codes infrequently.
-
-**** Effort: Low
-Similar to rate.sx in scope. The fetch is trivial; font handling and display are the main considerations.
-
-*** TODO dns.toys — Multi-Tool Utility via DNS
-dns.toys answers queries over DNS instead of HTTP. ~dig 100USD-EUR.fx @dns.toys~ returns currency conversion, ~dig mumbai.time @dns.toys~ returns world time, ~dig 42km-mi.unit @dns.toys~ does unit conversion. Also supports base conversion, math constants, and more.
-
-**** Features
-- Currency conversion: ~M-x dns-toys-currency~ prompts for amount and currency pair (e.g., "100 USD to EUR"), displays result in echo area
-- World time: ~M-x dns-toys-time~ prompts for a city name and shows the current local time — faster than searching online, no browser needed
-- Unit conversion: ~M-x dns-toys-unit~ prompts for a value and unit pair (e.g., "42 km to mi"), returns the conversion
-- Base conversion: ~M-x dns-toys-base~ converts between decimal, hex, octal, and binary (e.g., "100 dec to hex")
-- Math constants: ~M-x dns-toys-constant~ looks up pi, e, tau, etc. — niche but handy in a calc session
-- Unified command: ~M-x dns-toys~ with a smart prompt that detects query type from input format, dispatching to the right DNS query automatically
-- Echo area results: all results display in the echo area by default for quick non-disruptive answers, with an optional dedicated buffer for history
-- Async queries: use ~start-process~ with sentinels so ~dig~ calls don't block Emacs
-
-**** What you'd learn
-- Calling external processes from elisp (~call-process~ or ~start-process~ to invoke ~dig~) instead of ~url-retrieve~. This is a meaningfully different integration pattern from wttrin.
-- Parsing DNS TXT record output — dig returns structured but noisy output; you'd extract the answer section.
-- Building a multi-function package — this one service covers currency, time, units, and base conversion, so the UX needs a dispatch mechanism (separate commands, or a unified prompt with type detection).
-
-**** Where the complexity lives
-- Output parsing: ~dig~ output is not designed for human consumption. You'd parse the ANSWER SECTION, strip TTL/class/type fields, and extract the payload string.
-- Latency: DNS queries are fast but ~call-process~ on ~dig~ has subprocess overhead. For interactive use this is fine; for mode-line updates you'd want async (~start-process~ with a sentinel).
-- Feature breadth: The temptation is to wrap every dns.toys feature. Scoping to a focused set (currency + time + units) keeps it manageable.
-
-**** Downsides
-- Requires ~dig~ installed (standard on Linux/macOS, not on Windows). Limits portability.
-- dns.toys is a single maintainer's project. Same fragility concern as rate.sx and qrenco.de.
-- DNS protocol means no rich formatting — just short text strings. The results are useful but visually plain.
-- Some networks/firewalls block non-standard DNS queries, which would silently break the package.
-
-**** Effort: Low-Medium
-The individual queries are trivial. The interesting work is building a clean multi-function UX and handling the process-based (vs. HTTP-based) integration pattern. Good project for learning elisp process management.
-
-*** TODO cheat.sh Integration — Programming Cheat Sheets
-~curl cheat.sh/tar~ returns a syntax-highlighted cheat sheet. Supports language-specific queries like ~cheat.sh/python/lambda~. Already has some Emacs integrations (cheat-sh.el exists) but could be worth a custom implementation if existing packages don't fit your workflow.
-
-**** Features
-- Quick lookup: ~M-x cheat-sh~ prompts for a topic (e.g., "tar", "git/stash") and displays a syntax-highlighted cheat sheet in a dedicated buffer
-- Language-scoped queries: ~M-x cheat-sh-lang~ prompts for language then topic (e.g., ~python/lambda~, ~go/goroutine~) with two-stage completion
-- Context-aware lookup: detect the current buffer's major mode and scope the query to that language automatically — in a Python buffer, querying "lambda" goes to ~cheat.sh/python/lambda~
-- ANSI-to-faces rendering: convert the service's syntax-highlighted ANSI output to proper Emacs font-lock faces using ~xterm-color~ (same pipeline as wttrin)
-- Navigation: browse related topics from within the buffer — follow-up queries without returning to the minibuffer. Previous/next topic history with ~p~ / ~n~
-- Completion against the topic list: fetch and cache ~cheat.sh/:list~ to provide completing-read over all available topics
-- Offline cache: optionally cache previously viewed cheat sheets for offline access or instant re-display
-- Region query: select a command or function name and look it up directly with ~M-x cheat-sh-region~
-
-**** What you'd learn
-- ANSI syntax highlighting → Emacs faces (same skill as wttrin)
-- Deep completion support: cheat.sh has a massive topic tree. Building good interactive completion for ~cheat.sh/{language}/{topic}~ is a UX challenge.
-
-**** Where the complexity lives
-- Completion and navigation: the value is in making it fast to find the right cheat sheet. ~cheat.sh/:list~ returns thousands of entries.
-- Existing packages: ~cheat-sh.el~ already exists on MELPA. You'd need a reason to build your own (better caching, offline support, integration with your workflow).
-
-**** Downsides
-- Overlaps with existing Emacs packages. Check ~cheat-sh.el~ before building.
-- The service aggregates from many sources. Quality is inconsistent across topics.
-
-**** Effort: Medium
-If building from scratch. Low if extending or wrapping an existing package. The completion UX is where the effort goes.
-** TODO [#D] Localrepo refresh / update script :feature:
-No dedicated update path today — refreshing a pinned package means ad-hoc =cp= from the local elpa mirrors. Document the current shape and decide whether a =scripts/refresh-localrepo.sh= is worth writing. Cross-linked from =docs/design/localrepo.org=.
-
-** TODO [#D] Native-comp .eln cache strategy :feature:
-The native-comp =.eln= cache is Emacs-version-specific; an Emacs upgrade invalidates everything. Document the cache location, what an upgrade triggers, and whether a warm-the-cache script is worth shipping. Cross-linked from =docs/design/localrepo.org=.
-
-** TODO [#D] Polish reveal.js presentation setup :feature:
-
-Three small reveal.js improvements; collected into one task because each on its own is too small to track separately.
-
-1. *Image insertion helper.* Function to insert images with proper org-reveal attributes (sizing, background images, etc.) without having to remember the syntax.
-2. *Default font sizing for slide elements.* Configure reveal.js font sizes for headings, body text, code blocks, etc. — better defaults via =org-reveal-head-preamble= CSS or a custom theme.
-3. *Custom dupre reveal.js theme.* CSS theme using the colors from =themes/dupre-palette.el=. Install into =reveal.js/css/theme/= for use with =#+REVEAL_THEME: dupre=.
-
-** TODO [#D] System-tool dependency install script :feature:
-=ripgrep=, =fd=, =pandoc=, =prettier=, =pyright=, and other binaries that =cj/executable-find-or-warn= flags at module load are not in =package.el='s reach. Document the required-tool set and ship a setup script (or =pacman=/=apt= invocation set). Cross-linked from =docs/design/localrepo.org=.
-
-** TODO [#D] Treesitter grammar offline cache :feature:
-Treesitter grammars are downloaded by =treesit-auto= on first use and live outside the localrepo. For true offline reproducibility, cache the grammars next to the localrepo (a =.localrepo/treesitter/= tier, or a separate mirror script). Cross-linked from =docs/design/localrepo.org=.
-* Emacs Someday/Maybe
* Emacs Resolved
** DONE [#B] Fix likely =elpa-mirror-location= path bug :bug:quick:
CLOSED: [2026-05-03 Sun]
@@ -7793,7 +7973,7 @@ Filed 2026-06-02 from a C-f8/C-f9 mix-up. Priority set [#C] (UX polish) — re-g
** TODO [#C] Color dashboard navigator independently of list items :feature:ux:
:PROPERTIES:
-:LAST_REVIEWED: 2026-06-06
+:LAST_REVIEWED: 2026-06-21
:END:
The dashboard navigator (icons + labels) and the recentf/project/bookmark list items are both painted by =dashboard-items-face=: the navigator gets a =dashboard-items-face= overlay, and overlays beat text properties, so the per-button =dashboard-navigator= face is inert. To color the navigator independently of the items, override where that overlay is applied — advise or redefine =dashboard-insert-navigator=, or strip/replace the overlay's face.
Triggered by: 2026-05-22 dashboard color work (L105).
@@ -8143,7 +8323,7 @@ CLOSED: [2026-06-12 Fri]
:END:
Parent task for the Emacs Signal client bring-up. Engine: signal-cli (linked secondary device). Front end: a fork of signel at =~/code/signel=, wired through =modules/signal-config.el=. Design: [[id:0cabd6ee-c458-47b5-a8af-3ee054b25821][docs/specs/signal-client-spec-doing.org]].
-Closed 2026-06-12: the bring-up shipped (dated history below). The signel project now has its own =.ai/= scope, so all open signel/signal-cli issues moved to [[file:~/code/signel/todo.org][the signel todo]] and are tracked there flat (the three open children here — handle-error leak, link-with-QR, groups in picker — moved in that pass). Work on =modules/signal-config.el= stays in this file.
+Closed 2026-06-12: the bring-up shipped (dated history below). The open signel/signal-cli issues moved to [[file:~/code/smoke/todo.org][the smoke todo]] (smoke is the evolved Signal package) and are tracked there flat (the three open children here — handle-error leak, link-with-QR, groups in picker — moved in that pass). Work on =modules/signal-config.el= stays in this file.
*** 2026-06-12 Fri @ 07:34:05 -0500 Signel notify-only-for-unviewed-conversation shipped
Wire =cj/signal--should-notify-p= (done) into signel's =signel--handle-receive= notify block (signel.el:277), route through Craig's notify script instead of bare =notifications-notify=, and gate sound behind a defcustom that defaults off. Spec addendum (the four notify details + wiring architecture) accepted 2026-06-11 — see [[id:0cabd6ee-c458-47b5-a8af-3ee054b25821][signal-client-spec-doing.org]] "Notification slice".
@@ -8179,7 +8359,7 @@ Verified: (1) new contract test =test-signal-config-prefix-map-registered-under-
CLOSED: [2026-06-12 Fri]
Relocated from the global capture inbox 2026-06-06. When inside a projectile project, C-c c t (Task) files into that project's root todo.org under the "<Project> Open Work" header. If the project has no todo.org, fall back to the global inbox-file and warn naming the project.
-Implemented 2026-06-06 in =modules/org-capture-config.el=: a shared project-aware =function= capture target (=cj/--org-capture-project-location=) used by =C-c c t= (Task, =* TODO=) and a new =C-c c b= (Bug, =* TODO [#C]=). Matches an existing top-level "... Open Work" heading (so ~/.emacs.d hits "Emacs Open Work") and creates "<Capitalized project> Open Work" only when absent. Outside a project / no todo.org -> global inbox under "Inbox" (with a warning in the no-todo.org case). 15 ERT tests in =tests/test-org-capture-config-project-target.el=; daemon e2e confirmed a real capture lands "** TODO [#C] ..." prepended under Open Work. Manual verify filed under the Manual testing and validation parent. NOTE: the matching "<Project> Resolved Work" header for the wrap-up workflow is a separate concern, not handled here.
+Implemented 2026-06-06 in =modules/org-capture-config.el=: a shared project-aware =function= capture target (=cj/--org-capture-project-location=) used by =C-c c t= (Task, files a top-level TODO) and a new =C-c c b= (Bug, files a top-level TODO [#C]). Matches an existing top-level "... Open Work" heading (so ~/.emacs.d hits "Emacs Open Work") and creates "<Capitalized project> Open Work" only when absent. Outside a project / no todo.org -> global inbox under "Inbox" (with a warning in the no-todo.org case). 15 ERT tests in =tests/test-org-capture-config-project-target.el=; daemon e2e confirmed a real capture lands a second-level TODO entry prepended under Open Work. Manual verify filed under the Manual testing and validation parent. NOTE: the matching "<Project> Resolved Work" header for the wrap-up workflow is a separate concern, not handled here.
** DONE [#A] theme-studio: 2D gallery color picker for assignment dropdowns :feature:studio:
CLOSED: [2026-06-15 Mon]
Replaced the per-face color dropdown (mkColorDropdown popup in app.js) with a 2D grid in the palette-panel shape: galleryModel(cur,palette,ground) in app-core.js (pure; reuses columnsFromPalette) returns a default chip, an optional (gone) cell, and rows = ground strip then one row per family (members dark->light, one selected). 5 node tests + #gallerytest browser gate. Trigger and ‹ › step buttons unchanged; applies to all three tiers. From the roam inbox 2026-06-15.
@@ -8530,3 +8710,515 @@ CLOSED: [2026-06-16 Tue]
Craig, 2026-06-11 manual-test walk: the color picker's background is hard to distinguish from the page background. Give the picker panel a visibly distinct background or a highlighted border so it stands out. Pin with a gate asserting the picker element carries the distinct style.
Done 2026-06-16: the picker now carries the gold accent border (#e8bd30) and a lighter background (#1f1c19 vs the page's #0d0b0a). The #pickertest gate asserts the accent border and a per-channel background lift of ≥12 over the page, so the distinction can't silently regress.
+** DONE [#A] ai-term: selecting an agent kills the whole Emacs process :bug:
+CLOSED: [2026-06-18 Thu]
+Root cause: a ghostel native-module regression in 0.35.0-0.35.2 (all shipped 2026-06-16..18), not anything in this config and not display-backend related. Reproduced down to a plain =M-x ghostel= in a GUI frame (not ai-term-specific); under gdb it is a clean =exit()= from the PGTK main loop (not a SIGSEGV — hence no core ever produced). Upstream filed it the same day: dakra/ghostel #422 (Linux/glibc — the native PTY path now spawns worker threads, and a SIGSETXID handler calls malloc while the main thread holds the glibc arena lock → crash/hang on =M-x ghostel= in a GUI daemon, exactly our case) and #423 (macOS — recursive os_unfair_lock via =run_window_change_functions=). =ghostel-comint= is not a usable workaround (no cursor positioning, can't run the Claude TUI).
+
+Fix: pinned ghostel to the last pre-rework build — =ghostel-20260604.2049=, commit 5779a2adceb2, native module 0.33.0 — installed directly into =elpa/= and held there by =:ensure= (won't auto-upgrade). See =modules/term-config.el=. Verified: the exact crash scenario (open a ghostel buffer in a PGTK GUI frame) now survives; ghostel buffer healthy; terminal test suites green.
+
+Also done this session: =ghostel-module-auto-install= set to =download= (the original "doesn't install" fix); zig 0.15.2 pinned at =/usr/local/bin/zig= as the compile fallback (Arch ships 0.16 which can't build ghostel); archsetup notified of the zig pin.
+
+*** 2026-06-18 Thu @ 16:33:56 -0500 ai-term confirmed working after the 0.33.0 pin
+Craig confirmed in normal use — opening/selecting ai-terms works with no whole-process crash ("everything seems to be working as normal now"). Headless reproduction (open a ghostel buffer in a PGTK GUI frame) had already survived; this is the live-hands confirmation.
+** DONE [#C] Reproducible face-coverage generator + coverage diff :feature:solo:
+CLOSED: [2026-06-18 Thu]
+Built: =face-coverage-dump.el= + =face_coverage.py= + =make face-coverage= / =make face-coverage-diff=. Validated by regenerating and diffing against the hand-built worklist (headings identical; only an intro line and one sharper description differ). Compare mode reports newly-covered / newly-present / disappeared / per-tier deltas. Unrecognized faces route by defface source (elpa -> own package bucket, built-in -> emacs-general child), so a newly-loaded package self-buckets.
+
+Known edge: a new package whose face prefix collides with an existing family name (e.g. =org-modern= faces start with =org=) folds into that family's bucket instead of getting its own, because the family match wins before the source fallback. Fix when it bites: add the package's prefix to =EXTRA_FAMILIES= in =face_coverage.py=.
+
+=scripts/theme-studio/face-coverage.org= is hand-regenerated by a throwaway /tmp script each time. Commit a self-contained generator so the worklist regenerates with one command, plus a diff that names what coverage changed between runs.
+
+Generator — two pieces plus a Makefile target:
+- =face-coverage-dump.el= — batch elisp run via =emacsclient= against the live daemon (captures actually-loaded packages), with an =emacs --batch -l init.el= fallback for a clean checkout. For every face in =(face-list)= emit name, first-line docstring, and =(symbol-file f 'defface)=. One JSON/TSV out.
+- =face_coverage.py= — read that dump plus the studio's managed set (font-lock map from =build-theme.el=, =UI_FACES= from =generate.py=, =package-inventory.json=); classify each face core/general/package by where its defface lives (=/usr/share/emacs= = built-in, =elpa= = package); group; write =face-coverage.org= with the TODO/DONE tree, =[d/t]= cookies, per-face docstrings, and per-bucket descriptions (group-documentation / package summary).
+- =make face-coverage= runs both and writes the file.
+
+Carry over the manual logic already worked out: the CORE_HINT core-face set; the subsystem/package family buckets (including abbrev, which-func, git-gutter, git-commit, twentyfortyeight, yas, edit-indirect); the erc-ansi and =bg:erc=/=fg:erc= routing; and the separator-aware prefix match (=-=, =:=, =/=).
+
+Compare mode (=make face-coverage-diff=):
+- Parse the committed (HEAD) =face-coverage.org= and the freshly generated one into face→state maps via =^\*+ (TODO|DONE) name=. Report newly covered (TODO→DONE), newly present (new package or Emacs upgrade), disappeared (package removed), and net coverage with per-tier deltas.
+- =git diff face-coverage.org= already gives the raw line delta; this is the friendlier summary.
+- Optional: append a dated =covered/total= line to a small coverage-log for progress over time.
+
+Dump from the live daemon by default (reflects the packages actually run); the batch fallback won't see lazily-loaded packages until required.
+** DONE [#C] todo.org org-lint follow-ups :refactor:
+CLOSED: [2026-06-20 Sat]
+From the lint-org sweeps (2026-06-15, refreshed 2026-06-20). Resolved 2026-06-20: the misplaced-heading false positive was reworded (the bug-capture task's prose quoted heading-like "* TODO" strings), and the broken link was repointed from the missing =~/code/signel/todo.org= to =~/code/smoke/todo.org= (smoke is the evolved Signal package). The obsolete-properties-drawer entries no longer reproduce under a full org-lint pass. Both lint-org --check and the built-in org-lint now report zero.
+** DONE [#B] F9 toggle collapses a 3-window layout to 2 :bug:
+CLOSED: [2026-06-20 Sat]
+Fixed 2026-06-20 (option 1 — reversible toggle, Craig's call). In a 3+ window layout where
+the agent had its own split, toggle-on reused the working window at the bottom edge,
+displacing its buffer and collapsing three windows to two. Added a flag
+(=cj/--ai-term-last-toggle-deleted-split=) set when toggle-off delete-windows the agent's own
+window; =cj/--ai-term-reuse-edge-window= consumes it and falls through to a fresh re-split, so
+the agent returns to its own window and the others are untouched. The flag only changes the 3+
+window case (2-window slot-reuse unchanged). TDD regression
+=test-ai-term--reuse-edge-window-3win-toggle-restores-own-window=; full =make test= green;
+live-reloaded. Commit 64916462. GUI sign-off is a VERIFY under Manual testing and validation.
+** DONE [#B] Codebase refactoring program — remaining batch :refactor:solo:
+CLOSED: [2026-06-20 Sat]
+Complete 2026-06-20: all 13 scan findings addressed across the day's sessions (see
+=.ai/sessions/= for the logs). 5 medium extractions + 2 big single-file refactors +
+6 theme-studio items including the browser-gates harness rewrite. The only item not
+done is the item-8 plan() factory, consciously skipped as premature abstraction
+(heterogeneous call sites — see "Remaining — item-8 plan() factory" below).
+The original scan: full-codebase 8-agent fan-out over modules/ + scripts/theme-studio/,
+one focused refactor per commit, won't-do items excluded.
+
+*** Working protocol (apply to every item)
+- TDD: write/keep a failing-then-green test; harvest new test seams the refactor opens.
+- Behavior-preserving only. If a "dedup" would delete a real test seam or couple
+ dissimilar code, SKIP it and record why (see skips below).
+- Per refactor, verify in this order, then commit + push (no-approvals mode):
+ 1. =make test-file FILE=<basename.el>= for touched + new tests.
+ 2. =make validate-modules= (loads all 123 modules; catches load/paren errors).
+ 3. Init-launch smoke on a throwaway daemon: =emacs --daemon=cj-sNN=, then
+ =emacsclient -s cj-sNN -e '(emacs-pid)'= to capture the PID, check
+ =(length features)= = 807 and no init errors in the log, then kill by that
+ PID (the emacsclient kill-emacs is flaky; pkill -f 'daemon=cj-sNN'
+ self-matches its own shell — kill the captured PID).
+ 4. Live-reload the edited module into Craig's running daemon
+ (=emacsclient -e '(load "/home/cjennings/.emacs.d/modules/<m>.el")'=); skip
+ the live reload for big use-package modules whose :config restacks (verify via
+ the fresh smoke daemon instead, as with mail-config).
+- Tab-heavy files: =sed -n 'A,Bp' FILE | cat -A= to get exact bytes before an Edit;
+ write NEW code in the documented 2-space style.
+- Shared asset already created: =cj/format-region-with-program= in system-lib.el
+ (the run-a-formatter-over-the-buffer helper). Reuse it for any further
+ format-region duplicates.
+
+*** DONE — medium extractions (2026-06-20 afternoon)
+All five shipped: calibredb-epub nov re-render/centering helpers (fccf29b0);
+ai-term toggle-off teardown + working-buffer swap (62fee96b); calendar-sync
+per-event exception parser (23f405b4); dirvish playlist-target resolution
+(a1ca2fb0); custom-case per-word title-case decision (4cc9ca0b).
+
+*** DONE — big single-file + theme-studio (2026-06-20 afternoon, no-approvals run)
+Both big single-file items shipped: dwim-shell branching command builders
+(f93b4615); custom-comments divider/box generator dedup (42f0c88a). Five of the
+six theme-studio items shipped: face_coverage path_kind (9a52370b),
+capture-default-faces condition_matches unify (28b4d1cf), dropdownRowTextColor
+delete (10a56789), test-file inline-integrity dedup — subTest loop + shared
+inline-strip.mjs (13969c70), generate.py lazy _build()/__getattr__ (6df4ebdc),
+browser-gates assertPreviewFaces for the 3 preview gates (5627f137).
+
+*** DONE — browser-gates harness rewrite (with Craig's go-ahead, 2026-06-20)
+- =gate(id, body)= helper (05697e83): the 38 standard gates' ok/notes/A + title +
+ result-div boilerplate, note format standardized to " fails=". Each call site keeps
+ its literal =location.hash==='#NAMEtest'=. 6 custom gates stay inline. First automated
+ attempt deleted gates (a closing-finder spanned boundaries) — caught by a gate-count
+ guard, reverted, redone anchored on each gate's unique =d.id=. Verified all 44 green +
+ a forced A(false) in a converted gate still FAILs.
+- =withSavedState(keys, body)= (a473aa7c): wraps the 7 restore-nothing gates, scoped to
+ the globals each mutates; JSON-clone snapshot + finally-restore (structuredClone threw
+ on the studio objects — caught by the gate run as "no verdict", switched to JSON like
+ the gates' own local saves). The 14 self-restoring gates left as-is. Verified 44 green,
+ restore round-trip holds, broken assertion in a wrapped gate still FAILs.
+
+*** Remaining — item-8 plan() factory (deferred, low value)
+The =plan(overrides)= factory for the ~30 planPaletteGenerator calls (test-app-core.mjs
++ test-palette-generator-core.mjs) was deferred. The calls pass heterogeneous options
+(scheme/accentCount/sourceMode/vibe/intent vary per call); a factory only dedups the
+constant spanCount:0/rng and would hide which options each test actually exercises —
+premature abstraction over varying calls. The other two item-8 parts (subTest loop +
+shared stripExports) shipped in 13969c70.
+
+*** WON'T-DO (do not re-attempt — assessed and rejected)
+- theme-studio buildTable/buildUITable/buildPkgTable merge: genuine per-tier divergence
+ (column order, syntax dual fg/bg dropdowns, ui preview cell, pkg nd markers) + the
+ =.cells[N]= positional sort coupling make a unified builder MORE complex than the
+ three explicit ones. Close as won't-do.
+- Cross-language test overlap (browser-gates preview gate vs test_generate.py
+ PackageFaceCoverage): don't merge — would couple a fast Python test to a headless
+ browser run. A one-line comment in each noting the split is the most that's worth it.
+
+*** Skipped this run (with reasons — don't redo)
+- eshell-config ssh-alias "merge the two helpers": =cj/--eshell-ssh-alias-commands= is
+ a deliberate pure/effectful split with 3 dedicated tests; merging deletes the seam.
+- prog-*-setup boilerplate: only python+webdev share the full pattern; shell/c/elisp/
+ common-lisp differ materially. A keyword-arg helper would be less readable. No
+ premature abstraction.
+- erc join-command =cj/erc--ensure-active-connection= extraction: nesting-only on
+ untestable UI (call-interactively/switch-to-buffer), no test seam, risky tab-rewrite.
+- coverage-core =simplecov-executable-lines= vs =parse-simplecov= clone: borderline
+ MEDIUM, differs only by a =(> hits 0)= predicate; parameterize with a keep-line-p
+ only if revisiting. Low priority.
+** CANCELLED [#A] calendar-sync drops final occurrences, resurrects cancelled meetings :bug:solo:next:
+CLOSED: [2026-06-20 Sat 22:51]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-13
+:END:
+Needs from Craig: a real .ics fixture (or two) that reproduces both symptoms — a recurring event missing its final occurrence, and a cancelled meeting that reappears. This is RFC-5545 recurrence handling (RRULE/UNTIL/EXDATE/STATUS:CANCELLED); I won't guess-patch the parser without a failing case to test against. Drop a sanitized .ics and I'll write the characterization test + fix.
+RFC 5545 conformance holes in =modules/calendar-sync.el=, all agenda-visible (from the 2026-06 config audit):
+- =:973,1015,1024= — UNTIL treated as exclusive (strict =calendar-sync--before-date-p=); RFC and Google make it inclusive, so the LAST instance of every UNTIL-bounded series vanishes. Tests assert loose count ranges, so it's unpinned. Allow equality.
+- =:578= — comma-separated EXDATE lists (Google emits them) never parse; the exclusion drops silently and cancelled occurrences reappear on the agenda. Split on "," before parsing; no comma-case test exists.
+- =:902= — timed events without DTEND render as all-day (time lost); multi-day all-day spans collapse to one day (end date unused, exclusive-DTEND unhandled). Emit start-time-only stamps and org date ranges.
+-----
+
+2026-06-20 Sat @ 22:52:51 -0400 Can't reproduce. closing
+** DONE [#A] Native compilation disabled config-wide; GC at stock 800KB :bug:next:
+CLOSED: [2026-06-20 Sat]
+Both fixed 2026-06-20. =early-init.el:69= was =(setq native-comp-deferred-compilation nil)= — the obsolete alias of =native-comp-jit-compilation= — which turned JIT native-comp OFF entirely (not "synchronous"); replaced with =(setq native-comp-jit-compilation t)= + =native-comp-async-report-warnings-errors 'silent=. The old "Selecting deleted buffer" async race was an Emacs 28/29 issue; this is 30.2. GC: dropped the early-init post-startup restore to stock 800KB and the system-defaults minibuffer setup/exit hooks, replaced with gcmh (idle-delay 'auto, 1GB high threshold) — keeps the threshold high during activity, collects on idle. Verified via a clean throwaway-daemon launch (native-comp-jit t, gcmh-mode t, no backtrace) and a batch proof of gcmh's threshold cycle; applied live to the running daemon. Restart confirmation filed under Manual testing and validation.
+** DONE [#C] Dirvish: free D for hard-delete, move duplicate :feature:quick:next:
+CLOSED: [2026-06-20 Sat]
+Decided with Craig 2026-06-20: remove delete-to-trash entirely, bind =d= = =cj/dirvish-duplicate-file= and =D= = =cj/dirvish-hard-delete= (sudo rm -rf after a =yes-or-no-p= naming the exact targets). Built in =modules/dirvish-config.el= (=cj/--dirvish-hard-delete-command= pure builder + =cj/dirvish-hard-delete= command; keymap =d=/=D= swap). 4 ERT tests for the command builder; full suite green; live-reloaded into the daemon (=dirvish-mode-map= =d=/=D= rebinding confirmed). Manual keypress + sudo-flow check filed under Manual testing and validation.
+** DONE [#C] Pull a fullscreen terminal window away with C-; b + arrow :feature:next:
+CLOSED: [2026-06-20 Sat]
+Decided with Craig 2026-06-20: when the selected window is the sole window, =C-; b= + arrow keeps that window on the arrow's edge and slivers =other-buffer= in on the opposite side (=minimize-window=, so the current window keeps almost the whole frame), focus staying put; each further arrow then shrinks it step by step via =windsize=, reading the same as resizing an existing split. Generalizes to any sole window, not just terminals — resize was a no-op there before. Built in =modules/ui-navigation.el= (=cj/window-pull-side= pure mapping + =cj/window--pull-away= + a =one-window-p= branch in =cj/window-resize-sticky=). ERT tests for the mapping and both sticky paths; geometry verified in a headless frame (down -> terminal 37/40 at the bottom, reveal 2 lines slivered on top via window-min-height=1, windsize-down then steps it down); full suite green; live-reloaded into the daemon. Refined from a first cut that split toward the arrow and jumped to 50%, per Craig's feedback. Manual gesture check filed under Manual testing and validation.
+** DONE [#B] Migrate All Terminals From Vterm to Ghostel
+CLOSED: [2026-06-20 Sat 22:50]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-04
+:END:
+Replace vterm with ghostel (libghostty-vt) as the single terminal engine across every workflow, and rename ai-vterm → ai-term. References: [[file:docs/2026-05-25-emacs-terminal-comparison.org][docs/2026-05-25-emacs-terminal-comparison.org]] (vterm vs eat vs ghostel research); migration spec [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][docs/specs/vterm-to-ghostel-migration-spec-implemented.org]] (READY; external review incorporated 2026-06-04, D1-D7 agreed). Build in 5 phases (0-4); see the spec's Implementation tasks block.
+
+Decisions D1-D7 are settled in the spec's Agreed-decisions section. Build order below; each phase stays green (suite + byte-compile) at every step.
+
+*** 2026-06-20 Sat @ 22:49:41 -0400 Follow-up: theme ghostel ANSI faces in dupre
+D2 — set the 16 ghostel-color-* + ghostel-default faces in dupre-faces/palette.
+Roam-inbox note (2026-06-14): theme-studio assignments don't reach ghostel — it paints from its own ANSI palette, not the theme. Also investigate ghostel's property-file color mechanism as an alternative and surface the options for working with that limitation.
+
+*** 2026-06-20 Sat @ 22:50:28 -0400 CANCELLED [#B] Follow-up: evaluate ghostel-eshell + ghostel-compile
+CLOSED: [2026-06-20 Sat 22:49]
+D3 — ghostel-eshell as eshell visual backend; ghostel-compile against F4 dev-fkeys.
+
+*** 2026-06-20 Sat @ 22:50:32 -0400 DONE [#B] Investigate ghostel selection/highlight color
+CLOSED: [2026-06-20 Sat 22:50]
+Look at how selected text is highlighted in a ghostel buffer — the region face in =ghostel-copy-mode= and any live selection — surfaced during the copy-mode debugging. Check whether the highlight is legible against the dupre background and consistent with the rest of the config; if it needs theming, fold it in with D2 (theming the ghostel faces in dupre).
+
+*** 2026-06-04 Thu @ 23:57:09 -0500 Phase 0 done: characterization baseline green
+=make test= green except the 5 documented pre-existing failures (4 test-dupre-theme, 1 test-init-module-headers), none terminal-related. Characterization coverage already present + green for all six must-survive behaviors: vterm-toggle--dispatch/display/buffer-filter, vterm-tmux-history, ai-vterm--show-or-create/launch-command/f9-in-vterm, ui-config--buffer-cursor-state + vterm-copy-mode-cursor, dashboard-config-launchers. Add a characterization test before any behavior change in later phases if a gap appears.
+
+*** 2026-06-05 Fri @ 00:38:34 -0500 Phase 1 done: ghostel + term-config.el
+=modules/term-config.el= written (full port of vterm-config: tmux history/copy-mode-dwim preserved via process-tty-name + ghostel-send-string; F12 toggle + display rule + geometry; cj/term-map C-; x menu → ghostel commands; which-key "terminal menu"; ghostel-max-scrollback 10MB; C-; added to ghostel-keymap-exceptions; F12 + C-; in ghostel-mode-map; use-package ghostel guarded per D6). Dropped: mouse-wheel SGR forwarding, vterm-timer-delay hacks, copy-mode cursor hook, goto-address hook. ghostel installed into elpa (MELPA + auto-downloaded native module). Tests: test-term-toggle--{dispatch,display,buffer-filter} + test-term-tmux-history (16) ported with a ghostel stub in testutil-ghostel-buffers; all green.
+
+*** 2026-06-05 Fri @ 00:38:34 -0500 Phase 2 done: ai-vterm→ai-term on ghostel
+=modules/ai-vterm.el= → =modules/ai-term.el=: 6 vterm call sites swapped to ghostel (buffer named via let-bound ghostel-buffer-name + pinned ghostel-buffer-name-function so OSC titles don't rename agent buffers); F9/C-F9/M-F9 on global + ghostel-mode-map; refuse-in-terminal guard removed (D4 — F9 launches in TTY frames); tmux-suppression invariant preserved (cj/--ai-term-suppress-tmux). 23 ai-vterm tests renamed → test-ai-term--* (terminal-guard test deleted, obsolete); show-or-create + f9-in-term rewritten for ghostel; all green. ui-config cursor-state ported (ghostel-mode + ghostel--input-mode; copy/emacs = read-only, else writeable) + its test. init.el now requires term-config + ai-term; vterm-config.el + ai-vterm.el deleted. Full suite green except the 5 documented pre-existing failures (4 dupre-theme, 1 init-module-headers/popper-config-missing — both unrelated). validate-modules ✓; full early-init+init smoke clean (no ghostel/term/ai-term errors). vterm package still installed (Phase 4) — dashboard "Launch VTerm" + dormant auto-dim still reference it until Phase 3/4. Restart Emacs to pick up ghostel (load-order + use-package :config change).
+
+*** 2026-06-05 Fri @ 00:50:58 -0500 Phase 3 done: satellites ported to ghostel
+Deleted auto-dim's vterm color-advice + redraw integration (~165 lines; D1 — terminals don't dim, ghostel bakes its palette per-terminal so there's no per-window color hook); dashboard launcher → =(ghostel)= + "Launch Terminal" label; cj-window-geometry/toggle-lib doc comments; module-inventory + init-load-graph doc refs. (ui-config cursor-state + init.el requires landed in Phase 2.) Trimmed test-auto-dim-config (dropped the 6 vterm tests) + updated the dashboard-launcher test stub. Incidental: removed the stale =popper-config= entry from the test-init-module-headers allowlist (the file doesn't exist + isn't required) — fixes the long-standing pre-existing test failure.
+
+*** 2026-06-05 Fri @ 00:50:58 -0500 Phase 4 done: vterm + vterm-toggle removed
+=package-delete='d vterm + vterm-toggle from elpa. No vterm refs remain in modules/init except intentional historical comments. Suite green except the 4 pre-existing dupre-theme failures (the popper-config one is now fixed). validate-modules ✓; full early-init+init batch smoke = INIT-SMOKE-OK. The migration parent stays DOING until Craig restarts Emacs and walks the ghostel manual-verify matrix under "Emacs Manual Testing and Validation".
+
+*** 2026-06-05 Fri @ 14:24:02 -0500 Auto-dim revisit cancelled — current no-dim behavior is fine
+Craig confirmed the shipped auto-dim setup works fine as-is: terminal buffers don't participate in unfocused-window dimming (D1), and the rest of auto-dim behaves. That is the measured decision the original task asked for — option (a), keep no-dim — so no rework (the focus-loss palette-blend in option (b) or an upstream per-window hook in option (c)) is needed. Closing without further investigation. Context: [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][migration spec]] D1.
+
+*** 2026-05-26 Tue @ 15:15:43 -0500 Direction confirmed; Claude Code in eat needs a caveat
+Craig confirmed the consolidation: one terminal engine everywhere — eat for standalone terminal buffers (replacing vterm) plus =eat-eshell-mode= as eshell's visual backend, keeping eshell as the shell. Not dropping eshell for eat + zsh.
+
+Researched whether Claude Code runs cleanly in eat (Craig runs it in his Emacs terminal). Verdict: mostly, with caveats. eat is the default backend for claude-code.el and renders the TUI with color and full key handling, but there is an eat-specific bug where Claude Code's input handling makes the buffer scroll-pop to the top on window-buffer changes and the input box can get stuck mid-buffer (recoverable, but it does not happen in vterm or ghostel), and eat runs about 1.5x slower than vterm on heavy streaming output. claude-code.el's own docs name ghostel as the most faithful Claude TUI renderer.
+
+Recommendation: consolidate everyday terminals onto eat, but keep ghostel (or vterm) for the Claude Code workflow specifically — the scroll-pop / stuck-input bug and the slower heavy-stream handling are exactly what bites a long Claude session. Sources: [[https://github.com/cpoile/claudemacs][claudemacs]], [[https://github.com/stevemolitor/claude-code.el][claude-code.el]], [[https://codeberg.org/akib/emacs-eat][emacs-eat]].
+
+Eval plan (from the research doc): install EAT alongside vterm, run the same workloads through both, decide. Test matrix: Claude Code TUI, lazygit, htop/btop, yazi, a heavy-output build, ssh to a remote, and eshell with =eat-eshell-mode=. Assess rendering fidelity, stability under heavy output, and Emacs-native line editing. Switch only if it covers every workflow without regression.
+
+*** 2026-06-02 Tue @ 14:12:48 -0500 Audit: eval plan not yet run; back to TODO
+Task audit found no eval work recorded since the 2026-05-26 direction-confirmed note. The test matrix above is unrun, so the task isn't actively in progress — moved DOING back to TODO until the eval starts.
+
+*** 2026-06-04 Thu @ 22:40:27 -0500 Pivot: ghostel as the single engine (not eat)
+Direction changed from eat-everyday + ghostel-for-Claude to ghostel-for-everything, and the task is now a migration rather than an eval. Rationale: ghostel is claude-code.el's most-faithful Claude TUI renderer and the fastest engine (81 vs vterm 34 vs eat 4.9 MB/s), and an audit confirmed it exposes an analog for every vterm primitive this config uses (=ghostel-send-string=, =ghostel-keymap-exceptions=, =ghostel-copy-mode=, =ghostel-clear-scrollback=, =ghostel-send-next-key=, =ghostel-next-prompt= / =ghostel-previous-prompt=, =ghostel-max-scrollback=, =ghostel-kill-buffer-on-exit=). eat's washed colors, the scroll-pop / stuck-input bug under Claude Code, and slowest throughput made it the weaker single-engine pick; one engine beats running two. Surface audited: 2 main modules (=vterm-config.el=, =ai-vterm.el=) + 4 satellites (=auto-dim-config.el= is the heavy one) + ~35 test files + init.el. Next: spike ghostel read-only to answer the open migration questions (auto-dim rework — ARCHITECTURE.md forbids the around-redraw color advice vterm uses; tmux pane-id via =process-tty-name= on a ghostel process; buffer naming; TTY-frame behavior; copy-mode keybinding parity), then write the migration spec under =docs/design/= and review it.
+
+*** 2026-06-04 Thu @ 23:17:54 -0500 Spec review: not ready until decisions and handoff shape are closed
+Ran the spec-review workflow against [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][docs/specs/vterm-to-ghostel-migration-spec-implemented.org]] and wrote a companion review file (incorporated and deleted 2026-06-04). Verdict: =Not ready=. Direction is sound, but the draft still has open D1-D5 decisions, lacks the workflow-required =Implementation phases= section and acceptance criteria, and needs explicit ghostel package/native-module failure behavior before implementation tasks can be emitted.
+
+*** 2026-06-04 Thu @ 23:24:28 -0500 Spec-response: review incorporated, raised to READY
+Folded the external review via spec-response. Craig accepted D1-D5; baked them plus D6 (module-failure = degrade-with-warning, modifying the reviewer's fail-loud) and D7 (=ghostel-max-scrollback= 10 MB) into a new Agreed-decisions section. Added Implementation phases (0-4), Acceptance criteria, Dependency/module-failure behavior, Test strategy, per-phase key/menu ownership, the tmux-suppression contract, and an Implementation-tasks drop-in block. Status DRAFT → READY; review file deleted. Build is now unblocked.
+
+*** 2026-06-04 Thu @ 23:30:18 -0500 External re-review: ready
+Re-reviewed [[id:b54c94a0-d762-4b41-afd7-cf5593ce6675][docs/specs/vterm-to-ghostel-migration-spec-implemented.org]] after incorporation. Verdict: =Ready=. No further blocking review notes; implementation can start from the phase plan and acceptance criteria in the spec.
+** DONE [#A] erc-yank silently publishes >5-line pastes as public gists :bug:quick:solo:
+CLOSED: [2026-06-20 Sat]
+Dropped erc-yank 2026-06-20 (Craig's call: drop, not harden). The package turned a >5-line paste into a PUBLIC gist (=gist -P=, the clipboard-paste flag, no =--private=) behind a single y-or-n-p, with no executable-find guard for =gist=. It also gisted the system clipboard rather than the kill-ring text being yanked. No replacement binding needed: =erc-mode-map= defines no C-y of its own, so removing the package lets C-y fall through to the ordinary global =yank=. Verified live: effective C-y in an ERC buffer = =yank=. (Audit's "no confirmation" was slightly off — the package did prompt — but public-by-default + one-keystroke confirm + no guard made dropping it the clean fix.)
+** DONE [#B] C-<left>/<right>/<down> wrongly enter terminal copy-mode :bug:quick:
+CLOSED: [2026-06-24 Wed]
+Fixed 2026-06-24: per Craig, only C-<up> enters copy-mode now — all other arrows (C-<down>/<left>/<right> and the M-arrows) were dropped from both the ghostel-mode-map binding and ghostel-keymap-exceptions in modules/term-config.el, so C-<left>/C-<right> reach the shell as readline word-motion again. Also per Craig: C-<up> pressed while already in copy-mode just moves up — cj/term-copy-mode-up checks tmux pane_in_mode (and ghostel--input-mode without tmux) and skips re-entry, which would otherwise reset the cursor. 6 ERT tests rewritten; byte-compile clean; the live daemon was stripped of the stale bindings/exceptions and reloaded (C-<up> bound + an exception, C-<left> forwarded to the pty). Real-terminal scroll is the VERIFY under Manual testing and validation.
+** DONE [#B] ai-term wrap-teardown + shutdown functions :feature:
+CLOSED: [2026-06-24 Wed]
+Done 2026-06-24: added the three headless functions to =modules/ai-term.el= per the rulesets contract — =cj/ai-term-quit= (kill aiv- session + agent buffer + restore layout, idempotent), =cj/ai-term-live-count= (integer gate), =cj/ai-term-shutdown-countdown= (gate re-check → abort-able run-at-time countdown → =cj/ai-term-shutdown-command=, a defcustom). Reused the existing kill/close helpers. 13 ERT tests (live-count parsing, quit kill+idempotency, gate-abort/cancel/tick); byte-compile + validate-modules + launch smoke clean; headless contracts verified live in the daemon (live-count→3, quit no-op returns the session name, countdown aborted with sessions live — no shutdown). The tmux/shutdown side effects and the both-sides end-to-end are a VERIFY under Manual testing and validation. Original task body:
+The .emacs.d half of the rulesets wrap-it-up teardown / shutdown feature. Implement three functions in =modules/ai-term.el=, all callable headlessly via =emacsclient -e= (no interactive frame): =cj/ai-term-quit "<project>"= (teardown a project's aiv- tmux session + buffer + geometry restore), =cj/ai-term-live-count= (integer, the safety gate), =cj/ai-term-shutdown-countdown= (run-at-time timer). Craig's 2026-06-23 decisions: non-destructive qualifier = "with summary"/"and summarize"; countdown is a run-at-time timer (not a tty writer); safety gate uses cj/ai-term-live-count. Lands with the rulesets half (workflow + Stop hook already built/pushed). Spec: =inbox/PROCESSED-2026-06-23-2331-from-rulesets-ai-term-teardown-companion.org= (rulesets proposal: docs/design/2026-06-23-wrap-teardown-shutdown-proposal.org). Own focused session.
+** DONE [#C] README holistic pass
+CLOSED: [2026-06-24 Wed]
+Holistic pass over README.org, changes approved by Craig: bumped the Emacs floor to 30 (developed on 30.2); corrected the module count (~100 → ~120); added docs/ to the layout and reworded scripts/ (now also theme-studio); added Theme Studio, the ghostel native terminal, and ai-term to Features; added make coverage-summary to the dev targets. From the roam inbox.
+** DONE [#B] Theme-driven nerd-icons colors + filetype legend :feature:
+CLOSED: [2026-06-24 Wed]
+Dropped the runtime nerd-icons tint so icon color is theme-driven, and added a
+theme-studio filetype-legend representation over the 34 =nerd-icons-*= color
+faces. Spec:
+[[file:docs/specs/theme-studio-nerd-icons-colors-spec.org][theme-studio-nerd-icons-colors-spec.org]].
+Three Codex spec-review rounds (3 + 6 + 1 findings) incorporated; findings
+[10/10], decisions [6/6]. Ready confirmed 2026-06-24 and implemented in a
+no-approvals speedrun as the four dated phases below — full run-tests.sh and
+=make test= green, all pushed. Live visual confirmation is a VERIFY under
+Manual testing and validation. vNext follow-ups promoted to their own [#D] task.
+*** 2026-06-24 Wed @ 05:54:34 -0400 Phase 1 — legend capture shipped
+=scripts/theme-studio/build-nerd-icons-legend.el= resolves the 13 v1 rows from the live nerd-icons alists into =nerd-icons-legend.json= (committed); =generate.py='s =load_nerd_icons_legend= validates and falls back to the generic app on absent/malformed/empty/bad-row, with a warning. 7 Python tests. Committed (feat phase 1).
+*** 2026-06-24 Wed @ 05:54:34 -0400 Phase 2 — bespoke legend preview shipped
+nerd-icons registers as a bespoke app whenever the legend is valid (=add_nerd_icons_app=); =renderNerdIconsPreview= draws each row's glyph in its mapped face color through the shared registry, so recolor repaints live; the 34 faces stay editable. =#nerdiconstest= gate covers the wiring, the dir-row owner, and the recolor-repaint. Committed (feat phase 2).
+*** 2026-06-24 Wed @ 05:54:34 -0400 Phase 3 — tint removed, theme drives color
+Removed =cj/nerd-icons-tint-color= + =cj/--nerd-icons-color-faces= + =cj/nerd-icons-apply-tint= and both call sites from =nerd-icons-config.el=; the WIP theme already owned the 34 faces (theme-studio auto-discovered them), so color is theme-driven now. Kept =cj/--nerd-icons-color-dir=. Deleted the apply-tint test. validate-modules + launch smoke clean. Committed (feat phase 3).
+*** 2026-06-24 Wed @ 05:54:34 -0400 Phase 4 — dir-precedence probe + round-trip
+ERT probe locks the dir-precedence decision (prepended =nerd-icons-yellow= is first in the face list, wins over =nerd-icons-completion-dir-face=); =#nerdiconstest= extended with the export/import round-trip over an assigned nerd-icons color and a dir-face-stays-out check. Full run-tests.sh + =make test= green. Committed (test phase 4). Live visual is the VERIFY under Manual testing.
+** DONE [#B] ai-term keybinding home :feature:
+CLOSED: [2026-06-23 Tue]
+Done 2026-06-23 (commit be772bc0): family moved to C-; a (a toggle, s select/launch, n next, k kill), swap also on M-SPC, F9 family retired, jumper's M-SPC binding removed (rehome pending). cj/ai-term-next now opens the picker when no agent is running instead of erroring. Bindings verified live in the daemon; Craig's hands-on check is filed under Manual testing and validation.
+Move the ai-term commands off the F9 family. F9 sits somewhere semi-dangerous
+to hit, and F8 (org-agenda) is slow to load, which reads as Emacs being
+unresponsive. Craig wants three commands on an easy near-home-row chord: open
+the ai-term selection menu, switch to the next agent, and kill the current one
+(=cj/ai-term=, =cj/ai-term-next=, =cj/ai-term-close=). Explore C-, M-, and C-M-
+with SPC. Likely collides with jumper, but ai-term is used far more, so jumper
+yields. Archiving gptel this session freed the =C-; a= prefix, so the whole
+ai-term family could live under =C-; a= (or another near-home-row key).
+Related: the s-F9 detached-agent landing task and the tmux copy-mode binding
+task elsewhere in this section. From the roam inbox.
+** DONE [#C] Face coloring completion-read icons :quick:solo:
+CLOSED: [2026-06-23 Tue]
+Answered 2026-06-23 (investigation, no code change). There is no single
+"completion icon" face — each icon inherits a per-type =nerd-icons-*= color
+face (a .el file icon inherits =nerd-icons-purple=, an M-x command icon
+=nerd-icons-blue=, etc.; nerd-icons picks the face per glyph/filetype). What
+makes every completion icon render the SAME color here is this config's bulk
+tint: =cj/nerd-icons-tint-color= (defcustom in =nerd-icons-config.el=, default
+"darkgoldenrod") sets the foreground of all ~33 =nerd-icons-*= color faces via
+=cj/nerd-icons-apply-tint=, applied in the =nerd-icons= =:config=. Verified live:
+=nerd-icons-icon-for-file "init.el"= -> =:inherit nerd-icons-purple=, and that
+face's foreground is "darkgoldenrod". Directory icons additionally get
+=nerd-icons-yellow= layered on by =cj/--nerd-icons-color-dir= advice
+(=nerd-icons-completion-dir-face= is unset, so it isn't the driver here).
+To theme: change =cj/nerd-icons-tint-color= (one color for all icons, then call
+=cj/nerd-icons-apply-tint=), or drop the bulk tint and set the individual
+=nerd-icons-*= color faces for per-filetype colors. For theme-studio, the knob
+to expose is =cj/nerd-icons-tint-color= plus the =nerd-icons-*= face family.
+** DONE [#C] Org formatting inside cj comments :feature:
+CLOSED: [2026-06-23 Tue]
+Done 2026-06-23: mapped the "cj:" src-block language to org-mode via
+=org-src-lang-modes= in =org-babel-config.el=. Effect: a cj comment block's
+prose now gets org font-lock in place (links, *bold*, lists styled — verified
+live, the link inside a block carries the =org-link= face), and =C-c '= opens a
+full org-mode buffer to edit it. Approach A from the design walk: non-breaking,
+the =cj:= grep marker and the whole cj-processing pipeline are unchanged. The
+block stays a src block, so org's parser still treats its body as code — links
+are followed from the =C-c '= buffer rather than clicked in place. If that
+in-place limitation bites, Approach B (migrate to a =#+begin_cj= special block)
+is the documented escalation.
+Craig writes free-form prose inside cj comment blocks (=#+begin_src cj: ...=)
+and wants org formatting available there.
+From the roam inbox.
+** DONE [#C] term: M-<arrow> enters tmux copy-mode :feature:
+CLOSED: [2026-06-24 Wed]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-22
+:END:
+Done 2026-06-24: C-<up>/<down>/<left>/<right> and M-<arrow> in =ghostel-mode-map= enter copy-mode and carry their direction in one stroke (=cj/term-copy-mode-up= & friends -> =cj/term-copy-mode-move= -> =cj/term-copy-mode-dwim= then =cj/--term-copy-mode-move-step=). tmux path writes the arrow escape sequence into the pty; non-tmux path moves point in =ghostel-copy-mode=. All 8 keys added to =ghostel-keymap-exceptions= + =ghostel--rebuild-semi-char-keymap= (the gotcha). Ghostel-only. 6 new ERT tests; bindings + exceptions + the dwim sequence verified live in the daemon. The real tmux copy-mode scroll is a VERIFY under Manual testing and validation.
+
+Folded 2026-06-23 from the roam inbox: Craig also wants C-<up> (control + up arrow) to enter tmux copy-mode and move up in one stroke — i.e. a modified arrow both enters copy-mode and passes the movement (copy-mode + arrow). So the binding set is the modified arrow keys (M-arrow and/or C-arrow), each entering copy-mode and carrying its own direction.
+** CANCELLED [#C] page-signal pager account deregistered — re-registration needs your hands
+CLOSED: [2026-06-21 Sun]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-12
+:END:
+Reported by .emacs.d 2026-06-12 01:01: the dedicated pager number (+15045173983, the Claude Pager Google Voice number on signal-cli) returns "User ... is not registered" on every send — Signal appears to have deregistered it (GV numbers get periodically re-verified). Re-registration requires captcha/SMS, which only you can do. Until then every page-signal call fails; .emacs.d's config-audit page fell back to email. Wrapper lives at claude-templates/bin/page-signal.
+** DONE [#B] mu4e: cmail can't trash, no account can refile :bug:quick:solo:
+CLOSED: [2026-06-24 Wed]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-13
+:END:
+=modules/mail-config.el:217-220= — the cmail context (primary account) sets only drafts/sent, so D falls back to default "/trash" which doesn't exist under ~/.mail (=/cmail/Trash= does); and NO context sets =mu4e-refile-folder=, so r targets nonexistent "/archive" everywhere. Accepting mu4e's offer to create the maildir strands mail in a directory mbsync never syncs — messages silently vanish from the server's view. Add =mu4e-trash-folder= to cmail + per-context =mu4e-refile-folder=. From the 2026-06 config audit.
+Fixed 2026-06-13: cmail gets =mu4e-trash-folder= "/cmail/Trash"; refile is a per-message function (=cj/mu4e--refile-folder=) instead of a per-context string — mu4e context :vars are sticky, so a per-context refile leaks one account's archive folder into another. cmail → "/cmail/Archive"; gmail/dmail signal a =user-error= rather than move mail into an unsynced phantom folder (Craig chose the fail-safe over syncing [Gmail]/All Mail — the All Mail option means a multi-GB pull + cross-folder duplicates; revisit if local Gmail archiving is wanted). Applies on next mu4e open; pure dispatch helper covered by tests.
+** CANCELLED [#C] Lock screen silently fails — slock is X11-only :bug:quick:
+CLOSED: [2026-06-21 Sun]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-13
+:END:
+=modules/system-commands.el:105= binds the lockscreen command to =slock=, which can't grab a Wayland session; =cj/system-cmd= launches it detached with output silenced, so C-; ! l does nothing and the screen never locks. Security issue: Craig believes the screen locks when it doesn't. Fix: =hyprlock= (or =swaylock=), ideally resolved per session type via =env-wayland-p= so an X11 fallback survives for other machines. From the 2026-06 config audit.
+Fixed 2026-06-13: lockscreen-cmd resolves to =loginctl lock-session= on Wayland (logind Lock → hypridle → hyprlock, the path idle/sleep locking already uses), =slock= on X11; also added the missing =(require 'host-environment)=. Live in the daemon; manual lock test under the Manual testing parent.
+** CANCELLED [#B] AI Open Work
+CLOSED: [2026-06-23 Tue]
+gptel archived 2026-06-23 to archive/gptel/ (rarely used). The child issues below — ai-rewrite directive plumbing, ai-conversations bugs, the stale-elpa / gptel-magit shadow, model-switch dedup — are all moot against archived code. Kept for reference; detail also in git history.
+*** CANCELLED [#B] ai-rewrite: chosen directive never reaches the request :bug:solo:
+=modules/ai-rewrite.el:64= — the directive is let-bound around =(call-interactively #'gptel-rewrite)=, but gptel-rewrite is a transient prefix that returns when the menu shows; the send resolves the directive AFTER the binding unwound (verified against ~/code/gptel/gptel-rewrite.el:780-799). The picker's choice is silently dropped — the module's core feature is inert. Set =gptel--rewrite-directive= buffer-locally (restore via =gptel-post-rewrite-functions=) or use a self-removing global hook entry. From the 2026-06 config audit.
+
+*** CANCELLED [#B] Stale elpa gptel shadows the local fork — likely the gptel-magit root :bug:quick:solo:next:
+Needs from Craig: can't be done standalone. I tried deleting elpa/gptel-0.9.8.5 — the fork loaded fine and gptel-magit still worked via use-package autoloads, but package activation then printed "Unable to activate gptel-magit / Required gptel-0.9.8 unavailable" on every startup, so I reverted. To remove the shadow we must also resolve gptel-magit's package dependency: either drop gptel-magit's package dep (load it via load-path like the gptel fork), or repackage the fork into .localrepo as gptel. Tell me which and I'll do it; this pairs with the gptel-magit investigation.
+=elpa/gptel-0.9.8.5= is still installed alongside the =~/code/gptel= fork (=ai-config.el:383=); package activation puts the elpa dir + autoloads on load-path, so which copy wins depends on ordering, and a mixed load (fork .el + elpa .elc) produces "impossible" bugs. =gptel-magit= (elpa) declares gptel as a dependency, so IT may be pulling the stale copy — check this first when working the open "[#B] Investigate gptel-magit not working properly" task. Fix: =package-delete= the elpa gptel + remove from .localrepo so the fork is the only copy on disk. From the 2026-06 config audit.
+
+2026-06-15: tried deleting =elpa/gptel-0.9.8.5= standalone. The fork loaded correctly and gptel-magit still worked via use-package =:commands= autoloads, BUT package activation then printed "Unable to activate package gptel-magit / Required package gptel-0.9.8 unavailable" on every startup and test run (gptel-magit declares gptel as a package dependency that no longer resolves). Reverted. This can't be done standalone — it must be paired with the gptel-magit dependency fix (drop gptel-magit's package dep, or repackage the fork into .localrepo as gptel). Do it together with the gptel-magit investigation task.
+
+*** CANCELLED [#B] ai-conversations: dead-buffer load, role flattening, non-atomic writes :bug:solo:
+From the 2026-06 config audit, =modules/ai-conversations.el=:
+- =:324= — load in a fresh session does =get-buffer-create "*AI-Assistant*"= (plain fundamental-mode buffer); =--ensure-ai-buffer= then sees it exists and never calls =(gptel)=. Sending doesn't work, autosave self-cancels (requires gptel-mode). Use =get-buffer= for the check; let ensure create. The browser RET/l path inherits this.
+- =:240= — persistence drops gptel's =response= text properties, so a reloaded history replays to the model as ONE user message (model re-reads its own answers as Craig's words). Adopt gptel's native bounds persistence or re-mark on load from the "* Backend:" headings.
+- =:248= — =write-region= straight at the target; crash mid-write truncates the only copy of the history (autosave hits this constantly). Temp + rename.
+- =:140= — three overlapping autosave mechanisms (after-send advice that fires before the response exists, post-response hook, 60s timer). Keep the hook; drop the advice (and likely the timer).
+
+*** CANCELLED [#B] Dedup gptel model-switch commands — keep switch-backend or fold into change-model :bug:
+=cj/gptel-change-model= (C-; a m) already does backend+model switching and interns correctly, so =cj/gptel-switch-backend= (C-; a B) is arguably redundant now that its crash is fixed. Decision for Craig: keep both, or delete =cj/gptel-switch-backend= plus its C-; a B binding and keep one model-switch command. From the 2026-06 config-audit follow-up.
+** DONE [#B] agenda sources: roam Projects missing, no existence filtering :bug:solo:
+CLOSED: [2026-06-24 Wed]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-20
+:END:
+Done 2026-06-24, both parts: (1) per Craig, corrected the docs rather than implementing roam-Project agenda scanning — the commentary + two docstrings claimed org-roam "Project" nodes are agenda sources, but they were never scanned; roam Project/Topic notes are refile targets (org-refile-config.el), not agenda sources. (2) =cj/--org-agenda-base-files= now drops non-existent files and =org-agenda-skip-unavailable-files= is set as a backstop, in the one shared helper so the agenda builders, single-project view, and chime initializer all get it. base-files tests reworked to drive real temp files (+ a drops-missing case); byte-compile clean; live-verified (skip var t, base-files returns only existing). From the 2026-06 config audit, =modules/org-agenda-config.el=:
+- =:182-191= — commentary and docstrings promise org-roam nodes tagged "Project" as agenda sources, but =cj/--org-agenda-scan-files= never scans them, and files added by the roam finalize-hook are wiped on the next =cj/build-org-agenda-list= cache rebuild (≤1h). Add a roam Project pass (mirror =org-refile-config.el:101-109=) or correct the docs.
+- =:186,456= — agenda file list built unconditionally (inbox/calendars may not exist on a fresh machine) and =org-agenda-skip-unavailable-files= is unset — the exact interactive-prompt class that once hung the chime daemon. Filter with =file-exists-p= + set the var as backstop.
+** DONE [#B] F7 diff-aware coverage classifies every changed file "not tracked" :bug:solo:
+CLOSED: [2026-06-22 Mon]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-20
+:END:
+Fixed 2026-06-22: simplecov keys are absolute, git-diff keys repo-relative, so the exact-key intersect never matched. Added =cj/--coverage-relativize-keys= and normalize both tables to repo-relative in =cj/--coverage-read-and-display= before the intersect; intersect unchanged. New =test-coverage-core--relativize-keys.el= (5 unit + 1 integration through the real parsers). Full suite green.
+=modules/coverage-core.el:252= — =cj/--coverage-intersect= joins covered×changed by exact string key, but simplecov.json keys are ABSOLUTE paths while the git-diff parser returns repo-RELATIVE ones — zero matches ever, so working-tree/staged/branch scopes report ":tracked nil" for everything and F7's main feature is inert (whole-project scope works, same-source keys). Unit tests hand-build matching keys so they pass; add one integration test feeding a real undercover report + real diff. Normalize both sides to repo-relative. From the 2026-06 config audit.
+** DONE [#B] jumper: register collisions and dead-marker errors :bug:solo:
+CLOSED: [2026-06-22 Mon]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-13
+:END:
+Fixed 2026-06-22: (1) store now allocates the first unused register char in the live slice (=jumper--first-free-register=) instead of by next-index, and removal clears the freed register, so a store after a removal no longer overwrites a surviving slot's marker; (2) =jumper--with-marker-at= guards =(buffer-live-p (marker-buffer marker))= so killed-buffer entries are skipped instead of signaling wrong-type errors; (3) the single-location toggle jumps back to the last-location register when set (returns =jumped-back=). New =test-jumper--register-hygiene.el= (8 tests); all 42 jumper tests green. Pre-existing unused-lexical =i= warning in =jumper--location-exists-p= left alone (separate nit).
+Two related defects from the 2026-06 config audit:
+- =modules/jumper.el:155= — removal shifts the vector without renumbering registers, so a later store allocates a register still held by a surviving location and silently overwrites it. Allocate the first free register char in the live slice; =set-register nil= on removal so freed markers don't pin buffers.
+- =modules/jumper.el:117,132= — guards check =(markerp marker)= but not =(buffer-live-p (marker-buffer marker))=; after killing a buffer holding a location, M-SPC SPC and M-SPC j signal wrong-type errors. Treat dead entries as skippable/removable.
+Also =jumper.el:178= — the promised single-location toggle never toggles back ('already-there branch should =jump-to-register= z when set).
+** DONE [#C] face-diagnostic: face-name buttons + header allowlist :feature:quick:solo:
+CLOSED: [2026-06-24 Wed]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+Done 2026-06-24: (a) =cj/--face-diag-face-button= renders each real face name in the report as a =buttonize='d button that runs =describe-face= on it (carries the face as button-data); anonymous specs and non-faces stay plain. Routed through the stack, overlay, remap, and provenance render sites. (b) Added =face-diagnostic= to =test-init-header--classified-modules= (it's required in init.el and already carries the header contract). 5 new ERT tests; button text properties confirmed live in a rendered *Face Diagnosis* buffer. Click/RET sign-off is a VERIFY under Manual testing and validation. Spec: [[id:98f065cf-8bd5-46a0-ac24-da94d66855ad][face-font-diagnostic-popup-spec-implemented.org]].
+** DONE [#C] latexmk workflow never activates (two breaks) :bug:quick:solo:
+CLOSED: [2026-06-24 Wed]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+Done 2026-06-24: changed the :hook key from =TeX-mode-hook= to =TeX-mode= (use-package appends "-hook" only to non-"-mode" symbols, so this now registers on the real =TeX-mode-hook= instead of the unbound =TeX-mode-hook-hook=), and auctex-latexmk from =:defer t= to =:after tex= so =auctex-latexmk-setup= runs when AUCTeX loads. Confirmed both breaks via macroexpand (the dump showed =add-hook 'TeX-mode-hook-hook= before, =TeX-mode-hook= after). 2 new regression ERT tests; live-verified in a real .tex buffer: =TeX-command-default= is "latexmk" and "LatexMk" is in =TeX-command-list=. Actual C-c C-c compile is a VERIFY under Manual testing and validation. From the 2026-06 config audit.
+** CANCELLED [#C] the preview splits an already split window into 3 temporarily. :bug:
+CLOSED: [2026-06-21 Sun]
+looks strange. potentially problematic for ai-terms.
+** CANCELLED [#C] TRAMP/dirvish "?" for remote dates — verify the fix per host :bug:
+CLOSED: [2026-06-21 Sun]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-02
+:END:
+
+Root cause is traced (see the dated investigation entry below). What's left needs a live remote: open each remote host in dirvish and run the three diagnostic evals to find which gate is closed, then close it.
+
+Diagnostics (run with point in a remote dirvish buffer):
+- =M-: (dirvish-prop :remote-async)= — nil means =tramp-direct-async-process-p= is failing for this method/host, so dirvish's remote attribute fetch never runs.
+- =M-: (dirvish-prop :gnuls)= — nil means the remote has no GNU =ls= (the =ls --version= probe failed), so the parser gate stays shut. Likely on truenas (FreeBSD).
+- =M-: (tramp-direct-async-process-p)= — confirms whether direct-async is actually active for the connection.
+
+Likely fixes, by which gate is closed:
+- =:gnuls= nil → install GNU coreutils on the remote (FreeBSD: =pkg install coreutils=) and make =ls= resolve to GNU on the TRAMP path, or accept "?" on that host.
+
+ - Constraint: nothing gets installed on the remote host, so the =:gnuls= gate is resolved by accepting "?" on that host rather than installing coreutils.
+- =:remote-async= nil → the scp/sshx method isn't advertising direct-async; switch to a method that supports it or check =tramp-direct-async-process= is taking effect for that protocol.
+
+Files involved: =modules/tramp-config.el=, =modules/dirvish-config.el=.
+
+*** 2026-05-22 Fri @ 20:24:44 -0500 Traced the root cause through dirvish source
+Remote dates/sizes don't come from the dired =ls= listing or =dired-listing-switches=. They come from =dirvish-data-for-dir= (=dirvish-tramp.el:95=), which runs =ls -1lahi= on the remote and parses the columns into the attribute cache. That method only fires when both =(dirvish-prop :remote-async)= is a number and =(dirvish-prop :gnuls)= is a string. When either gate is shut, dirvish falls back to its default, which deliberately skips =(file-attributes f-name)= for remote files (=dirvish.el:904=, a perf guard) — leaving attrs nil, so the file-size and file-time widgets render "?" (=dirvish-widgets.el:216,247=).
+
+That explains why every prior fix missed: dired-listing-switches feed a different code path entirely, and disabling =tramp-direct-async-process= shuts the =:remote-async= gate, which is the one path that populates remote attributes — exactly backwards. The config already enables direct-async for ssh/sshx (=tramp-config.el:79-88=), so the remaining closed gate is per-host: =:gnuls= (no GNU ls on FreeBSD-based truenas) or direct-async not taking effect for the method. Could not verify on a live remote from the work session — handed the per-host diagnostics up into the task body.
+** CANCELLED [#B] first f12 doesn't toggle the term window :bug:solo:
+CLOSED: [2026-06-25 Thu]
+Couldn't reproduce — neither could Craig (2026-06-25). The toggle code is clean (a single create-new -> ghostel on the first press, no second toggle), and the symptom pointed to an intermittent first-launch race, but with nobody able to reproduce it there's nothing to instrument. Cancelled; reopen with a live capture if it recurs.
+** DONE [#B] F12 pops EAT instead of ghostel :feature:studio:
+CLOSED: [2026-06-25 Thu]
+Done 2026-06-25, design doc =docs/design/eat-f12-toggle.org=. Part A (commit fe7aa658): F12 toggles a single EAT terminal instead of ghostel, reusing the dock-and-remember geometry toggle; ghostel stays for ai-term (M-SPC); EAT runs a plain shell with no tmux; F12 and C-; are bound in EAT's keymaps so they reach Emacs from inside the terminal. Part B (commit 687b438f): EAT's faces are exposed in theme-studio (16 named palette + attribute + prompt-annotation faces) with a =renderEatPreview=, no colors set so it stays vanilla. term 223/223, ai-term 158/158, studio gates green; the toggle wiring (F12 reaches Emacs in EAT, =(eat)= creates the buffer, the predicate recognizes it) was verified live in the daemon. Accepted tradeoff: EAT needs a buffer reload to pick up a theme switch (ghostel auto-resyncs), taken for EAT's pure-elisp face control. The visual F12 dock/toggle check is a VERIFY under Manual testing and validation.
+** DONE [#B] Consolidate on EAT, retire ghostel :feature:refactor:
+CLOSED: [2026-06-27 Sat]
+Make EAT the only terminal and remove ghostel entirely (decision 2026-06-25). Phased; the ai-term port (Phase 3) wants its own focused session with a spike first.
+- Phase 1 DONE (commit 82294404): extracted =modules/eat-config.el= (eat package + F12/C-; keymaps + the F12 dock-and-remember toggle) out of =term-config.el=. term-config keeps ghostel (ai-term's backend) and requires eat-config. Toggle tests retargeted to eat-config; full suite green.
+- Phase 2 DONE (commit 0290b015): EAT experience settings in eat-config.el -- yank-to-terminal on, directory-tracking / prompt-annotations / command-history / mouse / kill-from-terminal / alt-screen affirmed, 10MB scrollback, truecolor already on via the compiled =eat-truecolor= terminfo. zsh shell-integration source line added to =~/.dotfiles/common/.zshrc= (uncommitted -- needs a dotfiles commit + a pull on the other daily driver).
+- F12 = eshell-through-EAT (2026-06-25, commits cbd38d88 + c99fad28): F12 now opens eshell run through EAT (eat-eshell-mode) instead of a standalone EAT zsh shell, so the primary terminal is eshell (elisp functions as commands, TRAMP transparency) with EAT rendering visual commands. Retired eshell-toggle + xterm-color; added a zsh-parity prompt (git branch + [N] exit status) and a zoxide =z= sharing the zsh database. eat-config + eshell-config kept separate.
+- Phase 3 DONE (commit 6c8f2a9c): ported ai-term from ghostel to EAT. The spike confirmed EAT + tmux detach/reattach behaves exactly like ghostel + tmux (eat spawns, sends =tmux new-session -A -s aiv-<project>=; killing the buffer leaves the session alive; respawn reattaches). The coupling was far smaller than feared -- most of the ~30 refs were comments, and agent detection is name-based ("agent [...]"), so backend-agnostic. Swaps: =(ghostel)= -> =(eat)= with =eat-buffer-name=, =ghostel-send-string= -> a process-send-string helper, M-SPC bound directly in =eat-semi-char-mode-map= (no exception/rebuild dance). 157 ai-term tests green. Real-agent launch + detach/reattach is a VERIFY under Manual testing and validation.
+- Phase 4 DONE (commit 6a9ec62e): retired ghostel. Migrated the terminal-generic keepers into eat-config -- the tmux copy-mode (=C-<up>= enters it, same UX + keybinding; agents run EAT over tmux so it's still tmux's own copy-mode) and the tmux-history capture, swapping =ghostel-send-string= -> a pty write and the mode checks -> eat-mode. Repointed the dashboard "Launch Terminal" to =cj/term-toggle=, swapped the =face-diagnostic= terminal-mode check to eat-mode, refreshed the auto-dim comment. Deleted =term-config.el= + its init require. EAT's default =eat-semi-char-non-bound-keys= already lets windmove / buffer-move / Emacs keys reach the terminal, so no exception-list port was needed. Tests retargeted (tmux-history 15/15). The copy-mode + tmux-history live check is a VERIFY under Manual testing and validation.
+- Phase 5 DONE (commit eb4aa232): removed the theme-studio ghostel app (=GHOSTEL_FACES=) now those faces are dead (ansi-color stays -- EAT inherits it), =package-delete='d the ghostel ELPA package, and swept the remaining ghostel mentions in comments/docs. The optional F8/F10 surfacing in agent buffers was not pursued.
+** DONE [#C] ai-term.el commentary names a stale F9 keybinding scheme :quick:solo:
+CLOSED: [2026-06-28 Sun]
+Rewrote the header Commentary (the "four global keys" + "Four F-key entry points: F9 / C-F9 / s-F9 / M-F9" block) to the current scheme: the =C-; a= prefix map (a = toggle, s = select/launch, n = next, k = kill) plus the global =M-SPC= -> =cj/ai-term-next=. Fixed the binding-claiming docstrings (=cj/ai-term=, =cj/ai-term-pick-project=, =cj/ai-term-shutdown=, =cj/--ai-term-dispatch=) and swept the behavioral =F9= shorthand + two stray =C-F9= claims in internal docstrings. Kept the two historical incident names ("F9 shrink bug", "F9 shows another agent" bug) as recorded references. Doc-only: parens ok, no new byte-compile warnings, dispatch tests 4/4, live-reloaded.
+** CANCELLED [#C] ai-term: fullscreen on summon, toggle when only one agent :feature:
+CLOSED: [2026-06-28 Sun]
+Cancelled — rethinking the ai-term window behavior before committing to an approach.
+Two behaviors for M-SPC (=cj/ai-term-next=) when bringing up an agent from a non-agent context:
+1. Summon fullscreen. Today the agent opens in its deliberate dock — 0.75 frame height on a laptop (=cj/ai-term-laptop-height=), a width fraction on desktop (=cj/--ai-term-default-size= / =-default-direction=) — so summoning from another buffer lands it at partial size and Craig hits =C-x 1= to fill the frame. When summoning (no agent window currently shown), open it fullscreen instead.
+2. Single-agent toggle. When exactly one agent exists, M-SPC currently self-cycles (=cj/--ai-term-next-agent-dir= wraps to the same dir, re-selecting the same window — a no-op). Repurpose it: with one agent, M-SPC toggles the window (show fullscreen if hidden, hide if shown), matching =cj/ai-term= (C-; a a). With 2+ agents, keep the cycle behavior.
+Touches the dock/toggle state machine (=cj/--ai-term-last-direction= / =-size= / =-was-bury= etc.), so implement carefully and keep the multi-agent cycle plus toggle-restore reversibility intact. From the roam inbox.
+** DONE [#C] dashboard: no icon for URL bookmarks :bug:
+CLOSED: [2026-06-28 Sun]
+Resolved by dropping per-item list icons rather than adding a URL glyph: set =dashboard-set-file-icons nil= (=dashboard-config.el=), so recents / bookmarks / projects render without leading icons and URL vs file bookmarks look uniform. Section-heading icons and the launcher row keep theirs. Verified live: the =*dashboard*= buffer's bookmark/project items render glyph-free (the URL bookmark "Tensegrity Blog" now matches the file bookmarks). From the roam inbox.
+** DONE [#B] calendar-sync robustness: atomic writes, curl --fail, zero-event false errors :bug:solo:next:
+CLOSED: [2026-06-25 Thu]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-20
+:END:
+All three landed (commit 11049db5) and verified against the live feed — gcal/pcal/dcal all fetched and wrote cleanly. (1) =calendar-sync--write-file= and =--save-state= write a temp file in the same directory then =rename-file= it into place, so a mid-write reader never sees a partial calendar. (2) Both curl fetches got =--fail=, so an HTTP 404/500 page exits non-zero instead of flowing its HTML into conversion. (3) =--parse-ics= now distinguishes a healthy zero-event calendar (real =BEGIN:VCALENDAR=, no in-window events -> header) from garbage (no VCALENDAR -> nil), so near-empty calendars no longer report "parse failed". New robustness tests + the empty-calendar boundary test corrected; calendar-sync suite 575/575.
+** DONE [#B] org-roam :config triggers the 15-20s refile scan synchronously at first idle :bug:solo:next:
+CLOSED: [2026-06-25 Thu]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-20
+:END:
+Fixed (commit 4e48432c): removed the redundant =cj/build-org-refile-targets= call from org-roam's :config (=org-roam-config.el=). org-roam is =:defer 1=, so that call ran the multi-file refile scan synchronously at the 1s idle on a cold cache, freezing Emacs at first idle; =org-refile-config.el= already schedules the same build on a 5s idle timer, so it was a duplicate. The first-idle freeze is gone. This removed the *duplicate* early scan, not the scan's cost — making the scan itself faster stays the separate =[#B] Optimize org-capture target building performance= task (profile-first).
+** DONE [#B] transcription: stderr never reaches the log :bug:solo:next:
+CLOSED: [2026-06-28 Sun]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-25
+:END:
+The "/tmp" half was DONE earlier (commit 3d9a650d): video transcripts land beside the source video via an =output-base= threaded through =cj/--start-transcription-process=.
+The stderr half is now fixed: =make-process :stderr= had a file PATH, which Emacs turns into a phantom buffer named after the path — so the error text never reached the log and a buffer leaked per run. Fix (2026-06-28): an explicit, erased stderr buffer (=" *transcribe-stderr-<file>*"=) is passed to =:stderr=, threaded to the sentinel, drained into the log file via =cj/--append-to-log=, then killed. Keeping stderr off the stdout =:buffer= leaves the transcript clean. TDD: new =test-tx-start-process-stderr-is-a-buffer-not-a-path= plus strengthened sentinel tests asserting the stderr text reaches the log and the buffer is killed; full transcription suite 39/39 green; live-reloaded.
+Live failing-run confirmation is filed under "Manual testing and validation".
+** DONE [#B] eww User-Agent advice may not inject under Emacs 30 :bug:
+CLOSED: [2026-06-25 Thu]
+Root cause was NOT =derived-mode-p= (that works in both batch and the daemon — my initial guess was wrong). It was the lexical-binding special-var trap: =eww-config.el= is =lexical-binding: t= and the advice =my-eww--inject-user-agent= let-binds url.el's =url-request-extra-headers=, but the file never declared that var special. The byte-compiler bound it lexically, so the injected User-Agent never reached =url-retrieve= and the desktop UA silently dropped in compiled production (eww still worked, just with the default UA). Verified: the byte-compiled advice returned nil before, =t= after. Fix (commit 6131da8e): a top-level =(defvar url-request-extra-headers)= so the compiler treats it as dynamic and the binding propagates. All 3 advice tests pass; live-reloaded. Same class as the json-object-type and the LSP-test special-var traps — a foreign special var let-bound in a lexical file always needs a compile-time defvar/require.
+** DONE [#B] calendar-sync: a declined single occurrence keeps :STATUS: accepted :bug:solo:
+CLOSED: [2026-06-25 Thu]
+A recurring event declined for just one occurrence synced out with =:STATUS: accepted= (chime then faithfully showed it). Root cause (diagnosed by a chime session, 2026-06-24): =calendar-sync--apply-single-exception= merged the override's =:attendees= but never re-derived =:status=, so the occurrence kept the series master's accepted status, and =calendar-sync--filter-declined= (which keys off =:status=) didn't drop it. Fix (TDD): in =apply-single-exception=, when overriding =:attendees=, re-derive =:status= via =calendar-sync--find-user-status= against =calendar-sync-user-emails=. Four new tests in =test-calendar-sync--apply-single-exception.el= (declined → "declined"; no-attendee override → inherited intact; accepted override → accepted; override without the user → inherited intact); recurrence + find-user-status + integration suites unchanged. Live-reloaded; a manual re-sync ran clean. The specific 2026-06-24 Arusyak occurrence is past now (its RECURRENCE-ID override aged out of the feed), so the live confirmation lands on the next single-occurrence decline.
+** DONE [#C] ledger-config is orphaned — ledger-mode never configured :bug:quick:
+CLOSED: [2026-06-28 Sun]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-21
+:END:
+Resolved by wiring (Craig's call 2026-06-28: wire it, not delete). Already landed in commit 6ec857ae (2026-06-24, "feat(ledger): un-orphan ledger-config and rewrite clean-on-save") — =init.el:123= now requires =ledger-config=, after this task's 2026-06-21 review, so the task was stale. Confirmed it loads cleanly; the =cj/executable-find-or-warn "ledger"= guard is in its =:config=. Follow-on audit + guardrail-UX work filed as its own task below.
+** DONE [#C] Remove unused system-power keybindings :refactor:quick:solo:
+CLOSED: [2026-06-28 Sun]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-20
+:END:
+Removed the per-command leaf keys (s/r/e/l/L/E/S) under =C-; != and the prefix map. =C-; != now binds directly to =cj/system-command-menu= (the completing-read menu), via =cj/register-command=, so every command stays reachable through the menu and the leaf keys are freed. Updated the module commentary and the two keymap tests (now assert the direct-command binding + no submap; the menu-dispatch test already covers reachability). 2/2 keymap + 18/18 system-cmd tests green; live-reloaded; confirmed =C-; != resolves to =cj/system-command-menu=. Decision was Craig's (2026-06-28, cj comment): remove them all.
+** CANCELLED [#C] dirvish image previews missing in the pictures dir :bug:
+CLOSED: [2026-06-25 Thu]
+Craig couldn't reproduce — image previews render fine in dirvish now. Cancelled.
+** DONE [#C] ai-term test isolation: collapse-split leaks state breaking display-rule :bug:test:
+CLOSED: [2026-06-25 Thu]
+Root cause found: the display rule's 4th action =cj/--ai-term-display-saved= splits per the globals =cj/--ai-term-last-direction= / =cj/--ai-term-last-size=, captured on the last toggle-off. The collapse-split multi-window and single-window tests call =cj/ai-term= (which captures those globals) but only let-bound =cj/--ai-term-last-was-bury=, so they leaked =last-direction= = below into =display-rule=, which then split below (left-col 0) instead of right (left-col 40). Confirmed by instrumenting: every window/split global was identical fresh vs after-collapse, but the leaked =last-direction= flipped the directional split. Fix: let-bind =cj/--ai-term-last-direction= + =cj/--ai-term-last-size= to nil in both collapse-split tests, isolating the capture-state globals the way the roundtrip test in the same file already does. Full ai-term suite now 158/158 green.
+** DONE [#C] dirvish leaves stray buffers; should be single-instance like org-capture :bug:
+CLOSED: [2026-06-25 Thu]
+Diagnosed and fixed (commit e190648b). The single-instance frame behavior already existed (=cj/dirvish-popup-focus-existing= raises the open popup on a second Super+F; =q= tears it down). Measured the litter: navigating a dirvish session piles up one dired buffer per directory (2 -> 6 over three subdirs), but =dirvish-quit= reaps them all back to baseline. So the leak was only when the popup is closed WITHOUT =q= — closing the Hyprland float or losing focus bypassed =dirvish-quit= and orphaned the session's buffers. Fix: a =delete-frame-functions= hook scoped to the "dirvish" popup frame runs =dirvish-quit= on every close path (verified: navigated session drops back to baseline on frame close without q). Deliberately did NOT enable =dired-kill-when-opening-new-dired-buffer= — it's off on purpose (dirvish-config.el:208) because it breaks mark-in-A-then-move-to-B; the popup-scoped reap leaves regular =C-x d= sessions and that workflow untouched.
+** DONE [#C] ai-term: step between running ai-terms even when detached :feature:solo:next:
+CLOSED: [2026-06-25 Thu]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-22
+:END:
+Implemented 2026-06-25 (commit 79cbccb5): =cj/ai-term-next= now cycles every active agent (a live buffer OR a live tmux session) keyed on the project dir and ordered by buffer name, and stepping onto a detached one attaches it (=cj/--ai-term-show-or-create= recreates the terminal, which reattaches the session). New pure helpers =cj/--ai-term-next-agent-dir= + =cj/--ai-term-active-agent-dirs= with 10 ERT tests; the live-buffer swap path is unchanged. Live check filed under Manual testing and validation.
+** DONE [#C] Compare terminal themeability: EAT vs vterm vs ghostel :feature:solo:next:
+CLOSED: [2026-06-25 Thu]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-22
+:END:
+Researched 2026-06-24. All three expose the 16 ANSI colors as Emacs faces (=eat-term-color-*=, =vterm-color-*=, =ghostel-color-*=, each inheriting =ansi-color-*= / =term-color-*=). Ghostel is the most live-themeable: it alone registers an =enable-theme-functions= resync hook (repaints live buffers on a theme change) and exposes a dedicated =ghostel-default= face for the terminal's default fg/bg. EAT (pure elisp, where the faces are the real render source) and vterm (native, faces read at render) both expose themeable palettes but need a buffer reload to pick up a theme switch and give less default-fg/bg control. Outcome: Craig is moving F12 to EAT anyway, for pure-elisp face control and the fun of theming it — see "F12 pops EAT instead of ghostel" above, which carries the resync tradeoff knowingly.
+** CANCELLED [#D] Un-pin ghostel from 0.33.0 once upstream fixes #422/#423 :bug:
+CLOSED: [2026-06-26 Fri 04:56]
+:PROPERTIES:
+:LAST_REVIEWED: 2026-06-20
+:END:
+ghostel is held at 0.33.0 (=ghostel-20260604.2049=, commit 5779a2adceb2) in =modules/term-config.el= to dodge the 0.35.x native-PTY crash. When dakra/ghostel ships a fix for #422 (Linux malloc/signal reentrancy) and #423 (macOS recursive lock), restore =:ensure t= (drop the pin comment) and =package-upgrade ghostel=, then re-run the open-ghostel-in-a-GUI-frame survival check. Watch the two issues for the fixing commit.
+
+archsetup automated the zig 0.15.2 pin (managed =install_zig_pin= step, sha-verified, unit-tested). If the un-pinned ghostel bumps its ghostty dependency to a newer zig, send archsetup the new version + sha256 so it bumps its =ZIG_VERSION= / =ZIG_SHA256= constants (=inbox-send archsetup=).
+** DONE [#C] EAT diff green and red too bright :quick:
+CLOSED: [2026-06-28 Sun]
+Darkened the added/removed line backgrounds. Added =eat-term-color-22= (added green) and =eat-term-color-52= (removed red) to the eat section of =scripts/theme-studio/WIP.json= at about half their former brightness — =#005F00= -> =#002f00=, =#5F0000= -> =#2f0000= (Craig: pick an appropriate darkness from WIP.json; halved, symmetric, still clearly green/red). Regenerated =themes/WIP-theme.el= via build-theme.el and re-applied the WIP theme live in the daemon (confirmed: =eat-term-color-22= = #002f00, =-52= = #2f0000). EAT uses each face's :foreground as the palette value for both fg and bg paint, so darkening the foreground darkens the diff background.
+Scope notes: (1) the green index (22) was confirmed via =C-h F=; the red (52) is the symmetric ANSI-256 dark-diff counterpart — if removed lines don't darken, the real index needs a live sample. (2) Only the line backgrounds are themed; the brighter within-line word-highlight shades are different (unconfirmed) indices, left for a live sample if Craig still finds them bright. (3) A 256-cube override is global (hits every terminal program emitting color 22/52). (4) Studio round-trip caveat: a future studio re-export may drop these cube faces until the studio formally tracks them. Visual darkness confirm filed under "Manual testing and validation".
+** DONE [#B] eat semi-char mode swallows zoom-out :bug:solo:
+CLOSED: [2026-06-27 Sat]
+Shipped in commit 69fee81f: =eat-semi-char-mode-map= now binds =C--= -> =text-scale-decrease= and =C-0= -> =cj/eat-text-scale-reset= (=eat-config.el:495-496=). Original report below.
+In =eat-semi-char-mode= (the AI session buffers) =C--= is bound to =eat-self-input= and forwarded to the terminal, so it never reaches =text-scale-decrease= and the font can only grow. On velox 2026-06-27 a session climbed to text-scale 17 (~20x, unreadable) with no in-buffer way down. Fix (binding in =eat-semi-char-mode-map= works for eat, unlike ghostel): =C--= to =text-scale-decrease=, =C-0= to =(text-scale-set 0)=. Tradeoff: =C--= no longer forwarded to the terminal (Claude TUI and tmux do not use it), =C-0= shadows =digit-argument= inside eat buffers only. From the home-emacs inbox handoff 2026-06-27. Roam KB 799e8ab5-1c2c-4874-9abc-dff2ec354181.