From 1682d03f975177cd6a2a6813a1b22b8f028407b9 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 16 Jun 2026 16:02:21 -0500 Subject: chore(todo): group tasks into module projects and document statuses I consolidated the loose top-level tasks under module "Open Work" parents for every module with four or more (Theme-Studio, Music, AI), and left tasks that already had subtasks as standalone projects. I marked the top-level container tasks PROJECT, top level only and never deeper, and demoted three PROJECT headings that were buried below the top level back to TODO. The priority scheme now documents every status keyword (TODO, PROJECT, DOING, WAITING, VERIFY, STALLED, DELEGATED, DONE, CANCELLED, FAILED), with PROJECT spelled out as a top-level container. I also routed the studio table-consistency task in from the roam inbox. --- todo.org | 6442 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 3231 insertions(+), 3211 deletions(-) diff --git a/todo.org b/todo.org index 150d23390..4f5f66102 100644 --- a/todo.org +++ b/todo.org @@ -21,6 +21,17 @@ tests, chores, and features can all be high or low priority. upstream/package tracking, optimizations without current pain, or deferred ideas that should not compete with active maintenance. +The task status (the TODO keyword) tracks where a task sits in its lifecycle. +The active keywords are: +- =TODO= — open, not started. +- =PROJECT= — a top-level task that groups several subtasks; the children are the real work, and the project closes when they do. PROJECT lives only at the top task level (a =**= heading under a section), never at the second level or below. A subtask that itself has children stays =TODO= / =DOING=; it does not become a nested PROJECT. +- =DOING= — actively in progress. +- =WAITING= — blocked on something external (a person, an upstream release). +- =VERIFY= — the code is done; only Craig's hands-on check or a pending answer remains. VERIFY tasks wait on Craig and are never auto-implemented. +- =STALLED= — blocked on an upstream issue outside our control. +- =DELEGATED= — handed to someone else to carry. +The done keywords (after the =|= in the sequence) are =DONE= (completed), =CANCELLED= (abandoned), and =FAILED= (attempted, could not be made to work). + For =PROJECT= headings, use the highest priority of the meaningful child work inside the project. If a project only contains exploration or review, assign the priority by the expected decision value rather than the number of files touched. @@ -44,45 +55,6 @@ 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 -** DONE [#C] theme-studio: open with the palette collapsed to base colors :feature:studio:next: -CLOSED: [2026-06-16 Tue] -Every time theme-studio opens, the palette shows all colors including the span tints. Instead it should open showing the base colors only, and the user expands the spans by clicking the left-side arrow menu. From the roam inbox 2026-06-16. Craig: "just do it. :)" -Done 2026-06-16: initApp sets paletteShowFull=false before the first render, so the studio opens collapsed (arrow ▶); the existing toggle expands the spans. New #paldefaulttest gate asserts the opening collapsed state; #counttest and #paltoggletest now opt into full mode explicitly since they assert span tiles. Full suite green. -** 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. -** DONE [#C] theme-studio: realistic markdown-mode preview :feature:studio: -CLOSED: [2026-06-16 Tue] -markdown-mode fell back to the generic preview (face names in their own colors). Built renderMarkdownPreview (app.js): a realistic README exercising 28 markdown faces in context (front matter, H1-H3, bold/italic, inline + fenced code with a language tag, links + bare URLs, lists + GFM checkboxes, blockquote + footnote, table, hr, strikethrough, highlight, math, inline HTML, comment). Routed via a PREVIEW_KEYS map in app_inventory.py (markdown-mode -> markdown). #mdtest gate validates every data-face is a real markdown face; full theme-studio suite green. Commit =0682b24f=, pushed. Visual sign-off is a VERIFY under Manual testing and validation. -** 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. -** 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. -** 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). - -*** 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. -FIX A — DONE 2026-06-16, commit =202cf430=: exclude dashboard-mode from global font-lock — =(setq font-lock-global-modes '(not dashboard-mode))= at top level in =dashboard-config.el= (top-level so it runs even though the use-package =:config= errors on a void nerd-icons symbol under the test harness). Banner is gold again and the headings pick up =dashboard-heading=. TDD test =tests/test-dashboard-config-font-lock.el=; full suite green; live in the daemon. Causes B and C still open below. - -*** Cause B — project/bookmark/recent items have no color -Items and the navigator are painted by a =dashboard-items-face= button OVERLAY (overlays survive font-lock, which is why Cause A didn't touch them). But in =WIP-theme.el= =dashboard-items-face= is just =(:inherit widget-button)= — unspecified foreground, so it renders in the default color. 7496 had colored it (steel+2) in the now-retired Dupre theme; that color never carried into WIP. Per 7496, the navigator and items share =dashboard-items-face=, so coloring it colors both (separating them is the open task "Color dashboard navigator independently of list items", 7740). -FIX B (per Craig 2026-06-16 — no hardcoded colors, theme it): the items already fall back to the default foreground (=dashboard-items-face= inherits =widget-button= -> unspecified -> default fg), which is the right default. To actually COLOR them, theme-studio must expose =dashboard-items-face= so the color comes from the theme, not a hardcoded hex in =WIP-theme.el=. That is the items half of task 2418. No config/theme change here; this routes to 2418. - -*** Cause C — no icons on items or section titles -=dashboard-set-file-icons= and =dashboard-set-heading-icons= are both nil in the live config (=dashboard-config.el= sets =dashboard-display-icons-p t= + =dashboard-icon-type 'nerd-icons= but never the two enable toggles), so dashboard renders no file/section icons. Only the custom navigator row has icons. -FIX C — file icons DONE 2026-06-16, commit =1c97cba7=: =(setq dashboard-set-file-icons t)= in =dashboard-config.el=. Items now show nerd-icons file icons colored per filetype (verified live: =todo.org= -> nerd-icons-lgreen, project dirs -> nerd-icons-yellow; bookmarks fall back to a generic uncolored icon, no filetype to map). Per Craig: per-filetype (the nerd-icons default). They render only because Fix A took the dashboard out of font-lock, which was stripping the icon faces too. OPEN (offered, not done): =dashboard-set-heading-icons t= would add icons to the section titles — left off pending Craig's call. - -*** Studio angle -To set the item color from theme-studio instead of hand-editing =WIP-theme.el=, the studio's dashboard app must expose =dashboard-items-face= as editable — the "list items unthemed" half of task 2418 (theme-studio: dashboard preview icons missing, list items unthemed). - -*** Next -Confirm Fix A to persist it; pick the item color (Fix B); decide the icon enable + color policy (Fix C). -** 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. ** VERIFY [#A] calendar-sync drops final occurrences, resurrects cancelled meetings :bug:solo:next: :PROPERTIES: :LAST_REVIEWED: 2026-06-13 @@ -100,8 +72,40 @@ RFC 5545 conformance holes in =modules/calendar-sync.el=, all agenda-visible (fr 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. -** 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. +** 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 " 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. + +** 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. ** DOING [#B] mu4e: cmail can't trash, no account can refile :bug:quick:solo: :PROPERTIES: @@ -110,18 +114,384 @@ All transient popups should follow one set of principles. Placement: when the Em =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. -** 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. -** 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. - -** 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. - -** PROJECT [#B] Architecture review follow-up from 2026-05-03 :refactor: +** 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. +*** 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 ; runs the same command its C-; 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) +- Confirm the preview shows the focused agenda block over the auto-dim block, and that the rows read "todo", "priority a", etc. +- Edit org-faces-todo to an obviously different color (e.g. bright magenta) and export the theme to WIP.json +#+begin_src sh :results output +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 .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. +*** 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 +Craig read org/magit/elfeed against the ground. Pass with tuning: steel reads a bit dark — flipped to steel+1 on magit (better), but org wanted darker; these are updated selections, NOT final — he expects to adjust many more before the theme ships. His export saved to scripts/theme-studio/theme.json (replaced the 2026-06-09 state, prior version in git at 4f2d00eb). Side find: the org preview's heading-three ↔ headline-todo flash linkage is cross-wired — filed as its own bug task. +*** 2026-06-11 Thu @ 18:29:39 -0500 Verified large face tables stay usable +Craig scrolled the org table, filtered on "agenda", reassigned a face — grouping, narrowing, and live preview update all behaved. Pass. +*** 2026-06-11 Thu @ 18:29:39 -0500 Verified perceptual readouts in the picker +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 +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 +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 +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)" +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: " 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 " 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 " 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. + +** PROJECT [#A] Theme-Studio Open Work +Parent grouping the open theme-studio / theming issues; close each child independently. +*** 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. +*** 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. +*** TODO [#B] theme-studio import organization workflow needs a spec :feature:studio: +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +Design import handling for unstructured color sources such as Emacs themes, CSS palettes, screenshots, and generic palette files. Principles from the 2026-06-13 Theme Studio discussion: +- Preserve declared structure whenever an imported entry has a =columnId=. +- For unstructured legacy imports with no =columnId=, avoid silent hue clustering and avoid treating arbitrary =color-N= names as one long ramp; each =color-N= should become its own base column. +- Keep meaningful generated ramp-name inference for names like =blue-1= / =blue= / =blue+1=. +- Group external numeric color-name variants for compact display: =blue1= / =blue2= / =blue3= infer column =blue=; =grey80= / =grey81= infer column =grey=; =orchid3= infers =orchid=. This is display organization, not proof that the colors are an authored Theme Studio span. +- If a numeric external base is spanned later, generate from the actual base name, e.g. =blue1-1= / =blue1= / =blue1+1=, while keeping those generated tiles in the inferred =blue= column. +- Add explicit organization tools rather than hidden inference: group selected colors into a column, suggest hue groups as a preview/action, sort imported colors for inspection, and promote a color from an import bucket into a normal column. +- Consider a compact imported/captured bucket UI for large unstructured imports while preserving per-color column ids internally. + +*** VERIFY [#B] theme-studio: org-agenda app + agenda preview :feature:theme-studio: :studio:next: +Needs from Craig: this is a multi-phase feature, not a bug fix — it depends on the preview-locate feature (per the 2026-06-15 spec) and means breaking org-agenda-* / scheduling / deadline / calendar / clocking faces into their own theme-studio pane with a representative week-agenda preview. Too large to land inside this batch. Confirm you want it built now (and as its own focused session) and I'll start from the spec; otherwise it stays parked. +Break the org-agenda-* plus scheduling / deadline / calendar / clocking / filter faces out of the overloaded org-mode app into a dedicated org-agenda pane (org-mode-line-clock* stay in org-mode), with a representative week-agenda preview at natural item frequency. Keywords, priorities, and tags render live via org-faces / org-mode through the locate registry (hover-only there). Same five-file bespoke-app pattern as org-faces. Depends on the preview-locate feature. Partly subsumes the "break org-mode preview into grouped subsections" task. +*** TODO [#B] theme-studio UI face inheritance needs a spec :feature:studio: +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +: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). + +**** 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. +FIX A — DONE 2026-06-16, commit =202cf430=: exclude dashboard-mode from global font-lock — =(setq font-lock-global-modes '(not dashboard-mode))= at top level in =dashboard-config.el= (top-level so it runs even though the use-package =:config= errors on a void nerd-icons symbol under the test harness). Banner is gold again and the headings pick up =dashboard-heading=. TDD test =tests/test-dashboard-config-font-lock.el=; full suite green; live in the daemon. Causes B and C still open below. + +**** Cause B — project/bookmark/recent items have no color +Items and the navigator are painted by a =dashboard-items-face= button OVERLAY (overlays survive font-lock, which is why Cause A didn't touch them). But in =WIP-theme.el= =dashboard-items-face= is just =(:inherit widget-button)= — unspecified foreground, so it renders in the default color. 7496 had colored it (steel+2) in the now-retired Dupre theme; that color never carried into WIP. Per 7496, the navigator and items share =dashboard-items-face=, so coloring it colors both (separating them is the open task "Color dashboard navigator independently of list items", 7740). +FIX B (per Craig 2026-06-16 — no hardcoded colors, theme it): the items already fall back to the default foreground (=dashboard-items-face= inherits =widget-button= -> unspecified -> default fg), which is the right default. To actually COLOR them, theme-studio must expose =dashboard-items-face= so the color comes from the theme, not a hardcoded hex in =WIP-theme.el=. That is the items half of task 2418. No config/theme change here; this routes to 2418. + +**** Cause C — no icons on items or section titles +=dashboard-set-file-icons= and =dashboard-set-heading-icons= are both nil in the live config (=dashboard-config.el= sets =dashboard-display-icons-p t= + =dashboard-icon-type 'nerd-icons= but never the two enable toggles), so dashboard renders no file/section icons. Only the custom navigator row has icons. +FIX C — file icons DONE 2026-06-16, commit =1c97cba7=: =(setq dashboard-set-file-icons t)= in =dashboard-config.el=. Items now show nerd-icons file icons colored per filetype (verified live: =todo.org= -> nerd-icons-lgreen, project dirs -> nerd-icons-yellow; bookmarks fall back to a generic uncolored icon, no filetype to map). Per Craig: per-filetype (the nerd-icons default). They render only because Fix A took the dashboard out of font-lock, which was stripping the icon faces too. OPEN (offered, not done): =dashboard-set-heading-icons t= would add icons to the section titles — left off pending Craig's call. + +**** Studio angle +To set the item color from theme-studio instead of hand-editing =WIP-theme.el=, the studio's dashboard app must expose =dashboard-items-face= as editable — the "list items unthemed" half of task 2418 (theme-studio: dashboard preview icons missing, list items unthemed). + +**** Next +Confirm Fix A to persist it; pick the item color (Fix B); decide the icon enable + color policy (Fix C). +*** TODO [#B] theme-studio semantic theme architecture :feature:theme-studio:spec: :spec:studio: +:PROPERTIES: +:LAST_REVIEWED: 2026-06-14 +:END: +Spec draft: [[id:fe980b12-451a-4d8b-a550-d99f9ec49f45][theme-studio-semantic-theme-architecture-spec.org]]. + +Design a Modus-inspired layered Theme Studio output path: palette data, semantic role mappings, face templates, and a generated theme wrapper. Keep the current flat JSON-to-theme converter as the compatibility/default path while proving a layered, self-contained generated theme. Include advisory semantic rules as a possible validation layer, not v1 enforcement. + +**** TODO [#B] theme-studio palette generator source modes for base-only vs ground-aware palettes :feature: +:PROPERTIES: +:LAST_REVIEWED: 2026-06-14 +:END: +Tentative follow-up from walking through the generator algorithms. Consider splitting the current =source: palette= behavior into two explicit source modes, names TBD: +- =base color palette= — current behavior; use non-ground base color columns only and ignore bg, fg, ground spans, and color spans. +- =ground and base palette= — use bg/fg plus non-ground base color columns as generator anchors, useful when colored ground endpoints should shape fill-gap or harmony choices. + +This may be cancelled if the extra distinction makes the generator harder to understand. Before implementing, decide final names and whether ground-aware source should include only bg/fg or also ground span steps. + +*** TODO [#B] theme-studio seeding engine :feature:studio: +:PROPERTIES: +:LAST_REVIEWED: 2026-06-13 +:END: +Spec (Ready): [[id:b70b37f2-37df-4c8e-ac2f-1f20d12e33dd][spec]]. Role table → guide-correct defaults for syntax/UI/org; reseed dupre-revised.json to the compact mapping; opens seeded with an all-tier reseed button. Depends on the perceptual-metrics colormath.js core for OKLCH shade generation, so it runs after that feature's Phase 1. +**** TODO Seed model + seed() + #seedtest :solo: +Phase 1. Palette anchors + OKLCH shade generation (reusing colormath.js), the ROLES table, and the three face→role maps as data; pure seed(). Gate: #seedtest asserts representative syntax/UI/org faces resolve correctly (bi→blue-grey, fnd→gold+bold, region bg-only, link underlined, org-level-1 strongest, org-code literal lane) and a non-org bespoke package (magit) keeps its curated seed. +**** TODO Open-seeded + reseed + dupre-revised regen :solo: +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. + +*** 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. + +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. + +*** 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). + +*** 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. + +** 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 =modules/=. The main theme: the config works, but load order, startup side @@ -351,7 +721,7 @@ Done 2026-05-15: - Focused tests passed for the new architecture smoke file and the affected agenda/refile helpers. -*** PROJECT [#A] Un tangle the eager =init.el= load graph :refactor: +*** TODO [#A] Un tangle the eager =init.el= load graph :refactor: =init.el= currently functions as the dependency graph by eagerly requiring almost every module in a fixed order. That makes modules harder to test in @@ -414,7 +784,7 @@ Verified behavior-preserving by dumping every C-; binding before and after: iden Related existing task: [#B] "Review and rebind M-S- keybindings". -*** PROJECT [#A] Move package bootstrap out of =early-init.el= where possible :refactor: +*** TODO [#A] Move package bootstrap out of =early-init.el= where possible :refactor: =early-init.el= currently handles package archives, package refresh, installing =use-package=, and =use-package-always-ensure=. That is more than early startup @@ -450,2733 +820,2372 @@ Expected outcome: - Add a note to the local repository docs so future package failures do not lead to permanent insecure defaults. -** 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. -** 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. +** PROJECT [#B] F-key Completion :feature: +:PROPERTIES: +:LAST_REVIEWED: 2026-06-02 +:END: -** 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). +The L546 ticket "Rework dev F-keys" landed roughly 75% as of the 2026-05-27 audit. F4 (compile+run dispatcher, project-type detection, clean-rebuild, projectile cache revert), F7 (coverage), and the format-key migration off F6 are all shipped with ERT coverage. F6 ships Phase 2a only — "All tests" and "Current file's tests" via plain F6 and C-F6. -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). +Phase 2b remains: per-language test discovery, the "Run a test..." menu entry, M-F6 fast path, buffer-local last-test memory, and the spec-mandated "No tests found for " error. The =dev-fkeys.el= header (L35–46) already sketches the tree-sitter capture-then-filter pattern needed to work around Emacs bug #79687 on the emacs-30 branch. -** 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. +Two smaller cleanups also fall out: the header comment claims TS/JS is "punted for v1" while the cmd-builder at =dev-fkeys.el:384= actually emits a vitest/jest command, and the cmd-builder is a likely home for =cj/--tests-in-buffer= once it lands. -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. +Open: helper home — keep =cj/--tests-in-buffer= in =dev-fkeys.el= (per L546 spec) or push it into =test-runner.el= (per the parallel "Fix up test runner" thread). Elisp "Run a test..." — drill into individual =ert-deftest= names, or keep the current regex-aggregate (=make test-name TEST=^test--=). -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. +*** TODO [#B] Per-language test discovery helper :feature:test: +Build =cj/--tests-in-buffer= returning a list of test names; tree-sitter capture-then-filter for python/go/ts/js per the bug #79687 workaround in =dev-fkeys.el= L35–46; sexp scan for elisp =ert-deftest= forms. -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. +*** TODO [#B] F6 Run-a-test menu entry :feature:test: +Add "Run a test..." to =cj/f6-test-runner= candidates; pre-select =cj/--last-test-run=; signal =user-error= "No tests found for " when discovery returns nil. -** 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. +*** TODO [#B] M-F6 fast path :feature:test: +Bind =M-= to a thin wrapper that calls the same "Run a test..." path directly; release the reservation comment at =dev-fkeys.el:541=. -** TODO [#B] Fix up test runner :bug: +*** TODO [#B] Buffer-local cj/--last-test-run :feature:test: +Add the buffer-local var, set it on each "Run a test..." selection, use it as the completing-read default so a bare RET re-runs the last test. + +*** 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-06 +:LAST_REVIEWED: 2026-06-04 :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= +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. -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. +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. -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. +*** 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. -**** 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] Follow-up: evaluate ghostel-eshell + ghostel-compile +D3 — ghostel-eshell as eshell visual backend; ghostel-compile against F4 dev-fkeys. -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". +*** 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). -***** 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 +*** 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. -The runner should support two ERT execution modes: -- =interactive= / in-process for fast local TDD -- =isolated= / batch Emacs for reliable verification +*** 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. -The isolated path should be preferred for "before commit", CI parity, and -agent-driven verification. +*** 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). -***** 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 +*** 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. -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-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". -***** Path containment has at least one suspicious edge -=cj/test--do-focus-add-file= checks: +*** 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. -#+begin_src elisp -(string-prefix-p (file-truename testdir) (file-truename filepath)) -#+end_src +*** 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. -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. +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. -***** 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 +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]]. -Prefer a structured command object: +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. -#+begin_src elisp -(:program "pytest" - :args ("tests/test_foo.py" "-q") - :default-directory "/project/" - :env (("PYTHONPATH" . "...")) - :runner pytest - :scope file) -#+end_src +*** 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. -Render to a shell string only at the final compilation boundary. +*** 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. -***** 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 +*** 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. -***** 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/= +*** 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. -Discovery should be adapter-specific and project-config-aware. +*** 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. -***** 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 +** PROJECT [#B] Module-by-module hardening +:PROPERTIES: +:LAST_REVIEWED: 2026-06-05 +:END: -This enables last-failed, failures-first, summaries, dashboards, and AI-assisted -failure explanation. +Review every file in =modules/= and capture concrete bugs, tests, refactors, +and design improvements as child tasks. This is intentionally separate from the +top-level architecture review: the architecture project tracks cross-cutting +load/startup/test structure, while this project tracks module-specific work. -***** 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 +Audit reconciliation 2026-05-27: four sessions between 2026-05-23 and +2026-05-26 drained the umbrella significantly. Roughly 24 of the original +~89 sub-task findings remain open (TODO/DOING/VERIFY) across all six tracks. +Notable shipped work since the 2026-05-22 review: user-constants +filesystem-init split, system-defaults smoke tests, env-desktop-p doc fix, +popper-config removal, UI/navigation runtime smoke coverage, mu4e +org-contacts coverage, prog-lisp smoke coverage, Org export tool guards. +The six =***= track tasks are all still DOING (track status unchanged); +the change is mass of completed sub-work, not track status. -Adapters can provide regexes/parsers for ERT, pytest, Jest/Vitest, Go, Rust, -and shell. +Re-review pass 2026-05-15: +- Each of the six existing review tracks (foundation, custom editing, UI / + navigation, Org workflow, programming workflow, integrations and + applications) was re-walked as if it had not been reviewed before. +- 32 new sub-task findings filed across the tracks above (foundation 5, + custom editing 6, UI / navigation 9, Org workflow 3, programming 6, + integrations 2). Findings already covered by an existing sub-task were + dropped during consolidation. +- A separate =Review newly added modules= task lists the 24 modules that + were either added after the parent task was written (post-2026-04) or + fell outside the original scope lists. Each is routed to its target + track; module-specific findings are filed under the relevant track. -***** 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. +Review protocol for each module: +- Read the module directly, not just the test names. +- Check runtime dependencies, top-level side effects, keybindings, timers, + external executable assumptions, secrets, host-specific paths, and user-data + writes. +- Check existing test coverage and whether tests protect the highest-risk + behavior. +- Promote larger findings into child =PROJECT= tasks with phases. Keep small + fixes as plain =TODO= tasks. -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 +Priority scheme: use the top-level =Priority Scheme= section in this file. -**** Proposed Architecture -***** Core Types -Use plain plists initially; promote to =cl-defstruct= only if helpful. +Suggested review order: +1. Foundation: =system-lib=, =user-constants=, =host-environment=, + =system-defaults=, =keybindings=, =config-utilities=, =early-init=, + =init=. +2. Custom editing utilities: =custom-*=, =external-open=, =media-utils=. +3. UI and navigation: =ui-*=, =font-config=, =modeline-config=, + =selection-framework=, =mousetrap-mode=, =popper-config=. +4. Org workflow: =org-*=, =calendar-sync=, =hugo-config=, =gloss-config=. +5. Programming workflow: =prog-*=, =dev-fkeys=, =test-runner=, + =coverage-*=, =vc-config=. +6. Integrations and applications: mail, Slack, ERC, Elfeed, EWW, Dirvish, + PDF, Calibre, music, recording/transcription, AI/rest tooling. -#+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)) +*** DOING [#B] Harden foundation modules -;; 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) +Scope: +- =system-lib.el= +- =user-constants.el= +- =host-environment.el= +- =system-defaults.el= +- =keybindings.el= +- =config-utilities.el= +- =early-init.el= +- =init.el= -;; Test run result -(:run-id "..." - :status failed - :exit-code 1 - :duration 2.14 - :failures (...) - :output-buffer "*test pytest*" - :artifacts (...)) -#+end_src +Expected output: +- Add one child task for each actionable finding. +- Note "no action" only when the module has been reviewed and no task is + needed. +- Cross-reference existing architecture tasks instead of duplicating them. -***** Adapter Registry -Create a registry like: +Review progress: +- =system-lib.el=: reviewed 2026-05-03. No immediate action beyond the existing + [#B] system-lib extraction task. +- =host-environment.el=: reviewed 2026-05-03. See child tasks below. +- =user-constants.el=: reviewed 2026-05-03. See child tasks below. +- =system-defaults.el=: reviewed 2026-05-03. See child tasks below. +- =keybindings.el=: reviewed during architecture pass. No new module-specific + action beyond the load-order/keymap architecture tasks. +- =config-utilities.el=: reviewed 2026-05-03. No new module-specific action; + profiling extraction is already tracked by [#B] "Build debug-profiling.el + module". +- =early-init.el=: reviewed 2026-05-10. See child tasks below and the existing + [#B] "Split early startup from package bootstrap" task. +- =init.el=: reviewed 2026-05-10. See child tasks below and the existing + eager load-graph architecture tasks. -#+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 +Completion review 2026-05-15: +- Re-read the parent =Module-by-module review and hardening= context and the + adjacent architecture follow-up so this review stays module-specific. +- Re-checked all scoped files against the review protocol. Existing child + tasks below still cover the actionable module findings for + =user-constants.el=, =host-environment.el=, =system-defaults.el=, and + =early-init.el=. +- =system-lib.el=, =keybindings.el=, =config-utilities.el=, and =init.el= do + not need additional module-specific child tasks from this pass; remaining + concerns are already tracked by the utility-consolidation, keymap + registration, debug-profiling, and eager-load-graph architecture tasks. -Runner selection should consider: -- buffer file extension -- project files -- explicit user override -- available executables -- package manager scripts -- existing Makefile targets +**** 2026-05-25 Mon @ 19:12:02 -0500 Split path constants from filesystem init in user-constants.el -***** 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= +=(require 'user-constants)= used to create ~8 directories and ~10 org/calendar +files at load — the source of the stray =sync/org/= tree that appeared in the +repo during test runs. Both load-time forms are gone now; the path defconsts +stay pure, and init.el calls =cj/initialize-user-directories-and-files= on real +startup (guarded by =(unless noninteractive)=) so a bare require is +side-effect-free. Verified end-to-end: a require creates nothing, and the +interactive guard creates the backbone dirs and files. Landed in two commits on +the =refactor/user-constants-defer-fs-init= branch. -Each adapter can say which scopes it supports. Unsupported scopes should produce -clear user-errors with suggestions. +***** 2026-05-25 Mon @ 19:12:02 -0500 Extracted pure path definitions from startup writes -***** 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. +Removed the top-level calendar =dolist= and the top-level initializer call, and +folded gcal/pcal/dcal into =cj/initialize-user-directories-and-files=. init.el +now calls it right after the require, guarded by =(unless noninteractive)=. +Added =tests/test-user-constants.el= (loading creates nothing; the initializer +creates the configured paths) and updated the module header — top-level side +effects are now none and it's safe to load in tests. -***** 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 +***** 2026-05-25 Mon @ 19:12:02 -0500 Made initialization failures actionable -**** 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 +=cj/verify-or-create-dir=/=-file= took an optional =required= flag routed +through =cj/--report-path-failure=: required failures raise a prominent +=display-warning=, optional ones are logged. The initializer groups paths by +that split — required: the sync/org/roam dirs and the gcal/pcal/dcal stubs; +optional: the secondary dirs and content files. Chose a warning over a +=user-error= so a directory hiccup surfaces loudly without aborting init. Added +error-path tests for the optional-logs and required-warns behavior. -Use the same Makefile targets in this repo, but design the adapter so other -Elisp projects can run without this Makefile. +**** 2026-05-23 Sat @ 03:33:30 -0500 Fixed env-desktop-p doc and normalized the X predicates +Corrected =env-desktop-p='s docstring (it described a laptop; the function returns t for the desktop/no-battery case). Switched =env-x-p= from =(string= (window-system) "x")= to =(eq (window-system) 'x)= to match =env-x11-p='s style, and documented the difference: =env-x-p= is any X display incl. XWayland, =env-x11-p= is a real X11 session with no WAYLAND_DISPLAY. Behavior unchanged, existing display-predicate tests stay green. Fixed in 14ec32b2. -***** 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. +Left =cj/match-localtime-to-zoneinfo= caching alone — it was a "consider if this runs during startup" note, not an acceptance item, and it doesn't run at startup. File a separate task if it ever shows up in a profile. -***** 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. +**** 2026-05-25 Mon @ 16:59:37 -0500 Added system-defaults settings smoke tests -**** 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. +Added =tests/test-system-defaults.el= with three settings assertions the +existing files didn't cover: custom-file is redirected to a temp trashbin +(not the repo), backups land under =user-emacs-directory/backups=, and the +minibuffer GC hooks are wired onto the minibuffer hooks. The module's +functions were already covered by =test-system-defaults-functions.el= and the +=vc-follow-symlinks= default by its own file, so this stayed narrow to the +settings gap. Extracted the shared sandbox loader into +=tests/testutil-system-defaults.el= so both the new file and the +vc-follow-symlinks test use one copy. The backups test clears +=cj/backup-directory= first because it's a defvar that only recomputes when +unbound. -**** 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] Move package bootstrap policy out of =early-init.el= :refactor: -Prefer project scripts over raw =npx= when present: -- =pnpm test -- path= -- =npm test -- path= -- =yarn test path= -- =bun test path= +=early-init.el= currently handles performance/debug setup, package archive +construction, archive refresh policy, =use-package= installation, package +signature policy, and Unicode defaults. That makes early startup do network- and +package-manager-adjacent work before the regular module system exists. -***** 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 +This overlaps with the existing [#B] "Split early startup from package +bootstrap" task; keep the implementation there if that task is already active. +This foundation review finding is the module-level acceptance detail. -***** Result Parsing -Parse: -- failing test names -- file paths and line numbers -- snapshot failures -- coverage summary +Expected outcome: +- =early-init.el= keeps only settings that must happen before normal init: + startup GC/file-handler tuning, debug flag setup, native-comp workaround, + =load-prefer-newer=, site-start suppression, and package startup suppression. +- Package archive setup, refresh/install policy, and =use-package= bootstrap + live in a normal module or bootstrap helper that can be tested directly. +- Offline and missing-package states produce actionable errors without doing an + unexpected package refresh during early startup. +- Existing local repo and ELPA mirror behavior is preserved. -Treat snapshot updates as an explicit command, not an automatic side effect. +Pitfalls: +- Do not break first-run bootstrap on a clean machine. +- Keep local repositories higher priority than online archives. +- Avoid prompting or refreshing archives during batch tests. -**** 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. +**** TODO [#B] Decide and test package signature policy -**** 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. +=early-init.el= sets =package-check-signature= to =nil= after package setup, with +an earlier commented emergency toggle for expired signatures. That may be +intentional for local mirrors, but it is security-sensitive enough to make the +policy explicit. -**** 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: +Expected outcome: +- Document when signatures should be disabled, if ever. +- Prefer signatures on for online archives unless a local-mirror workflow + requires otherwise. +- If signatures stay disabled, add a clear comment explaining the trust model. +- Add a small test or validation helper around the computed package policy if + package bootstrap is extracted. -#+begin_src elisp -((:name "unit" - :command ("npm" "run" "test:unit" "--" "{file}")) - (:name "integration" - :command ("pytest" "tests/integration" "-q"))) -#+end_src +**** 2026-05-16 Sat @ 02:34:22 -0500 Consolidated user-home-dir into early-init as canonical -**** 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 +Canonical defconst in =early-init.el= kept (the package-archive paths +need it during package bootstrap, before normal modules load). +=modules/user-constants.el= switched to a `defvar` with the identical +=(getenv "HOME")= expression and a comment explaining the pattern: +defvar is a no-op at runtime (early-init's defconst wins, defvar +doesn't reassign a bound symbol), but it lets the module load / +byte-compile standalone when early-init hasn't run. Drift risk is +mitigated by both expressions being =(getenv "HOME")= literally; the +comment flags the requirement to keep them identical. -***** 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 +**** 2026-05-16 Sat @ 02:34:22 -0500 Dropped redundant autoload alongside compile-time require in system-defaults.el -***** Modeline / Headerline Signal -Show the last run status for the current project: -- green passed -- red failed -- yellow running -- gray no run +Kept the =eval-when-compile= requires for =host-environment= and +=user-constants= (they silence free-variable / free-function warnings +during byte-compile in isolation) and dropped the +=(autoload 'env-bsd-p ...)= line — both modules are loaded earlier in +init.el at runtime, and the eval-when-compile already exposes +=env-bsd-p= to the byte-compiler. Added a comment documenting the +chosen boundary. -Keep it quiet and optional. +**** 2026-05-16 Sat @ 02:34:22 -0500 Converted cj/debug-modules and cj/use-online-repos to defcustom -***** History -Store recent run requests per project: -- rerun last -- rerun last failed -- choose previous command -- compare duration/status against previous run +Both toggles now live as =defcustom= with explicit =:type= and +=:group 'cj=. =cj/debug-modules='s type is the natural choice form: +either =t= (all modules) or a list of module symbols. +=cj/use-online-repos='s type is boolean. Added a top-level +=(defgroup cj ...)= in early-init.el so the group exists for both, +plus the package-priority constants below it. -**** 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= - -Example: - -#+begin_src elisp -((nil . ((cj/test-runner-project-overrides - . (:adapter pytest - :default-args ("-q") - :coverage-args ("--cov=src")))))) -#+end_src +**** 2026-05-25 Mon @ 18:29:40 -0500 Made the Customize-save discard non-silent -**** 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. +Took the display-warning option. =cj/--warn-customize-discarded= advises +=custom-save-all= (the chokepoint both =customize-save-variable= and the +Customize "Save for Future Sessions" button funnel through) with a one-shot +=:before= warning that explains the edit won't persist and points at the Elisp +init files. The advice removes itself after firing, so it warns once per +session, and the body never runs at load, so startup stays quiet. Kept the +throwaway =custom-file= as-is. Test added in =tests/test-system-defaults.el=. -**** 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 +**** 2026-05-16 Sat @ 02:34:22 -0500 Named the package archive priorities in early-init.el -**** 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= +Nine =defconst= entries replace the magic numbers: +=cj/package-priority-localrepo= (200) for the project-pinned repo, +four =cj/package-priority-mirror-*= entries for the local ELPA +mirrors (125 / 120 / 115 / 100), four =cj/package-priority-online-*= +entries for the online archives (25 / 20 / 15 / 5). A header comment +above the block explains the local-first ordering and the +gnu > nongnu > melpa > melpa-stable trust ranking within each tier. -**** 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. +**** 2026-05-16 Sat @ 02:34:22 -0500 Deleted dead world-clock block in chrono-tools.el -***** 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 19-line commented-out =use-package time= block is gone. The +=time-zones= use-package directly above it is the active replacement; +git history preserves the old config if anyone needs to dig it back up. -***** 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. +**** 2026-05-16 Sat @ 02:34:22 -0500 Added coverage for cj/tmr-select-sound-file with a pre-test refactor -***** Phase 4: UI and watch modes -- Add transient menu. -- Add result buffer. -- Add cancellation and rerun history. -- Add watch commands where supported. +The prefix-arg branch now delegates to =cj/tmr-reset-sound-to-default= +directly (single source for the reset path). Extracted a pure helper +=cj/tmr--available-sound-files= so the directory scan is testable +without driving =completing-read=. =tests/test-chrono-tools-tmr-sound.el= +covers Normal / Boundary / Error: available-sounds against a populated +dir, empty dir, missing dir; reset path; select with prefix-arg +(delegates to reset, no prompt); select normal (picks a file); select +boundary paths for empty dir, missing dir, cancel (empty completion). +9 tests, all green. -***** Phase 5: Coverage and AI -- Connect coverage commands to adapter capabilities. -- Add failure summarization with redaction. -- Add coverage-gap summarization. +*** DOING [#B] Harden custom editing utility modules -**** 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. +Scope: +- =custom-buffer-file.el= +- =custom-case.el= +- =custom-comments.el= +- =custom-datetime.el= +- =custom-line-paragraph.el= +- =custom-misc.el= +- =custom-ordering.el= +- =custom-text-enclose.el= +- =custom-whitespace.el= +- =external-open.el= +- =media-utils.el= -** TODO [#B] F-key Completion :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-02 -:END: +Review progress: +- Core =custom-*= text modules reviewed 2026-05-03. They have unusually strong + direct ERT coverage compared with the rest of the config. +- =external-open.el= and =media-utils.el= reviewed 2026-05-03. See child tasks. +- =custom-buffer-file.el= reviewed 2026-05-03. See child tasks. -The L546 ticket "Rework dev F-keys" landed roughly 75% as of the 2026-05-27 audit. F4 (compile+run dispatcher, project-type detection, clean-rebuild, projectile cache revert), F7 (coverage), and the format-key migration off F6 are all shipped with ERT coverage. F6 ships Phase 2a only — "All tests" and "Current file's tests" via plain F6 and C-F6. +Completion review 2026-05-15: +- Re-checked the scoped custom editing utility modules and their test files. +- The pure editing modules remain well covered by focused ERT tests. +- Remaining actionable issues are already logged below: process-launch + hardening and coverage for =external-open.el= / =media-utils.el=, + destructive buffer/file keybinding policy, and explicit cross-module + autoload/require boundaries. -Phase 2b remains: per-language test discovery, the "Run a test..." menu entry, M-F6 fast path, buffer-local last-test memory, and the spec-mandated "No tests found for " error. The =dev-fkeys.el= header (L35–46) already sketches the tree-sitter capture-then-filter pattern needed to work around Emacs bug #79687 on the emacs-30 branch. +**** TODO [#B] Harden external process launching in =external-open.el= and =media-utils.el= :refactor: -Two smaller cleanups also fall out: the header comment claims TS/JS is "punted for v1" while the cmd-builder at =dev-fkeys.el:384= actually emits a vitest/jest command, and the cmd-builder is a likely home for =cj/--tests-in-buffer= once it lands. +=external-open.el= and =media-utils.el= use shell command strings for launching +external applications: +- =cj/open-this-file-with= interpolates the user-supplied command into + =call-process-shell-command=. +- =cj/media-play-it= builds a shell command for players and optional =yt-dlp= + stream extraction. -Open: helper home — keep =cj/--tests-in-buffer= in =dev-fkeys.el= (per L546 spec) or push it into =test-runner.el= (per the parallel "Fix up test runner" thread). Elisp "Run a test..." — drill into individual =ert-deftest= names, or keep the current regex-aggregate (=make test-name TEST=^test--=). +This is mostly controlled local input, but it is still brittle: command paths +with spaces can fail, arguments are hard to reason about, and future URL/source +changes could create shell quoting bugs. -*** TODO [#B] Per-language test discovery helper :feature:test: -Build =cj/--tests-in-buffer= returning a list of test names; tree-sitter capture-then-filter for python/go/ts/js per the bug #79687 workaround in =dev-fkeys.el= L35–46; sexp scan for elisp =ert-deftest= forms. +Expected outcome: +- Prefer =start-process= / =call-process= with argv lists where possible. +- If shell is required for command substitution, isolate and quote every + untrusted value. +- Add tests around command construction for: + - file paths with spaces and shell metacharacters, + - URL strings with shell metacharacters, + - configured player args, + - missing executable errors. -*** TODO [#B] F6 Run-a-test menu entry :feature:test: -Add "Run a test..." to =cj/f6-test-runner= candidates; pre-select =cj/--last-test-run=; signal =user-error= "No tests found for " when discovery returns nil. +Pitfalls: +- =cj/open-this-file-with= may intentionally accept "program plus args". If so, + split the command deliberately or introduce separate program/args prompts. +- Some media players need different URL handling; preserve the existing + =:needs-stream-url= behavior. -*** TODO [#B] M-F6 fast path :feature:test: -Bind =M-= to a thin wrapper that calls the same "Run a test..." path directly; release the reservation comment at =dev-fkeys.el:541=. +**** 2026-05-23 Sat @ 03:41:00 -0500 Added media-utils coverage; external-open already covered +=external-open= already had three test files (=test-external-open-commands.el=, =test-external-open-lib-command.el=, =test-external-open-lib-launcher-p.el=). =media-utils.el= had none, so I added =test-media-utils.el= (8 cases): player availability from =cj/media-players=, the play command-builder (direct vs yt-dlp -g stream wrap), and the missing-tool error paths for the player, =yt-dlp=, and =tsp=. All process/exec boundaries mocked. Added in the test-media-utils commit. -*** TODO [#B] Buffer-local cj/--last-test-run :feature:test: -Add the buffer-local var, set it on each "Run a test..." selection, use it as the completing-read default so a bare RET re-runs the last test. +**** TODO [#B] Audit destructive buffer/file keybindings for confirmation policy -*** 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. +=cj/buffer-and-file-map= includes destructive operations under =C-; b=, +including delete file, erase buffer, clear top, clear bottom, and revert. Some +are intentionally fast, but this module is high blast radius. -** 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). +Expected outcome: +- Decide which operations need confirmation when the buffer is modified or + visiting a file. +- At minimum, document the intended policy in =custom-buffer-file.el=. +- Consider safer wrappers for =erase-buffer= and =revert-buffer= under the + personal keymap. -** TODO [#B] Keymap consolidation — resolve decisions, run Phase 1-2 :feature:refactor:solo: -: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). +**** 2026-05-24 Sun @ 14:43:13 -0500 Declared cross-module commands bound in custom keymaps -** 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. +Byte-compiling =custom-ordering.el= and =custom-text-enclose.el= standalone warned "not known to be defined" for =cj/org-sort-by-todo-and-priority= (owned by org-config) and =change-inner=/=change-outer= (the change-inner package). Both work at runtime — org-config loads eagerly, and text-config autoloads change-inner via =use-package :commands= — so only the compiler needed telling; added =declare-function= for each (no autoload needed since the runtime autoload/eager-load already exists). =custom-buffer-file.el= byte-compiles clean already, so it needed no change. Commit =ad173a77=. -** TODO [#A] Unify Signel and All Messengers into one UX :feature: -:PROPERTIES: -:LAST_REVIEWED: 2026-06-16 -: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. +**** 2026-05-24 Sun @ 07:26:31 -0500 Extracted shared region-or-buffer bounds helper -** 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. +The described docstring mismatch was already resolved: =custom-ordering.el='s =cj/--arrayify=/=cj/--unarrayify= now document an explicit =(start end)= contract accurately and are region-required by design. The remaining work was the enclose side, where append/prepend/indent/dedent each inlined the same region-or-buffer bounds block (four copies). Extracted =cj/--region-or-buffer-bounds= as the single source of that contract and routed all four through it (behavior unchanged; public-wrapper tests still pass). Each pair now has one clear, consistent, documented contract. New tests cover the helper (region / no-region / empty buffer). Commit =a7cc8948=. -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-05-16 Sat @ 02:47:15 -0500 Preserved trailing newlines in custom-ordering output -*** 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. +Both =cj/--arrayify= and =cj/--unarrayify= now detect a trailing +newline on the input region (via =string-suffix-p=) and re-append it +to the result. Matches the pattern =custom-text-enclose.el= already +uses. Docstrings updated to document the contract. -*** TODO [#B] Follow-up: evaluate ghostel-eshell + ghostel-compile -D3 — ghostel-eshell as eshell visual backend; ghostel-compile against F4 dev-fkeys. +**** 2026-05-16 Sat @ 02:47:15 -0500 Guarded cj/duplicate-line-or-region against modes without comment syntax -*** 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). +=cj/duplicate-line-or-region= now signals a clear =user-error= when +=COMMENT= is non-nil but the current mode has no =comment-start= +(=fundamental-mode= and similar). Docstring updated to document the +error. Picks the "error out clearly" branch from the task body -- +restricting the binding per-mode would be a larger refactor that +isn't justified for the silent-malformed-output blast radius. -*** 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-05-16 Sat @ 02:47:15 -0500 Made external-open advice install explicit via cj/external-open-install-advice -*** 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. +Factored the =advice-remove= / =advice-add= pair into +=cj/external-open-install-advice= and called it once at the bottom +of the module. Same idempotent shape (remove-then-add) but now the +intent is named. Re-running the module updates the advice rather +than stacking it; if a future caller wants to opt out, they can +=advice-remove= the helper or skip calling it altogether. -*** 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-05-16 Sat @ 02:47:15 -0500 Added cj/--validate-decoration-char across all six divider/border helpers -*** 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. +New top-level validator =cj/--validate-decoration-char= rejects +anything that isn't a printable single-character string and signals +=user-error=. Wired into all six internal helpers: +=cj/--comment-inline-border=, =cj/--comment-simple-divider=, +=cj/--comment-padded-divider=, =cj/--comment-box=, +=cj/--comment-heavy-box=, =cj/--comment-block-banner=. The five +nil-decoration ERT tests updated from =:type 'wrong-type-argument= +(the old crash signal from =string-to-char= on nil) to +=:type 'user-error=, since the guard now produces a clear message +instead of a deep crash. -*** 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-05-23 Sat @ 03:38:30 -0500 Filled the remaining title-case edge gaps +=test-custom-case-title-case-region.el= already had 29 cases (empty region, unicode words, numbers, separators, colon resets, partial region). The named gaps that were missing — leading-quote and leading-paren handling, plus a caseless RTL first word — are now covered by three boundary tests (32 total). Added in 3841c59e. -*** 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-16 Sat @ 02:47:15 -0500 Extracted cj/--require-spell-checker -*** 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. +Both =cj/flyspell-toggle= and =cj/flyspell-then-abbrev= now call +=cj/--require-spell-checker= instead of carrying their own copy of +the executable-find check. The checker list lives in the new +defconst =cj/--spell-checker-executables=, so adding nuspell (or any +other checker) is a one-line edit. Top-level =(require 'cl-lib)= +added since the new helper uses =cl-some=. -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. +**** 2026-05-23 Sat @ 03:44:50 -0500 Covered flyspell-and-abbrev testable seams +Added =test-flyspell-and-abbrev.el= (8 cases): =cj/--require-spell-checker= (PATH gate, mocked), =cj/find-previous-flyspell-overlay= against synthetic overlays (closest-previous match, non-flyspell skipped, nil when none), and =cj/flyspell-on-for-buffer-type= (prog-mode -> flyspell-prog-mode, text-mode -> flyspell-mode). Left =cj/flyspell-then-abbrev= to manual testing — pinning its flyspell-UI orchestration would mean mocking flyspell internals rather than our logic. Added in the test-flyspell-abbrev commit. -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]]. +*** 2026-06-12 Fri @ 07:14:11 -0500 Hardened UI and navigation modules -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. +Scope: +- =ui-config.el= +- =ui-navigation.el= +- =ui-theme.el= +- =font-config.el= +- =modeline-config.el= +- =selection-framework.el= +- =mousetrap-mode.el= +- =popper-config.el= -*** 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. +Review progress: +- Reviewed 2026-05-03. +- =mousetrap-mode.el= has strong focused and integration tests. +- =modeline-config.el= has pure string-helper coverage, but not VC/runtime + segment behavior. +- =font-config.el=, =ui-theme.el=, =selection-framework.el=, =ui-navigation.el=, + and =popper-config.el= have little direct test coverage. -*** 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. +Completion review 2026-05-15: +- Re-checked the scoped UI/navigation modules and current tests. +- =mousetrap-mode.el=, =ui-navigation.el=, =ui-theme.el=, + =selection-framework.el=, and selected modeline/UI helpers now have focused + tests, but the font/modeline/popper runtime policy remains under-tested. +- Existing cleanup below covers the disabled =popper-config.el= load-graph + issue; added a separate test-gap task for the remaining UI smoke coverage. -*** 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-05-25 Mon @ 17:05:00 -0500 Added UI/navigation runtime smoke coverage -*** 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. +Added =tests/test-font-config.el= (4 tests): cj/font-installed-p returns t/nil +off find-font, and cj/apply-font-settings-to-frame is a no-op on a non-GUI +frame and applies the preset exactly once per frame (idempotent). find-font, +env-gui-p, and fontaine-set-preset are stubbed so the run stays headless, and +a skip-unless on the demanded packages keeps a bare checkout green. +font-config had zero direct coverage; this fills the gap the task named. -*** 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. +modeline-config was already well covered (string-cut-middle, string-truncate-p, +vc-cache, vc-cache-key, the flycheck segment, the recording indicator), so it +needed no net-new smoke tests. popper-config's no-op smoke test is gated on the +"Decide whether popper-config.el should exist while disabled" task and was +deferred there, since whether to write it depends on that keep/remove call. -** PROJECT [#B] Module-by-module hardening -:PROPERTIES: -:LAST_REVIEWED: 2026-06-05 -:END: +Original scope: +- =font-config.el=: font fallback/daemon frame setup does not error when + optional fonts or emoji packages are absent. +- =modeline-config.el=: runtime segment assembly handles missing VC/project + data and does not signal in non-file buffers. +- =popper-config.el=: if the module remains in =init.el= while disabled, a + smoke test should prove requiring it is an intentional no-op. -Review every file in =modules/= and capture concrete bugs, tests, refactors, -and design improvements as child tasks. This is intentionally separate from the -top-level architecture review: the architecture project tracks cross-cutting -load/startup/test structure, while this project tracks module-specific work. +**** 2026-05-26 Tue @ 17:33:28 -0500 Removed popper-config.el (disabled no-op) +Deleted =modules/popper-config.el= and its =(require 'popper-config)= in =init.el= (commit 1cca84c5). It was =use-package :disabled t=, so use-package elided the whole form and it ran nothing while still sitting in the load graph. No test existed and none was needed. validate-modules passes and init loads clean. The config stays in git history if popper is ever wanted. -Audit reconciliation 2026-05-27: four sessions between 2026-05-23 and -2026-05-26 drained the umbrella significantly. Roughly 24 of the original -~89 sub-task findings remain open (TODO/DOING/VERIFY) across all six tracks. -Notable shipped work since the 2026-05-22 review: user-constants -filesystem-init split, system-defaults smoke tests, env-desktop-p doc fix, -popper-config removal, UI/navigation runtime smoke coverage, mu4e -org-contacts coverage, prog-lisp smoke coverage, Org export tool guards. -The six =***= track tasks are all still DOING (track status unchanged); -the change is mass of completed sub-work, not track status. +***** 2026-05-26 Tue @ 15:15:43 -0500 Decided: remove popper-config.el +Craig's call: remove it (quick, solo). It has been a disabled no-op in the load graph. Remaining action: drop =(require 'popper-config)= from =init.el= and delete =modules/popper-config.el= (and any test), then close this task. -Re-review pass 2026-05-15: -- Each of the six existing review tracks (foundation, custom editing, UI / - navigation, Org workflow, programming workflow, integrations and - applications) was re-walked as if it had not been reviewed before. -- 32 new sub-task findings filed across the tracks above (foundation 5, - custom editing 6, UI / navigation 9, Org workflow 3, programming 6, - integrations 2). Findings already covered by an existing sub-task were - dropped during consolidation. -- A separate =Review newly added modules= task lists the 24 modules that - were either added after the parent task was written (post-2026-04) or - fell outside the original scope lists. Each is routed to its target - track; module-specific findings are filed under the relevant track. +**** 2026-05-16 Sat @ 02:55:14 -0500 Moved popper-mode activation from :init to :config -Review protocol for each module: -- Read the module directly, not just the test names. -- Check runtime dependencies, top-level side effects, keybindings, timers, - external executable assumptions, secrets, host-specific paths, and user-data - writes. -- Check existing test coverage and whether tests protect the highest-risk - behavior. -- Promote larger findings into child =PROJECT= tasks with phases. Keep small - fixes as plain =TODO= tasks. +=popper-mode +1= and =popper-echo-mode +1= now live in the +=:config= block of =modules/popper-config.el='s use-package form. +=:disabled t= now actually disables the mode (=:config= is skipped +when disabled; =:init= still runs but it only sets the reference- +buffer list and the display-buffer-alist entry, both of which are +harmless no-ops when popper itself never loads). Comment in the +module explains the split. -Priority scheme: use the top-level =Priority Scheme= section in this file. +**** 2026-05-16 Sat @ 02:55:14 -0500 Made cj/modeline-vc-fetch fall back when vc-git--symbolic-ref is missing -Suggested review order: -1. Foundation: =system-lib=, =user-constants=, =host-environment=, - =system-defaults=, =keybindings=, =config-utilities=, =early-init=, - =init=. -2. Custom editing utilities: =custom-*=, =external-open=, =media-utils=. -3. UI and navigation: =ui-*=, =font-config=, =modeline-config=, - =selection-framework=, =mousetrap-mode=, =popper-config=. -4. Org workflow: =org-*=, =calendar-sync=, =hugo-config=, =gloss-config=. -5. Programming workflow: =prog-*=, =dev-fkeys=, =test-runner=, - =coverage-*=, =vc-config=. -6. Integrations and applications: mail, Slack, ERC, Elfeed, EWW, Dirvish, - PDF, Calibre, music, recording/transcription, AI/rest tooling. +The =require 'vc-git= now uses =nil 'noerror=, and the call to +=vc-git--symbolic-ref= is gated on =(fboundp ...)= so an Emacs +version that renames or removes the internal accessor just leaves +=branch= at =vc-working-revision='s output instead of crashing the +modeline render. Added =ignore-errors= around the call too in case +the internal accessor signals on unusual inputs. -*** DOING [#B] Harden foundation modules +**** 2026-05-25 Mon @ 18:18:29 -0500 Theme-aware font label face in cj/display-available-fonts -Scope: -- =system-lib.el= -- =user-constants.el= -- =host-environment.el= -- =system-defaults.el= -- =keybindings.el= -- =config-utilities.el= -- =early-init.el= -- =init.el= +Replaced the hardcoded =((:foreground "Light Blue" :weight bold))= label +face in =modules/font-config.el= with =(font-lock-keyword-face (:weight +bold))= so the family header follows theme contrast instead of being +unreadable on light themes. The Regular/Bold/Italic sample lines stay as-is +(they render in each font family on purpose). -Expected output: -- Add one child task for each actionable finding. -- Note "no action" only when the module has been reviewed and no task is - needed. -- Cross-reference existing architecture tasks instead of duplicating them. +=modules/font-config.el:266= hardcodes ="Light Blue"= and gray +foreground for font labels. Switching themes (especially light +themes) makes the labels nearly unreadable. Replace the literal +color with a face reference (=font-lock-keyword-face= or a face this +config owns) so the labels follow theme contrast. -Review progress: -- =system-lib.el=: reviewed 2026-05-03. No immediate action beyond the existing - [#B] system-lib extraction task. -- =host-environment.el=: reviewed 2026-05-03. See child tasks below. -- =user-constants.el=: reviewed 2026-05-03. See child tasks below. -- =system-defaults.el=: reviewed 2026-05-03. See child tasks below. -- =keybindings.el=: reviewed during architecture pass. No new module-specific - action beyond the load-order/keymap architecture tasks. -- =config-utilities.el=: reviewed 2026-05-03. No new module-specific action; - profiling extraction is already tracked by [#B] "Build debug-profiling.el - module". -- =early-init.el=: reviewed 2026-05-10. See child tasks below and the existing - [#B] "Split early startup from package bootstrap" task. -- =init.el=: reviewed 2026-05-10. See child tasks below and the existing - eager load-graph architecture tasks. +**** 2026-05-25 Mon @ 18:18:29 -0500 Routed emoji fontset through per-frame hook in daemon mode -Completion review 2026-05-15: -- Re-read the parent =Module-by-module review and hardening= context and the - adjacent architecture follow-up so this review stays module-specific. -- Re-checked all scoped files against the review protocol. Existing child - tasks below still cover the actionable module findings for - =user-constants.el=, =host-environment.el=, =system-defaults.el=, and - =early-init.el=. -- =system-lib.el=, =keybindings.el=, =config-utilities.el=, and =init.el= do - not need additional module-specific child tasks from this pass; remaining - concerns are already tracked by the utility-consolidation, keymap - registration, debug-profiling, and eager-load-graph architecture tasks. +The emoji-fontset =(when (env-gui-p) (cond ...))= block in +=modules/font-config.el= ran once at load. In daemon mode =env-gui-p= is +nil at load (no GUI frame yet), so a later =emacsclient -c= frame inherited +no emoji fontset. Wrapped it in =cj/setup-emoji-fontset= (idempotent, GUI- +guarded) and, mirroring the fontaine pattern, added it to +=server-after-make-frame-hook= in daemon mode / ran it directly otherwise. +The all-the-icons install path already used the per-frame hook, so it was +left alone. Manual daemon TTY-then-GUI test added under "Manual testing and +validation" (batch can't drive it). -**** 2026-05-25 Mon @ 19:12:02 -0500 Split path constants from filesystem init in user-constants.el +**** 2026-05-25 Mon @ 18:05:56 -0500 Cached mousetrap keymaps per profile -=(require 'user-constants)= used to create ~8 directories and ~10 org/calendar -files at load — the source of the stray =sync/org/= tree that appeared in the -repo during test runs. Both load-time forms are gone now; the path defconsts -stay pure, and init.el calls =cj/initialize-user-directories-and-files= on real -startup (guarded by =(unless noninteractive)=) so a bare require is -side-effect-free. Verified end-to-end: a require creates nothing, and the -interactive guard creates the backbone dirs and files. Landed in two commits on -the =refactor/user-constants-defer-fs-init= branch. +=mouse-trap--build-keymap= rebuilt the whole keymap on every major-mode hook. +Moved the build into =mouse-trap--build-keymap-1= and cached its result in +=mouse-trap--keymap-cache=, keyed on =(profile-name . allowed-categories)=, so +the same profile reuses the cached map and editing a profile's categories +changes the key and rebuilds. Sharing one keymap object across buffers is safe +since the map only binds disallowed events to =ignore= and is never mutated. +Added =mouse-trap--clear-keymap-cache=. Behavior is unchanged; 5 cache tests +plus the existing 66 mousetrap tests pass. Done by subagent, reviewed. -***** 2026-05-25 Mon @ 19:12:02 -0500 Extracted pure path definitions from startup writes +**** 2026-05-24 Sun @ 07:26:31 -0500 Keyed VC modeline cache on resolved truename -Removed the top-level calendar =dolist= and the top-level initializer call, and -folded gcal/pcal/dcal into =cj/initialize-user-directories-and-files=. init.el -now calls it right after the require, guarded by =(unless noninteractive)=. -Added =tests/test-user-constants.el= (loading creates nothing; the initializer -creates the configured paths) and updated the module header — top-level side -effects are now none and it's safe to load in tests. +=cj/modeline-vc-cache-key= keyed on =(list file cj/modeline-vc-show-remote)=, so a symlink whose target moved (shared drives, CI workspaces) kept serving the old VC backend. Added =(file-truename file)= to the key — one stat per refresh, cheap next to the VC calls the cache avoids — so a re-pointed symlink produces a different key and refreshes. Tests cover truename inclusion, stability for an unchanged file, and a symlink whose target moves. Commit =9135298c=. -***** 2026-05-25 Mon @ 19:12:02 -0500 Made initialization failures actionable +**** 2026-05-24 Sun @ 04:01:02 -0500 Verified C-s already advances isearch — non-bug, no change -=cj/verify-or-create-dir=/=-file= took an optional =required= flag routed -through =cj/--report-path-failure=: required failures raise a prominent -=display-warning=, optional ones are logged. The initializer groups paths by -that split — required: the sync/org/roam dirs and the gcal/pcal/dcal stubs; -optional: the secondary dirs and content files. Chose a warning over a -=user-error= so a directory hiccup surfaces loudly without aborting init. Added -error-path tests for the optional-logs and required-warns behavior. +The premise didn't hold on Emacs 30.2. Investigated in the live daemon: while isearch is active, =overriding-terminal-local-map= is =isearch-mode-map= and the effective =C-s= resolves to =isearch-repeat-forward=, not =cj/consult-line-or-repeat=. isearch installs its own map as an overriding map, so the global =C-s= binding can't shadow it during a search. =isearch-mode-map= already binds =C-s= to =isearch-repeat-forward= by default. Adding an explicit binding to the consult =:bind= block would only duplicate that default, so I left =selection-framework.el= unchanged. -**** 2026-05-23 Sat @ 03:33:30 -0500 Fixed env-desktop-p doc and normalized the X predicates -Corrected =env-desktop-p='s docstring (it described a laptop; the function returns t for the desktop/no-battery case). Switched =env-x-p= from =(string= (window-system) "x")= to =(eq (window-system) 'x)= to match =env-x11-p='s style, and documented the difference: =env-x-p= is any X display incl. XWayland, =env-x11-p= is a real X11 session with no WAYLAND_DISPLAY. Behavior unchanged, existing display-predicate tests stay green. Fixed in 14ec32b2. +**** 2026-05-16 Sat @ 02:55:14 -0500 Guarded cursor-color hook behind display-graphic-p (with daemon-mode catch) -Left =cj/match-localtime-to-zoneinfo= caching alone — it was a "consider if this runs during startup" note, not an acceptance item, and it doesn't run at startup. File a separate task if it ever shows up in a profile. - -**** 2026-05-25 Mon @ 16:59:37 -0500 Added system-defaults settings smoke tests +Both the install (=add-hook= on =post-command-hook=) and the function +body now gate on =(display-graphic-p)=. Batch and TTY runs short- +circuit cleanly: no per-command overhead, no =set-cursor-color= calls +on frames that don't have a cursor color. A =server-after-make-frame-hook= +catches the daemon case where the first GUI frame is created after +=ui-config= loads -- it installs the hook lazily the first time a +GUI frame appears. -Added =tests/test-system-defaults.el= with three settings assertions the -existing files didn't cover: custom-file is redirected to a temp trashbin -(not the repo), backups land under =user-emacs-directory/backups=, and the -minibuffer GC hooks are wired onto the minibuffer hooks. The module's -functions were already covered by =test-system-defaults-functions.el= and the -=vc-follow-symlinks= default by its own file, so this stayed narrow to the -settings gap. Extracted the shared sandbox loader into -=tests/testutil-system-defaults.el= so both the new file and the -vc-follow-symlinks test use one copy. The backups test clears -=cj/backup-directory= first because it's a defvar that only recomputes when -unbound. +The two cursor-color test files +(=test-ui-config--buffer-cursor-state.el=, +=test-ui-cursor-color-integration.el=) stub =display-graphic-p= to +return t so the work body still runs in batch. -**** TODO [#B] Move package bootstrap policy out of =early-init.el= :refactor: +**** 2026-05-16 Sat @ 02:55:14 -0500 Deferred nerd-icons by dropping :demand t plus an after-load safety net -=early-init.el= currently handles performance/debug setup, package archive -construction, archive refresh policy, =use-package= installation, package -signature policy, and Unicode defaults. That makes early startup do network- and -package-manager-adjacent work before the regular module system exists. +=(use-package nerd-icons :demand t ...)= flipped to =:defer t=. The +=:config= block already wraps the advice + tint in lazy-on-load +semantics, so the advice now installs the first time nerd-icons +loads (typically when a feature module like =dashboard-icon-type= +or =dirvish-attributes= triggers a load). An additional +=(with-eval-after-load 'nerd-icons ...)= block at module bottom +catches the "already-loaded when this module re-evaluates" case -- +it checks =advice-member-p= so it doesn't stack the advice on every +re-eval. -This overlaps with the existing [#B] "Split early startup from package -bootstrap" task; keep the implementation there if that task is already active. -This foundation review finding is the module-level acceptance detail. +*** DOING [#B] Harden Org workflow modules -Expected outcome: -- =early-init.el= keeps only settings that must happen before normal init: - startup GC/file-handler tuning, debug flag setup, native-comp workaround, - =load-prefer-newer=, site-start suppression, and package startup suppression. -- Package archive setup, refresh/install policy, and =use-package= bootstrap - live in a normal module or bootstrap helper that can be tested directly. -- Offline and missing-package states produce actionable errors without doing an - unexpected package refresh during early startup. -- Existing local repo and ELPA mirror behavior is preserved. +Scope: +- =org-config.el= +- =org-agenda-config.el= +- =org-babel-config.el= +- =org-capture-config.el= +- =org-contacts-config.el= +- =org-drill-config.el= +- =org-export-config.el= +- =org-noter-config.el= +- =org-refile-config.el= +- =org-reveal-config.el= +- =org-roam-config.el= +- =org-webclipper.el= +- =calendar-sync.el= +- =hugo-config.el= +- =gloss-config.el= -Pitfalls: -- Do not break first-run bootstrap on a clean machine. -- Keep local repositories higher priority than online archives. -- Avoid prompting or refreshing archives during batch tests. +Review progress: +- Reviewed 2026-05-03 at high level. +- =calendar-sync.el= has substantial focused coverage for parsing, recurrence, + timezone conversion, event conversion, and regressions. The largest remaining + risks are configuration/secrets, startup side effects, and process/network + boundaries. +- =org-agenda-config.el= and =org-refile-config.el= now have useful cache tests, + but the cache lifecycle and startup idle timers still deserve a design pass. +- =org-noter-config.el= already has an older [#B] workflow VERIFY task. Do not + duplicate that work here. +- =hugo-config.el= and =org-reveal-config.el= have focused helper coverage. +- =gloss-config.el= is a thin package wrapper; no local unit-test target unless + custom glue is added. +- Deeper pass 2026-05-10 added follow-up tasks for org-roam done hooks, drill + file selection/package loading, Org export defaults, Babel templates, and + contact/Mu4e boundaries. -**** TODO [#B] Decide and test package signature policy +Completion review 2026-05-15: +- Re-checked the scoped Org workflow modules and their test coverage. +- The broad parser/cache/helper areas now have useful focused tests, especially + =calendar-sync.el=, agenda/refile helpers, org-roam helpers, org-noter, Hugo, + reveal, and webclipper processing. +- Remaining issues are already logged below, including security-sensitive + calendar config and Babel evaluation policy, cache lifecycle/timer behavior, + org-roam destructive workflow guardrails, executable checks, capture-template + smoke tests, and Org workflow ownership documentation. -=early-init.el= sets =package-check-signature= to =nil= after package setup, with -an earlier commented emergency toggle for expired signatures. That may be -intentional for local mirrors, but it is security-sensitive enough to make the -policy explicit. +**** 2026-05-23 Sat @ 04:18:44 -0500 Split personal calendar config out of calendar-sync.el +=calendar-sync.el= now defaults =calendar-sync-calendars= to nil and loads the real plists from =calendar-sync-private-config-file= (an ignored file), so the engine carries no private feed tokens in source. =calendar-sync-status= / =calendar-sync-start= report missing config without erroring, and agenda startup is unaffected (tests/test-calendar-sync-no-config-startup.el). Rotating the previously-committed feed URLs remains a manual credential action — tracked under the L2557 calendar-sync hardening finding. -Expected outcome: -- Document when signatures should be disabled, if ever. -- Prefer signatures on for online archives unless a local-mirror workflow - requires otherwise. -- If signatures stay disabled, add a clear comment explaining the trust model. -- Add a small test or validation helper around the computed package policy if - package bootstrap is extracted. +**** 2026-06-12 Fri @ 07:14:11 -0500 Normalized Org agenda/refile cache lifecycle -**** 2026-05-16 Sat @ 02:34:22 -0500 Consolidated user-home-dir into early-init as canonical +All three children landed: shared cache helper extracted, idle timers gated, and directory-scan failures surfaced instead of hidden. -Canonical defconst in =early-init.el= kept (the package-archive paths -need it during package bootstrap, before normal modules load). -=modules/user-constants.el= switched to a `defvar` with the identical -=(getenv "HOME")= expression and a comment explaining the pattern: -defvar is a no-op at runtime (early-init's defconst wins, defvar -doesn't reassign a bound symbol), but it lets the module load / -byte-compile standalone when early-init hasn't run. Drift risk is -mitigated by both expressions being =(getenv "HOME")= literally; the -comment flags the requirement to keep them identical. +***** 2026-05-23 Sat @ 04:18:44 -0500 Extracted a shared cache helper +=cj-cache-lib.el= now provides =cj/cache-valid-p=, =cj/cache-building-p=, and =cj/cache-value-or-rebuild=, consumed by both =org-agenda-config.el= and =org-refile-config.el=; the contract is documented in =docs/specs/cache-helper-design-spec-implemented.org=. The agenda and refile public commands are unchanged. -**** 2026-05-16 Sat @ 02:34:22 -0500 Dropped redundant autoload alongside compile-time require in system-defaults.el +***** 2026-05-24 Sun @ 07:26:31 -0500 Surfaced directory-scan failures instead of hiding/crashing -Kept the =eval-when-compile= requires for =host-environment= and -=user-constants= (they silence free-variable / free-function warnings -during byte-compile in isolation) and dropped the -=(autoload 'env-bsd-p ...)= line — both modules are loaded earlier in -init.el at runtime, and the eval-when-compile already exposes -=env-bsd-p= to the byte-compiler. Added a comment documenting the -chosen boundary. +The refile scan caught =permission-denied= and silently dropped the dir, and crashed outright on a missing root (only permission-denied was caught, so a missing =code-dir=/=projects-dir= raised =file-missing= and aborted the build); the agenda build had the same missing-dir crash via =directory-files=. Extracted =cj/--org-refile-scan-dir= (warns + returns nil for missing/unreadable/permission-denied so the scan continues) and guarded the agenda scan the same way. Also fixed a latent bug found here: =org-refile-targets= was never declared special, so under =make compile= =cj/org-refile-in-file= let-bound it lexically and the scoped targets never reached =org-refile= — added =(defvar org-refile-targets)=. Tests cover the helper + the agenda missing-dir guard. Commit =12fb0108=. -**** 2026-05-16 Sat @ 02:34:22 -0500 Converted cj/debug-modules and cj/use-online-repos to defcustom +***** 2026-05-23 Sat @ 04:18:44 -0500 Gated cache idle timers out of batch +Both cache builders' =run-with-idle-timer= calls are wrapped in =(unless noninteractive)= (=org-refile-config.el:105=, =org-agenda-config.el:203=), so requiring the modules in batch schedules nothing. =tests/test-architecture-startup-contracts.el= scans every module and asserts there are no unguarded top-level timer forms. -Both toggles now live as =defcustom= with explicit =:type= and -=:group 'cj=. =cj/debug-modules='s type is the natural choice form: -either =t= (all modules) or a list of module symbols. -=cj/use-online-repos='s type is boolean. Added a top-level -=(defgroup cj ...)= in early-init.el so the group exists for both, -plus the package-priority constants below it. +**** 2026-05-23 Sat @ 19:48:00 -0500 Made org-confirm-babel-evaluate default to t with a toggle -**** 2026-05-25 Mon @ 18:29:40 -0500 Made the Customize-save discard non-silent +=org-babel-config.el= set =org-confirm-babel-evaluate= to nil globally, so every source block in every Org file (cloned repos, downloaded notes, web clips) ran without confirmation. Changed the default to =t= (confirm before running). Replaced the old =babel-confirm= command (which reported, and toggled only with a prefix arg) with =cj/org-babel-toggle-confirm=, a plain toggle bound to =C-; k= for flipping confirmation off in trusted files and back on. 3 ERT tests cover the toggle both directions plus the binding. -Took the display-warning option. =cj/--warn-customize-discarded= advises -=custom-save-all= (the chokepoint both =customize-save-variable= and the -Customize "Save for Future Sessions" button funnel through) with a one-shot -=:before= warning that explains the edit won't persist and points at the Elisp -init files. The advice removes itself after firing, so it warns once per -session, and the body never runs at load, so startup stays quiet. Kept the -throwaway =custom-file= as-is. Test added in =tests/test-system-defaults.el=. +**** TODO [#B] Rebind babel-confirm toggle off =C-; k= -**** 2026-05-16 Sat @ 02:34:22 -0500 Named the package archive priorities in early-init.el +=cj/org-babel-toggle-confirm= landed on =C-; k= as a placeholder. Pick a permanent home — likely under an Org-specific prefix rather than the global =C-;= map. -Nine =defconst= entries replace the magic numbers: -=cj/package-priority-localrepo= (200) for the project-pinned repo, -four =cj/package-priority-mirror-*= entries for the local ELPA -mirrors (125 / 120 / 115 / 100), four =cj/package-priority-online-*= -entries for the online archives (25 / 20 / 15 / 5). A header comment -above the block explains the local-first ordering and the -gnu > nongnu > melpa > melpa-stable trust ranking within each tier. +Triggered by: 2026-05-23 org-confirm-babel-evaluate hardening. -**** 2026-05-16 Sat @ 02:34:22 -0500 Deleted dead world-clock block in chrono-tools.el +**** 2026-05-24 Sun @ 14:43:13 -0500 Guarded move-branch-to-roam against data loss -The 19-line commented-out =use-package time= block is gone. The -=time-zones= use-package directly above it is the active replacement; -git history preserves the old config if anyone needs to dig it back up. +The command cut the subtree from the source before writing the new roam file, so any failure in demote/format/write/db-sync lost the subtree with no rollback. Reordered to write and verify the file on disk before =org-cut-subtree=, so a failed write aborts with the source intact. Added a no-clobber guard (refuse an existing target file) and a confirmation prompt for large subtrees (>= =cj/move-org-branch-confirm-lines=, 30) or buffers with unsaved changes. Decided: leave the source buffer modified and undoable rather than auto-saving, so the move stays reversible. New test drives the write-failure-preserves-source invariant via an unwritable roam dir. Commit =5c0fa15d=. -**** 2026-05-16 Sat @ 02:34:22 -0500 Added coverage for cj/tmr-select-sound-file with a pre-test refactor +**** 2026-05-25 Mon @ 18:29:40 -0500 Already done — clip URL/title scoped to dynamic bindings -The prefix-arg branch now delegates to =cj/tmr-reset-sound-to-default= -directly (single source for the reset path). Extracted a pure helper -=cj/tmr--available-sound-files= so the directory scan is testable -without driving =completing-read=. =tests/test-chrono-tools-tmr-sound.el= -covers Normal / Boundary / Error: available-sounds against a populated -dir, empty dir, missing dir; reset path; select with prefix-arg -(delegates to reset, no prompt); select normal (picks a file); select -boundary paths for empty dir, missing dir, cancel (empty completion). -9 tests, all green. +Found this already shipped in =6dfc41af= ("refactor(webclipper): scope clip +URL/title to dynamic bindings", 2026-05-24). The temp vars =cj/--webclip-url= / +=cj/--webclip-title= are now =let=-bound around the org-capture call instead of +=setq='d and manually cleared, so they unwind on every exit path including a +=C-g= abort — which covers the "aborted captures clear temp state" outcome more +completely than a finalize hook would. The bookmarklet/org-protocol workflow is +unchanged. =tests/test-org-webclipper-commands.el= already covers the +leaves-no-stale-state and aborted-capture-clears-state cases. No new work needed. -*** DOING [#B] Harden custom editing utility modules +**** 2026-05-25 Mon @ 17:51:17 -0500 Guarded external-tool assumptions in Org export/publishing -Scope: -- =custom-buffer-file.el= -- =custom-case.el= -- =custom-comments.el= -- =custom-datetime.el= -- =custom-line-paragraph.el= -- =custom-misc.el= -- =custom-ordering.el= -- =custom-text-enclose.el= -- =custom-whitespace.el= -- =external-open.el= -- =media-utils.el= +Added command-time guards to four export/publishing commands so a missing tool +fails with a user-error that names it, instead of an opaque process error (or, +for reveal.js, a silently broken presentation): +- =org-export-config.el=: zathura check in my/org-pandoc-export-to-pdf-and-open. +- =hugo-config.el=: hugo binary check in cj/hugo-preview, and the platform + file-manager opener check in cj/hugo-open-blog-dir-external. +- =org-reveal-config.el=: extracted =cj/--reveal-ensure-root= (checks the local + reveal.js clone, points at scripts/setup-reveal.sh), called from + cj/reveal-export and cj/reveal-preview-start. +- =org-webclipper.el=: pandoc check in cj/org-protocol-webclip-handler, the + single path that shells out to pandoc via org-web-tools. -Review progress: -- Core =custom-*= text modules reviewed 2026-05-03. They have unusually strong - direct ERT coverage compared with the rest of the config. -- =external-open.el= and =media-utils.el= reviewed 2026-05-03. See child tasks. -- =custom-buffer-file.el= reviewed 2026-05-03. See child tasks. +All checks run at command time, not load, so startup stays quiet. Each guard +has a user-error test; existing happy-path tests now stub the lookups. Things +deliberately not guarded: hugo-publish (magit, internal), the preview filter +(browse-url, internal), hugo-export-post (ox-hugo, Elisp). Done with four +parallel implementation agents, reviewed individually; full suite green. -Completion review 2026-05-15: -- Re-checked the scoped custom editing utility modules and their test files. -- The pure editing modules remain well covered by focused ERT tests. -- Remaining actionable issues are already logged below: process-launch - hardening and coverage for =external-open.el= / =media-utils.el=, - destructive buffer/file keybinding policy, and explicit cross-module - autoload/require boundaries. +**** 2026-05-16 Sat @ 03:44:45 -0500 Guarded org-roam completed-task hook with cj/--org-roam-should-copy-completed-task-p -**** TODO [#B] Harden external process launching in =external-open.el= and =media-utils.el= :refactor: +=org-roam-config.el= adds a global =org-after-todo-state-change-hook= that +copies newly completed tasks to today's org-roam journal. The hook assumes the +current Org buffer is visiting a file: -=external-open.el= and =media-utils.el= use shell command strings for launching -external applications: -- =cj/open-this-file-with= interpolates the user-supplied command into - =call-process-shell-command=. -- =cj/media-play-it= builds a shell command for players and optional =yt-dlp= - stream extraction. +- It calls =(buffer-file-name)= and passes the result to =string=. +- =cj/org-roam-copy-todo-to-today= later compares =file-truename= of the daily + file and the current buffer file. -This is mostly controlled local input, but it is still brittle: command paths -with spaces can fail, arguments are hard to reason about, and future URL/source -changes could create shell quoting bugs. +That can error in capture buffers, indirect buffers, temporary Org buffers, or +other fileless Org workflows. Expected outcome: -- Prefer =start-process= / =call-process= with argv lists where possible. -- If shell is required for command substitution, isolate and quote every - untrusted value. -- Add tests around command construction for: - - file paths with spaces and shell metacharacters, - - URL strings with shell metacharacters, - - configured player args, - - missing executable errors. +- Extract a predicate for "should copy this completed task to today's journal". +- Skip fileless buffers, calendar sync files, aborted capture buffers, and tasks + already in the target daily file. +- Keep the normal completed-task journal workflow unchanged. +- Add tests for fileless buffers, =gcal-file=, already-daily buffers, and a + normal project/todo buffer. -Pitfalls: -- =cj/open-this-file-with= may intentionally accept "program plus args". If so, - split the command deliberately or introduce separate program/args prompts. -- Some media players need different URL handling; preserve the existing - =:needs-stream-url= behavior. +**** 2026-05-24 Sun @ 04:30:14 -0500 Shared one validated drill-file selector -**** 2026-05-23 Sat @ 03:41:00 -0500 Added media-utils coverage; external-open already covered -=external-open= already had three test files (=test-external-open-commands.el=, =test-external-open-lib-command.el=, =test-external-open-lib-launcher-p.el=). =media-utils.el= had none, so I added =test-media-utils.el= (8 cases): player availability from =cj/media-players=, the play command-builder (direct vs yt-dlp -g stream wrap), and the missing-tool error paths for the player, =yt-dlp=, and =tsp=. All process/exec boundaries mocked. Added in the test-media-utils commit. +org-capture-config.el and org-drill-config.el each scanned =drill-dir= with an inline =directory-files= call, so a missing/empty/unreadable dir surfaced as a low-level error or an empty =completing-read= depending on which command ran. Added =cj/--drill-files-or-error=, the single validated entry point: clear =user-error= when the dir is missing, unreadable, or has no drill files; otherwise the list. =cj/--drill-pick-file= and both drill capture templates route through it; the pure =cj/--drill-files-in= primitive and its tests are unchanged. Tests cover missing/empty/non-org/normal. Commit =49038c41=. -**** TODO [#B] Audit destructive buffer/file keybindings for confirmation policy +**** 2026-05-24 Sun @ 14:43:13 -0500 Removed contradictory org-export-with-tasks default -=cj/buffer-and-file-map= includes destructive operations under =C-; b=, -including delete file, erase buffer, clear top, clear bottom, and revert. Some -are intentionally fast, but this module is high blast radius. +=org-export-config.el= set =org-export-with-tasks= twice (=("TODO")= then =nil=); the final =nil= won but the stale first line + comment contradicted it. Removed the leftover. =nil= (export no tasks) is the deliberate default — it was already winning, its comment matches, and it sits with the adjacent "without tags / section numbers by default" settings. Added a smoke test that fires the deferred =ox= :config and pins the value to =nil=. Commit =94ef5242=. + +**** 2026-05-23 Sat @ 03:48:50 -0500 Fixed java structure-template typo and pinned the aliases +=("java" . "src javas")= expanded to a bogus =#+begin_src javas=; corrected it to =src java=. Added =test-org-babel-config-structure-templates.el=, which requires the module then org-tempo (firing the deferred :config) and asserts =bash=, =zsh=, =el=, =py=, =json=, =yaml=, =java= each map to the intended src language. Fixed in the org-babel commit. + +**** TODO [#B] Make org-contacts/Mu4e boundaries explicit :refactor: + +=org-contacts-config.el= defines helpers that call Mu4e functions when the +current major mode is a Mu4e mode, and the =use-package org-contacts= block is +=:after (org mu4e)= while also requiring =mu4e= inside =:config=. This works in +the current eager setup, but the ownership boundary is unclear now that +=mu4e-org-contacts-integration.el= exists. Expected outcome: -- Decide which operations need confirmation when the buffer is modified or - visiting a file. -- At minimum, document the intended policy in =custom-buffer-file.el=. -- Consider safer wrappers for =erase-buffer= and =revert-buffer= under the - personal keymap. +- Decide whether contact capture-from-email behavior belongs in + =org-contacts-config.el= or the Mu4e integration modules. +- Add =declare-function= / autoloads or move Mu4e-specific code behind + =with-eval-after-load 'mu4e=. +- Keep plain Org contact commands usable on systems without Mu4e loaded. +- Add a smoke test for loading =org-contacts-config.el= without Mu4e stubs if + practical. -**** 2026-05-24 Sun @ 14:43:13 -0500 Declared cross-module commands bound in custom keymaps +**** TODO [#B] Add an Org workflow health check command :feature:solo: -Byte-compiling =custom-ordering.el= and =custom-text-enclose.el= standalone warned "not known to be defined" for =cj/org-sort-by-todo-and-priority= (owned by org-config) and =change-inner=/=change-outer= (the change-inner package). Both work at runtime — org-config loads eagerly, and text-config autoloads change-inner via =use-package :commands= — so only the compiler needed telling; added =declare-function= for each (no autoload needed since the runtime autoload/eager-load already exists). =custom-buffer-file.el= byte-compiles clean already, so it needed no change. Commit =ad173a77=. +Several Org workflow modules depend on personal paths, optional external tools, +and local package checkouts. Failures currently show up at command time in +different ways, depending on which module hits the missing dependency first. -**** 2026-05-24 Sun @ 07:26:31 -0500 Extracted shared region-or-buffer bounds helper +Recommended improvement: +- Add a lightweight =cj/org-workflow-doctor= command that checks the main Org + workflow prerequisites without mutating user data. +- Report status for core files/directories: =org-dir=, =roam-dir=, =drill-dir=, + =contacts-file=, =webclipped-file=, =cj/hugo-content-org-dir=, and + =cj/reveal-root=. +- Report optional executable/package availability for Pandoc/org-web-tools, + Hugo, reveal.js, org-drill, org-roam, and org-noter. +- Keep startup quiet; run this only on demand. +- Make the checker return structured data so it can be unit-tested and displayed + either in Messages or a buffer. -The described docstring mismatch was already resolved: =custom-ordering.el='s =cj/--arrayify=/=cj/--unarrayify= now document an explicit =(start end)= contract accurately and are region-required by design. The remaining work was the enclose side, where append/prepend/indent/dedent each inlined the same region-or-buffer bounds block (four copies). Extracted =cj/--region-or-buffer-bounds= as the single source of that contract and routed all four through it (behavior unchanged; public-wrapper tests still pass). Each pair now has one clear, consistent, documented contract. New tests cover the helper (region / no-region / empty buffer). Commit =a7cc8948=. +**** 2026-05-24 Sun @ 14:43:13 -0500 Added capture-template key + target smoke tests -**** 2026-05-16 Sat @ 02:47:15 -0500 Preserved trailing newlines in custom-ordering output +New =test-org-capture-templates-integrity.el= loads the cleanly-loadable capture modules (=org-capture-config=, =quick-video-capture=, =org-contacts-config=), applies their lazy additions, and asserts no two templates share a dispatch key and that every symbol-valued file target resolves to a non-empty path string. Literal-string targets (the video template's no-save =(file "")=) and lambda targets (drill file pickers) are excluded. Webclipper templates need org-web-tools at registration time, so they stay covered by their own test rather than this batch smoke test. Mutation-checked that the uniqueness assertion flags a duplicate key. Commit =2e3905c7=. -Both =cj/--arrayify= and =cj/--unarrayify= now detect a trailing -newline on the input region (via =string-suffix-p=) and re-append it -to the result. Matches the pattern =custom-text-enclose.el= already -uses. Docstrings updated to document the contract. +**** TODO [#B] Document Org workflow module ownership and load boundaries :refactor:solo: -**** 2026-05-16 Sat @ 02:47:15 -0500 Guarded cj/duplicate-line-or-region against modes without comment syntax +The Org workflow is spread across many modules with overlapping responsibilities: +capture templates, keymaps, org-protocol handlers, refile/agenda target +construction, roam notes, publishing, and document annotation. The code is +usable, but future load-order work will be easier with explicit ownership notes. -=cj/duplicate-line-or-region= now signals a clear =user-error= when -=COMMENT= is non-nil but the current mode has no =comment-start= -(=fundamental-mode= and similar). Docstring updated to document the -error. Picks the "error out clearly" branch from the task body -- -restricting the binding per-mode would be a larger refactor that -isn't justified for the silent-malformed-output blast radius. +Recommended improvement: +- Add a short design note under =docs/design/= that maps each Org module to the + behavior it owns. +- Call out which modules may mutate global Org variables, capture templates, + keymaps, and protocol handlers. +- Define which modules should be safe to load in batch mode and which are + allowed to start timers or require interactive packages. +- Link this note from the Org workflow review task and the broader load-graph + refactor. -**** 2026-05-16 Sat @ 02:47:15 -0500 Made external-open advice install explicit via cj/external-open-install-advice +**** 2026-05-16 Sat @ 03:44:45 -0500 Removed duplicate org-protocol-protocol-alist registration in cj/webclipper-ensure-initialized -Factored the =advice-remove= / =advice-add= pair into -=cj/external-open-install-advice= and called it once at the bottom -of the module. Same idempotent shape (remove-then-add) but now the -intent is named. Re-running the module updates the advice rather -than stacking it; if a future caller wants to opt out, they can -=advice-remove= the helper or skip calling it altogether. +The =webclip= protocol handler is registered twice: +=modules/org-webclipper.el:72-76= inside =cj/webclipper-ensure-initialized= +(unconditional =add-to-list=) and =:207-214= inside a +=with-eval-after-load 'org-protocol= block (=unless (assoc ...)= guard). +=add-to-list= uses =equal= membership so the two are effectively +idempotent, but maintaining two registration paths invites drift if +the alist entry shape ever changes. Pick one site -- the +=with-eval-after-load= block is the more robust location -- and +remove the other. -**** 2026-05-16 Sat @ 02:47:15 -0500 Added cj/--validate-decoration-char across all six divider/border helpers +**** 2026-05-16 Sat @ 03:44:45 -0500 Validated :url and :title in cj/org-protocol-webclip before stashing -New top-level validator =cj/--validate-decoration-char= rejects -anything that isn't a printable single-character string and signals -=user-error=. Wired into all six internal helpers: -=cj/--comment-inline-border=, =cj/--comment-simple-divider=, -=cj/--comment-padded-divider=, =cj/--comment-box=, -=cj/--comment-heavy-box=, =cj/--comment-block-banner=. The five -nil-decoration ERT tests updated from =:type 'wrong-type-argument= -(the old crash signal from =string-to-char= on nil) to -=:type 'user-error=, since the guard now produces a clear message -instead of a deep crash. +=modules/org-webclipper.el:124-125= extracts =:url= and =:title= from +the incoming protocol plist with no type or nil check. An unexpected +plist shape silently sets the globals to nil, and downstream code +fails inside the capture handler with confusing messages. Guard with +=(unless (and (stringp url) (not (string-empty-p url))) (user-error ...))= +before stashing. -**** 2026-05-23 Sat @ 03:38:30 -0500 Filled the remaining title-case edge gaps -=test-custom-case-title-case-region.el= already had 29 cases (empty region, unicode words, numbers, separators, colon resets, partial region). The named gaps that were missing — leading-quote and leading-paren handling, plus a caseless RTL first word — are now covered by three boundary tests (32 total). Added in 3841c59e. +**** 2026-05-24 Sun @ 07:26:31 -0500 Scoped webclip URL/title to dynamic bindings -**** 2026-05-16 Sat @ 02:47:15 -0500 Extracted cj/--require-spell-checker +The protocol handler =setq= globals =cj/webclip-current-url= / =cj/webclip-current-title= that the "W" template and handler read (and cleared), so an aborted/erroring capture left stale state for the next clip. Renamed to =cj/--webclip-url= / =cj/--webclip-title= and =let=-bind them around the =org-capture= call: the template =%(identity ...)= forms and the handler run within that dynamic extent, and an abort/error unwinds the binding automatically — no stale state, no manual clear. Mirrors the quick-video-capture fix. Tests updated to the new contract (visible-during-capture, nothing-left-after, aborted-leaves-nothing). Commit =6dfc41af=. -Both =cj/flyspell-toggle= and =cj/flyspell-then-abbrev= now call -=cj/--require-spell-checker= instead of carrying their own copy of -the executable-find check. The checker list lives in the new -defconst =cj/--spell-checker-executables=, so adding nuspell (or any -other checker) is a one-line edit. Top-level =(require 'cl-lib)= -added since the new helper uses =cl-some=. +**** 2026-05-16 Sat @ 03:44:45 -0500 Declared cross-module free vars in mu4e-org-contacts-integration.el -**** 2026-05-23 Sat @ 03:44:50 -0500 Covered flyspell-and-abbrev testable seams -Added =test-flyspell-and-abbrev.el= (8 cases): =cj/--require-spell-checker= (PATH gate, mocked), =cj/find-previous-flyspell-overlay= against synthetic overlays (closest-previous match, non-flyspell skipped, nil when none), and =cj/flyspell-on-for-buffer-type= (prog-mode -> flyspell-prog-mode, text-mode -> flyspell-mode). Left =cj/flyspell-then-abbrev= to manual testing — pinning its flyspell-UI orchestration would mean mocking flyspell internals rather than our logic. Added in the test-flyspell-abbrev commit. +The module reads =contacts-file= (defined in =user-constants.el=) and +calls =cj/get-all-contact-emails= (defined in =org-contacts-config.el=) +without any forward declaration at the top of the file. Byte-compile +in isolation warns about both as free variables / unknown functions. +Add =(eval-when-compile (defvar contacts-file))= and +=(declare-function cj/get-all-contact-emails "org-contacts-config")= +near the existing requires so the compile is clean and the +cross-module dependency is explicit at the top of the file. -*** 2026-06-12 Fri @ 07:14:11 -0500 Hardened UI and navigation modules +**** 2026-05-25 Mon @ 17:10:47 -0500 Added mu4e org-contacts completion coverage + +Added =tests/test-mu4e-org-contacts-integration.el= (10 tests). The capf +(cj/org-contacts-completion-at-point) is checked for the header-field and +compose-mode gating both ways, the bounds/table it returns when contacts +exist, and the empty-contacts case. TAB (cj/mu4e-org-contacts-tab-complete) +is checked across all three branches: completion-at-point in a header, +org-cycle in the org-msg body, indent elsewhere. Comma completion and the +direct-insert no-op-outside-header path round it out. mail-abbrev-in-expansion-header-p, +the mode actions, and cj/get-all-contact-emails are stubbed, so the run is +headless with no mu4e/org-contacts dependency. + +*** DOING [#B] Harden programming workflow modules Scope: -- =ui-config.el= -- =ui-navigation.el= -- =ui-theme.el= -- =font-config.el= -- =modeline-config.el= -- =selection-framework.el= -- =mousetrap-mode.el= -- =popper-config.el= +- =prog-c.el= +- =prog-general.el= +- =prog-go.el= +- =prog-json.el= +- =prog-lisp.el= +- =prog-lsp.el= +- =prog-python.el= +- =prog-shell.el= +- =prog-training.el= +- =prog-webdev.el= +- =prog-yaml.el= +- =coverage-core.el= +- =coverage-elisp.el= +- =test-runner.el= +- =vc-config.el= +- =keyboard-compat.el= +- =dev-fkeys.el= Review progress: -- Reviewed 2026-05-03. -- =mousetrap-mode.el= has strong focused and integration tests. -- =modeline-config.el= has pure string-helper coverage, but not VC/runtime - segment behavior. -- =font-config.el=, =ui-theme.el=, =selection-framework.el=, =ui-navigation.el=, - and =popper-config.el= have little direct test coverage. +- Reviewed 2026-05-03 at high level. +- =dev-fkeys.el= reviewed 2026-05-03 after local edits settled. The focused + dev-fkeys test set passed: 22 test files, 163 ERT tests. +- =coverage-core.el= / =coverage-elisp.el= have strong pure-helper tests. +- Language formatter wiring is covered for Python, Go, shell, webdev, JSON, and + YAML. +- =test-runner.el= has direct tests, but project-scoping is still a design gap. Completion review 2026-05-15: -- Re-checked the scoped UI/navigation modules and current tests. -- =mousetrap-mode.el=, =ui-navigation.el=, =ui-theme.el=, - =selection-framework.el=, and selected modeline/UI helpers now have focused - tests, but the font/modeline/popper runtime policy remains under-tested. -- Existing cleanup below covers the disabled =popper-config.el= load-graph - issue; added a separate test-gap task for the remaining UI smoke coverage. - -**** 2026-05-25 Mon @ 17:05:00 -0500 Added UI/navigation runtime smoke coverage +- Re-checked the scoped programming workflow modules and current tests. +- =dev-fkeys.el=, coverage modules, formatter wiring, keyboard compatibility, + and test-runner helpers have meaningful focused coverage. +- Remaining issues are logged below: F4 project capability classification, + LSP ownership and smoke coverage, tree-sitter auto-install policy, Git clone + process handling, shell-script executable policy, and formatter process + boundaries. -Added =tests/test-font-config.el= (4 tests): cj/font-installed-p returns t/nil -off find-font, and cj/apply-font-settings-to-frame is a no-op on a non-GUI -frame and applies the preset exactly once per frame (idempotent). find-font, -env-gui-p, and fontaine-set-preset are stubbed so the run stays headless, and -a skip-unless on the demanded packages keeps a bare checkout green. -font-config had zero direct coverage; this fills the gap the task named. +**** 2026-05-25 Mon @ 17:35:02 -0500 Added prog-lisp smoke coverage; assessed the other two -modeline-config was already well covered (string-cut-middle, string-truncate-p, -vc-cache, vc-cache-key, the flycheck segment, the recording indicator), so it -needed no net-new smoke tests. popper-config's no-op smoke test is gated on the -"Decide whether popper-config.el should exist while disabled" task and was -deferred there, since whether to write it depends on that keep/remove call. +Added =tests/test-prog-lisp.el= (4 tests) covering the config prog-lisp owns +directly: cj/elisp-setup and cj/common-lisp-setup are each registered on their +mode hook and apply the right buffer locals (4-space/no-tabs/fill-120 for +elisp, 2-space/fill-100 for Common Lisp). The module loads with use-package +stubbed to a no-op, so nothing installs or downloads in batch. -Original scope: -- =font-config.el=: font fallback/daemon frame setup does not error when - optional fonts or emoji packages are absent. -- =modeline-config.el=: runtime segment assembly handles missing VC/project - data and does not signal in non-file buffers. -- =popper-config.el=: if the module remains in =init.el= while disabled, a - smoke test should prove requiring it is an intentional no-op. +=prog-training.el= got no test: it's entirely deferred use-package config with +no top-level surface, and its only owned settings (leetcode language/dir) live +in a deferred =:config= that would make the test package-dependent for no real +value. Forcing a test there would be coverage theater. -**** 2026-05-26 Tue @ 17:33:28 -0500 Removed popper-config.el (disabled no-op) -Deleted =modules/popper-config.el= and its =(require 'popper-config)= in =init.el= (commit 1cca84c5). It was =use-package :disabled t=, so use-package elided the whole form and it ran nothing while still sitting in the load graph. No test existed and none was needed. validate-modules passes and init loads clean. The config stays in git history if popper is ever wanted. +=prog-general.el= is deferred: it's the one of the three that touches LSP and +tree-sitter, and the task itself says to wait for the LSP/tree-sitter policy +tasks to land before fixing its assertions. Its smoke coverage rides with those. -***** 2026-05-26 Tue @ 15:15:43 -0500 Decided: remove popper-config.el -Craig's call: remove it (quick, solo). It has been a disabled no-op in the load graph. Remaining action: drop =(require 'popper-config)= from =init.el= and delete =modules/popper-config.el= (and any test), then close this task. +**** TODO [#B] Revisit F4 project classification vs actual project capabilities -**** 2026-05-16 Sat @ 02:55:14 -0500 Moved popper-mode activation from :init to :config - -=popper-mode +1= and =popper-echo-mode +1= now live in the -=:config= block of =modules/popper-config.el='s use-package form. -=:disabled t= now actually disables the mode (=:config= is skipped -when disabled; =:init= still runs but it only sets the reference- -buffer list and the display-buffer-alist entry, both of which are -harmless no-ops when popper itself never loads). Comment in the -module explains the split. - -**** 2026-05-16 Sat @ 02:55:14 -0500 Made cj/modeline-vc-fetch fall back when vc-git--symbolic-ref is missing - -The =require 'vc-git= now uses =nil 'noerror=, and the call to -=vc-git--symbolic-ref= is gated on =(fboundp ...)= so an Emacs -version that renames or removes the internal accessor just leaves -=branch= at =vc-working-revision='s output instead of crashing the -modeline render. Added =ignore-errors= around the call too in case -the internal accessor signals on unusual inputs. +=dev-fkeys.el= classifies a project as =interpreted= if it has +=pyproject.toml=, =requirements.txt=, =Pipfile=, or =package.json=, even when it +also has a =Makefile=. That intentionally keeps Python/Node projects on a +Run-only F4 menu, but it also hides useful Compile/Clean options for projects +where =Makefile=, =package.json= scripts, or Projectile cached commands provide +real build/test tasks. -**** 2026-05-25 Mon @ 18:18:29 -0500 Theme-aware font label face in cj/display-available-fonts +Expected outcome: +- Decide whether F4 should classify by language family or by available + capabilities. +- Consider deriving candidates from Projectile's known compile/run/test commands + first, then falling back to markers. +- Keep the current "interpreted markers win" behavior only if that remains the + intentional UX after trying it in mixed Python/Node projects. -Replaced the hardcoded =((:foreground "Light Blue" :weight bold))= label -face in =modules/font-config.el= with =(font-lock-keyword-face (:weight -bold))= so the family header follows theme contrast instead of being -unreadable on light themes. The Regular/Bold/Italic sample lines stay as-is -(they render in each font family on purpose). +**** TODO [#B] Consolidate LSP ownership across programming modules :refactor: -=modules/font-config.el:266= hardcodes ="Light Blue"= and gray -foreground for font labels. Switching themes (especially light -themes) makes the labels nearly unreadable. Replace the literal -color with a face reference (=font-lock-keyword-face= or a face this -config owns) so the labels follow theme contrast. +LSP setup is currently split across =prog-general.el=, =prog-lsp.el=, and each +language module. There are multiple =use-package lsp-mode= forms and some +conflicting defaults: +- =prog-general.el= enables snippets/UI doc/sideline behavior. +- =prog-lsp.el= disables snippets/UI doc/sideline-heavy behavior. +- Python, Go, shell, C, and webdev modules both call =lsp-deferred= from local + setup functions and add package hooks that call =lsp-deferred= again. -**** 2026-05-25 Mon @ 18:18:29 -0500 Routed emoji fontset through per-frame hook in daemon mode +This probably works because lsp-mode is defensive, but it makes the final +runtime policy hard to predict. -The emoji-fontset =(when (env-gui-p) (cond ...))= block in -=modules/font-config.el= ran once at load. In daemon mode =env-gui-p= is -nil at load (no GUI frame yet), so a later =emacsclient -c= frame inherited -no emoji fontset. Wrapped it in =cj/setup-emoji-fontset= (idempotent, GUI- -guarded) and, mirroring the fontaine pattern, added it to -=server-after-make-frame-hook= in daemon mode / ran it directly otherwise. -The all-the-icons install path already used the per-frame hook, so it was -left alone. Manual daemon TTY-then-GUI test added under "Manual testing and -validation" (batch can't drive it). +***** TODO [#B] Make =prog-lsp.el= the single owner of generic LSP policy :refactor: -**** 2026-05-25 Mon @ 18:05:56 -0500 Cached mousetrap keymaps per profile +Expected outcome: +- Move generic =lsp-mode= and =lsp-ui= defaults out of =prog-general.el=. +- Keep language-specific server variables in language modules. +- Keep one hook path per language for starting LSP. +- Preserve the remote-file guard. -=mouse-trap--build-keymap= rebuilt the whole keymap on every major-mode hook. -Moved the build into =mouse-trap--build-keymap-1= and cached its result in -=mouse-trap--keymap-cache=, keyed on =(profile-name . allowed-categories)=, so -the same profile reuses the cached map and editing a profile's categories -changes the key and rebuilds. Sharing one keymap object across buffers is safe -since the map only binds disallowed events to =ignore= and is never mutated. -Added =mouse-trap--clear-keymap-cache=. Behavior is unchanged; 5 cache tests -plus the existing 66 mousetrap tests pass. Done by subagent, reviewed. +Pitfalls: +- =lsp-pyright= may still need a language-specific hook to load before LSP + starts. +- Do not accidentally re-enable UI/doc/sideline behavior that was explicitly + disabled for performance. -**** 2026-05-24 Sun @ 07:26:31 -0500 Keyed VC modeline cache on resolved truename +***** TODO [#B] Add a startup smoke test for LSP config resolution :quick:solo: -=cj/modeline-vc-cache-key= keyed on =(list file cj/modeline-vc-show-remote)=, so a symlink whose target moved (shared drives, CI workspaces) kept serving the old VC backend. Added =(file-truename file)= to the key — one stat per refresh, cheap next to the VC calls the cache avoids — so a re-pointed symlink produces a different key and refreshes. Tests cover truename inclusion, stability for an unchanged file, and a symlink whose target moves. Commit =9135298c=. +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-05-24 Sun @ 04:01:02 -0500 Verified C-s already advances isearch — non-bug, no change +**** TODO [#B] Gate tree-sitter grammar auto-install behind an explicit policy -The premise didn't hold on Emacs 30.2. Investigated in the live daemon: while isearch is active, =overriding-terminal-local-map= is =isearch-mode-map= and the effective =C-s= resolves to =isearch-repeat-forward=, not =cj/consult-line-or-repeat=. isearch installs its own map as an overriding map, so the global =C-s= binding can't shadow it during a search. =isearch-mode-map= already binds =C-s= to =isearch-repeat-forward= by default. Adding an explicit binding to the consult =:bind= block would only duplicate that default, so I left =selection-framework.el= unchanged. +=prog-general.el= sets =treesit-auto-install= to =t=. That means opening a file +can trigger grammar download/build/install behavior. This is convenient on a +fresh machine, but it is a startup/network/build side effect in normal editing +and batch contexts. -**** 2026-05-16 Sat @ 02:55:14 -0500 Guarded cursor-color hook behind display-graphic-p (with daemon-mode catch) +Expected outcome: +- Prefer ='prompt= or a custom command such as =cj/install-treesit-grammars=. +- Batch/test startup should never auto-install grammars. +- Document the intentional bootstrap path for a new machine. -Both the install (=add-hook= on =post-command-hook=) and the function -body now gate on =(display-graphic-p)=. Batch and TTY runs short- -circuit cleanly: no per-command overhead, no =set-cursor-color= calls -on frames that don't have a cursor color. A =server-after-make-frame-hook= -catches the daemon case where the first GUI frame is created after -=ui-config= loads -- it installs the hook lazily the first time a -GUI frame appears. +Originally meant to coordinate with the [#A] Python tree-sitter predicate +syntax issue. That one resolved upstream on 2026-05-14 (see =docs/python- +treesit-predicate-mismatch.txt= RESOLVED footer), so this task no longer +depends on it. -The two cursor-color test files -(=test-ui-config--buffer-cursor-state.el=, -=test-ui-cursor-color-integration.el=) stub =display-graphic-p= to -return t so the work body still runs in batch. +**** 2026-05-24 Sun @ 04:30:14 -0500 Hardened clipboard git-clone process and path handling -**** 2026-05-16 Sat @ 02:55:14 -0500 Deferred nerd-icons by dropping :demand t plus an after-load safety net +=cj/git-clone-clipboard-url= shelled out via =shell-command= and derived the dir with =file-name-nondirectory=, which mishandled scp-style SSH with no slash (=git@host:repo.git= → =git@host:repo=) and silently did nothing on a failed clone. Now clones as a direct =git= process (=call-process=, no shell) with =clone -- url dir= (so a =-=-leading URL can't be read as a flag); the destination comes from =cj/--git-clone-dir-name= (last component split on =/= and =:=, handling HTTPS, scp/ssh:// SSH, local paths); validates non-empty clipboard + writable target dir + non-existing destination; surfaces a non-zero git exit as a =user-error= with the =*git-clone*= output. Tests cover the deriver across schemes + empty-clipboard + clone-failure. Commit =35e4d701=. -=(use-package nerd-icons :demand t ...)= flipped to =:defer t=. The -=:config= block already wraps the advice + tint in lazy-on-load -semantics, so the advice now installs the first time nerd-icons -loads (typically when a feature module like =dashboard-icon-type= -or =dirvish-attributes= triggers a load). An additional -=(with-eval-after-load 'nerd-icons ...)= block at module bottom -catches the "already-loaded when this module re-evaluates" case -- -it checks =advice-member-p= so it doesn't stack the advice on every -re-eval. +**** TODO [#B] Decide whether auto-executable shell scripts should be opt-in -*** DOING [#B] Harden Org workflow modules +=prog-shell.el= adds a global =after-save-hook= that sets executable bits on any +saved file with a shebang. This is convenient, but it silently changes file +modes for every buffer in the session. -Scope: -- =org-config.el= -- =org-agenda-config.el= -- =org-babel-config.el= -- =org-capture-config.el= -- =org-contacts-config.el= -- =org-drill-config.el= -- =org-export-config.el= -- =org-noter-config.el= -- =org-refile-config.el= -- =org-reveal-config.el= -- =org-roam-config.el= -- =org-webclipper.el= -- =calendar-sync.el= -- =hugo-config.el= -- =gloss-config.el= +Expected outcome: +- Decide whether this should remain global, be limited to shell/script modes, or + prompt the first time per file. +- Preserve the fast path for real scripts. +- Keep the existing =cj/make-script-executable= tests updated for the chosen + policy. -Review progress: -- Reviewed 2026-05-03 at high level. -- =calendar-sync.el= has substantial focused coverage for parsing, recurrence, - timezone conversion, event conversion, and regressions. The largest remaining - risks are configuration/secrets, startup side effects, and process/network - boundaries. -- =org-agenda-config.el= and =org-refile-config.el= now have useful cache tests, - but the cache lifecycle and startup idle timers still deserve a design pass. -- =org-noter-config.el= already has an older [#B] workflow VERIFY task. Do not - duplicate that work here. -- =hugo-config.el= and =org-reveal-config.el= have focused helper coverage. -- =gloss-config.el= is a thin package wrapper; no local unit-test target unless - custom glue is added. -- Deeper pass 2026-05-10 added follow-up tasks for org-roam done hooks, drill - file selection/package loading, Org export defaults, Babel templates, and - contact/Mu4e boundaries. +**** 2026-05-25 Mon @ 18:05:56 -0500 Moved JSON/YAML/webdev formatters to argv process calls -Completion review 2026-05-15: -- Re-checked the scoped Org workflow modules and their test coverage. -- The broad parser/cache/helper areas now have useful focused tests, especially - =calendar-sync.el=, agenda/refile helpers, org-roam helpers, org-noter, Hugo, - reveal, and webclipper processing. -- Remaining issues are already logged below, including security-sensitive - calendar config and Babel evaluation policy, cache lifecycle/timer behavior, - org-roam destructive workflow guardrails, executable checks, capture-template - smoke tests, and Org workflow ownership documentation. +Replaced =shell-command-on-region= with =call-process-region= (explicit program ++ argv, no shell) in cj/json-format-buffer (jq), cj/yaml-format-buffer +(prettier), and cj/webdev-format-buffer (prettier). The webdev path dropped its +=shell-quote-argument= once the filename became a plain argv element. Point +preservation is unchanged. One deliberate, tested improvement: the old code +clobbered the buffer with the formatter's error text on a non-zero exit; the new +per-module =cj/---format-region= helper captures output, checks the exit +code, replaces only on success, and otherwise raises a user-error with stderr. +Kept a small helper in each of the three modules rather than one shared one, +since they share no module short of system-lib. Added argv-invocation and +no-clobber tests per formatter; existing wiring tests stay green. Done by +subagent, reviewed. -**** 2026-05-23 Sat @ 04:18:44 -0500 Split personal calendar config out of calendar-sync.el -=calendar-sync.el= now defaults =calendar-sync-calendars= to nil and loads the real plists from =calendar-sync-private-config-file= (an ignored file), so the engine carries no private feed tokens in source. =calendar-sync-status= / =calendar-sync-start= report missing config without erroring, and agenda startup is unaffected (tests/test-calendar-sync-no-config-startup.el). Rotating the previously-committed feed URLs remains a manual credential action — tracked under the L2557 calendar-sync hardening finding. +**** 2026-05-16 Sat @ 03:54:56 -0500 Added cj/executable-find-or-warn checks for prettier and pyright at load time -**** 2026-06-12 Fri @ 07:14:11 -0500 Normalized Org agenda/refile cache lifecycle +=modules/prog-webdev.el:34-40= declares =prettier-path= and +=modules/prog-python.el:33-40= declares =pyright-path= as string +literals. No validation at module load means a missing executable +surfaces only at first use -- format-on-save fires, then errors +mid-edit, then the user has to discover why. Wrap with +=cj/executable-find-or-warn= (already in =system-lib.el=) at module +load time so the missing dependency is reported up front. -All three children landed: shared cache helper extracted, idle timers gated, and directory-scan failures surfaced instead of hidden. +**** 2026-05-16 Sat @ 03:54:56 -0500 Documented keyboard-compat hook idempotence (already correct) -***** 2026-05-23 Sat @ 04:18:44 -0500 Extracted a shared cache helper -=cj-cache-lib.el= now provides =cj/cache-valid-p=, =cj/cache-building-p=, and =cj/cache-value-or-rebuild=, consumed by both =org-agenda-config.el= and =org-refile-config.el=; the contract is documented in =docs/specs/cache-helper-design-spec-implemented.org=. The agenda and refile public commands are unchanged. +=modules/keyboard-compat.el:169-174= adds the frame-setup hook +unconditionally. If the module is required twice (e.g. via two +=eval-after-load= chains in different load orders), the hook runs +twice per new frame and installs duplicate =key-translation-map= +entries. Wrap the =add-hook= in a guard, or use a named function +and rely on =add-hook='s own duplicate-check. -***** 2026-05-24 Sun @ 07:26:31 -0500 Surfaced directory-scan failures instead of hiding/crashing +**** 2026-05-16 Sat @ 03:54:56 -0500 Wired F6 TypeScript clause to npx vitest|jest -The refile scan caught =permission-denied= and silently dropped the dir, and crashed outright on a missing root (only permission-denied was caught, so a missing =code-dir=/=projects-dir= raised =file-missing= and aborted the build); the agenda build had the same missing-dir crash via =directory-files=. Extracted =cj/--org-refile-scan-dir= (warns + returns nil for missing/unreadable/permission-denied so the scan continues) and guarded the agenda scan the same way. Also fixed a latent bug found here: =org-refile-targets= was never declared special, so under =make compile= =cj/org-refile-in-file= let-bound it lexically and the scoped targets never reached =org-refile= — added =(defvar org-refile-targets)=. Tests cover the helper + the agenda missing-dir guard. Commit =12fb0108=. +=modules/dev-fkeys.el:261-269= maps =tsx= to =typescript= in the +language detection table. =modules/dev-fkeys.el:347-349= +(=cj/--f6-test-runner-cmd-for=) has no clause for =typescript= -- +the catch-all =(_)= returns nil, so F6 errors instead of routing to +a real runner. Either add a =typescript= → =jest=/=vitest= clause +or remove the =tsx= mapping until the runner side is implemented. -***** 2026-05-23 Sat @ 04:18:44 -0500 Gated cache idle timers out of batch -Both cache builders' =run-with-idle-timer= calls are wrapped in =(unless noninteractive)= (=org-refile-config.el:105=, =org-agenda-config.el:203=), so requiring the modules in batch schedules nothing. =tests/test-architecture-startup-contracts.el= scans every module and asserts there are no unguarded top-level timer forms. +**** 2026-05-16 Sat @ 03:54:56 -0500 Fixed prog-lsp eldoc-provider removal to act on the global hook -**** 2026-05-23 Sat @ 19:48:00 -0500 Made org-confirm-babel-evaluate default to t with a toggle +=modules/prog-lsp.el:51-54,76= attaches +=cj/lsp--remove-eldoc-provider= globally to =lsp-managed-mode-hook= +but the removal it performs uses =(remove-hook ... t)= -- a +buffer-local removal. The first LSP buffer activates the hook, +which removes the provider for that buffer. Subsequent LSP buffers +still inherit the global default because the hook itself never +re-fires the buffer-local removal in their context. Either make +the hook itself buffer-local-friendly (add it inside +=lsp-managed-mode-hook= per-buffer) or remove from the global +provider list once instead of per-buffer. -=org-babel-config.el= set =org-confirm-babel-evaluate= to nil globally, so every source block in every Org file (cloned repos, downloaded notes, web clips) ran without confirmation. Changed the default to =t= (confirm before running). Replaced the old =babel-confirm= command (which reported, and toggled only with a prefix arg) with =cj/org-babel-toggle-confirm=, a plain toggle bound to =C-; k= for flipping confirmation off in trusted files and back on. 3 ERT tests cover the toggle both directions plus the binding. +**** 2026-05-16 Sat @ 03:54:56 -0500 Externalized LanguageTool script path via user-emacs-directory -**** TODO [#B] Rebind babel-confirm toggle off =C-; k= +=modules/flycheck-config.el:69= hardcodes +=~/.emacs.d/scripts/languagetool-flycheck= as the LanguageTool wrapper. +Users running from a non-standard =user-emacs-directory= (or anyone +auditing the module against a future package) get a broken checker. +Replace with =(expand-file-name "scripts/languagetool-flycheck" +user-emacs-directory)= or a defcustom. -=cj/org-babel-toggle-confirm= landed on =C-; k= as a placeholder. Pick a permanent home — likely under an Org-specific prefix rather than the global =C-;= map. +**** 2026-05-16 Sat @ 03:54:56 -0500 Replaced hardcoded Zathura viewer with executable-find candidate list -Triggered by: 2026-05-23 org-confirm-babel-evaluate hardening. +=modules/latex-config.el:28= sets the LaTeX viewer to =zathura= +unconditionally. macOS / Windows users and anyone who prefers a +different PDF viewer lose document review without explanation. +Resolve via =executable-find= over a candidate list (=zathura=, +=evince=, =okular=, =Preview.app= via =open=, =SumatraPDF.exe=) and +fall back to =pdf-tools=. -**** 2026-05-24 Sun @ 14:43:13 -0500 Guarded move-branch-to-roam against data loss +**** 2026-05-15 Fri @ 18:49:24 -0500 Fixed abbrev-mode no-arg toggle in =cj/prose-helpers-on= -The command cut the subtree from the source before writing the new roam file, so any failure in demote/format/write/db-sync lost the subtree with no rollback. Reordered to write and verify the file on disk before =org-cut-subtree=, so a failed write aborts with the source intact. Added a no-clobber guard (refuse an existing target file) and a confirmation prompt for large subtrees (>= =cj/move-org-branch-confirm-lines=, 30) or buffers with unsaved changes. Decided: leave the source buffer modified and undoable rather than auto-saving, so the move stays reversible. New test drives the write-failure-preserves-source invariant via an unwritable roam dir. Commit =5c0fa15d=. +Replaced the =(if (not (abbrev-mode)) (abbrev-mode))= shape with +=(unless (bound-and-true-p abbrev-mode) (abbrev-mode 1))= and the same +for =flycheck-mode= in =modules/flycheck-config.el:36-42=. Dropped +"flyspell" from the docstring (the commented-out +=cj/flyspell-on-for-buffer-type= line had been gone for a while; the +docstring was lying) and removed the stale comment marker. -**** 2026-05-25 Mon @ 18:29:40 -0500 Already done — clip URL/title scoped to dynamic bindings +Added =tests/test-flycheck-config-prose-helpers-on.el= -- 4 tests +covering Normal (both modes off -> each enabled once with a positive +arg) and Boundary (both on -> no-op; each mixed state -> only the off +one enabled). The "both on -> no-op" assertion is the regression +guard for the no-arg toggle shape: it would record a =(nil)= call list +under the bug and a =()= call list under the fix. -Found this already shipped in =6dfc41af= ("refactor(webclipper): scope clip -URL/title to dynamic bindings", 2026-05-24). The temp vars =cj/--webclip-url= / -=cj/--webclip-title= are now =let=-bound around the org-capture call instead of -=setq='d and manually cleared, so they unwind on every exit path including a -=C-g= abort — which covers the "aborted captures clear temp state" outcome more -completely than a finalize hook would. The bookmarklet/org-protocol workflow is -unchanged. =tests/test-org-webclipper-commands.el= already covers the -leaves-no-stale-state and aborted-capture-clears-state cases. No new work needed. +Test infra needed an explicit =(defvar abbrev-mode)= / +=(defvar flycheck-mode)= at the top of the test file: with +=lexical-binding: t= and flycheck loaded =:defer t=, =let= on the +flycheck-mode symbol creates a lexical-only binding the production +code's =bound-and-true-p= can't see; declaring both as special makes +=let= dynamic and the test stable. -**** 2026-05-25 Mon @ 17:51:17 -0500 Guarded external-tool assumptions in Org export/publishing +Full suite: =make test= exits 0; 468 lines of output with =ALL UNIT +TESTS PASSED= banner; no regressions. -Added command-time guards to four export/publishing commands so a missing tool -fails with a user-error that names it, instead of an opaque process error (or, -for reveal.js, a silently broken presentation): -- =org-export-config.el=: zathura check in my/org-pandoc-export-to-pdf-and-open. -- =hugo-config.el=: hugo binary check in cj/hugo-preview, and the platform - file-manager opener check in cj/hugo-open-blog-dir-external. -- =org-reveal-config.el=: extracted =cj/--reveal-ensure-root= (checks the local - reveal.js clone, points at scripts/setup-reveal.sh), called from - cj/reveal-export and cj/reveal-preview-start. -- =org-webclipper.el=: pandoc check in cj/org-protocol-webclip-handler, the - single path that shells out to pandoc via org-web-tools. +*** DOING [#B] Harden integrations and application modules -All checks run at command time, not load, so startup stays quiet. Each guard -has a user-error test; existing happy-path tests now stub the lookups. Things -deliberately not guarded: hugo-publish (magit, internal), the preview filter -(browse-url, internal), hugo-export-post (ox-hugo, Elisp). Done with four -parallel implementation agents, reviewed individually; full suite green. +Scope: +- AI/rest: =ai-config.el=, =ai-conversations.el=, =restclient-config.el= +- Mail/chat/social: =mail-config.el=, =mu4e-*.el=, =slack-config.el=, + =erc-config.el=, =elfeed-config.el=, =eww-config.el= +- File/media/apps: =dirvish-config.el=, =dwim-shell-config.el=, =pdf-config.el=, + =calibredb-epub-config.el=, =music-config.el=, =quick-video-capture.el=, + =video-audio-recording.el=, =transcription-config.el= +- Utilities/apps: =auth-config.el=, =browser-config.el=, =dashboard-config.el=, + =help-config.el=, =help-utils.el=, =jumper.el=, =keyboard-macros.el=, + =local-repository.el=, =lorem-optimum.el=, =reconcile-open-repos.el=, + =show-kill-ring.el=, =system-commands.el=, =system-utils.el=, + =tramp-config.el=, =undead-buffers.el=, =weather-config.el=, =wrap-up.el= -**** 2026-05-16 Sat @ 03:44:45 -0500 Guarded org-roam completed-task hook with cj/--org-roam-should-copy-completed-task-p +Review progress: +- Reviewed 2026-05-03 at high level by direct reads plus risky-pattern search. +- Recording/transcription and music modules have much stronger coverage than + most application wrappers. +- Existing coverage audit already tracks =ai-conversations=, =quick-video-capture=, + =dashboard-config=, =mail-config=, =show-kill-ring=, =system-commands=, and + =wrap-up= as high-value test targets. -=org-roam-config.el= adds a global =org-after-todo-state-change-hook= that -copies newly completed tasks to today's org-roam journal. The hook assumes the -current Org buffer is visiting a file: +Completion review 2026-05-15: +- Re-checked the scoped integration/application modules with risky-pattern and + test-coverage searches. +- Many integration modules now have focused tests, including AI config, + restclient, mail helpers, Slack commands, Dirvish helpers, music, + recording/transcription, system commands, browser/help/jumper/reconcile, and + undead buffer helpers. +- Remaining issues are already logged below, especially system command safety, + REST key persistence, mail privacy/lifecycle policy, quick-video timers and + temp state, shell-heavy dwim/recording command hardening, AI conversation + persistence coverage, calendar operational behavior, Dirvish dependency/path + hardening, EWW/Elfeed network helpers, and Slack which-key registration. -- It calls =(buffer-file-name)= and passes the result to =string=. -- =cj/org-roam-copy-todo-to-today= later compares =file-truename= of the daily - file and the current buffer file. +**** 2026-05-24 Sun @ 04:15:36 -0500 Made Emacs restart and destructive confirms defensive -That can error in capture buffers, indirect buffers, temporary Org buffers, or -other fileless Org workflows. +Restart-Emacs scheduled an unconditional =kill-emacs= one second after firing the systemctl restart, so a missing or failed service killed the session with nothing to replace it. Restart now guards on =(daemonp)= and a present =emacs.service= (new =cj/system-cmd--emacs-service-available-p= via =systemctl --user cat=) before doing anything, and drops the separate =kill-emacs= — =systemctl restart= cycles the daemon itself, so a failed restart leaves the current Emacs alive. Shutdown and reboot moved to a strong =yes-or-no-p= confirm (a stray RET/space on the old quick prompt could power off the machine); logout and suspend keep the quick confirm since they are recoverable. Tests cover service detection, both restart guards, and the strong-confirm paths with system primitives stubbed. Commit =f1dbec16=. + +Not done: the detached restart+reconnect (=nohup sh -c '... && emacsclient -c'=) may still race systemd's cgroup teardown of =emacs.service= before =emacsclient -c= runs. Couldn't verify from here without cycling the live daemon — eyeball the reconnect on the next real restart. + +**** 2026-05-23 Sat @ 19:01:53 -0500 Removed SkyFi key-injection feature from restclient-config + +Resolved by removing the feature rather than hardening it. =cj/restclient-skyfi-buffer= opened =data/skyfi-api.rest= in a file-visiting buffer and rewrote the =:skyfi-key= line with the real key from authinfo, so an accidental save would persist the key to local disk (the file was gitignored and never tracked, so no repo/public-mirror exposure — local plaintext only). Deleted =cj/skyfi-api-key=, =cj/restclient--inject-skyfi-key=, =cj/restclient-skyfi-buffer=, the =C-; R s= binding, the two SkyFi test files, and the local =data/skyfi-api.rest= template. Generic restclient (=C-; R n=, =C-; R o=, restclient/restclient-jq) kept. + +**** TODO [#B] Reconcile mail image/privacy settings + +=mail-config.el= documents blocked remote images and sets +=gnus-blocked-images=, but later enables both =mu4e-show-images= and +=mu4e-view-show-images=. The interactive toggle changes =gnus-blocked-images= +buffer-locally, so the final privacy behavior is hard to reason about without +manual testing against real HTML messages. Expected outcome: -- Extract a predicate for "should copy this completed task to today's journal". -- Skip fileless buffers, calendar sync files, aborted capture buffers, and tasks - already in the target daily file. -- Keep the normal completed-task journal workflow unchanged. -- Add tests for fileless buffers, =gcal-file=, already-daily buffers, and a - normal project/todo buffer. +- Decide the default policy for embedded images versus remote HTTP images. +- Make the toggle report the effective state in the current mu4e view buffer. +- Add a short manual checklist or mocked test for the variables that control + remote image display. -**** 2026-05-24 Sun @ 04:30:14 -0500 Shared one validated drill-file selector +**** 2026-05-23 Sat @ 03:52:00 -0500 Set compose buffers to kill on exit, both composers +First clarified the ownership (dd671f8c): the org-msg comment "always kill buffers on exit" was backwards — org-msg set =nil= (keep), which won over mu4e's =t= because org-msg-mode runs in every compose buffer. Craig then chose to kill compose buffers on exit, so I set the org-msg value to =t= as well (82978c79). Both mu4e and org-msg now kill the buffer on send/exit, so HTML drafts don't linger. -org-capture-config.el and org-drill-config.el each scanned =drill-dir= with an inline =directory-files= call, so a missing/empty/unreadable dir surfaced as a low-level error or an empty =completing-read= depending on which command ran. Added =cj/--drill-files-or-error=, the single validated entry point: clear =user-error= when the dir is missing, unreadable, or has no drill files; otherwise the list. =cj/--drill-pick-file= and both drill capture templates route through it; the pure =cj/--drill-files-in= primitive and its tests are unchanged. Tests cover missing/empty/non-org/normal. Commit =49038c41=. +**** 2026-05-24 Sun @ 07:26:31 -0500 Dropped startup timers for lazy protocol init -**** 2026-05-24 Sun @ 14:43:13 -0500 Removed contradictory org-export-with-tasks default +=quick-video-capture.el= scheduled an =after-init-hook= idle timer + a 2s fallback =run-with-timer= to call setup, which required org-protocol/capture and registered both the protocol handler and the capture template at every startup. Split the concerns like =org-webclipper.el=: the org-protocol handler registers in a =with-eval-after-load 'org-protocol= block (lightweight =add-to-list=, in place whenever org-protocol loads — org-config requires it at startup), and =cj/setup-video-download= now registers only the capture template lazily (first capture or first protocol call). Both timers gone. Tests pin that setup registers the template idempotently and no longer touches the protocol alist; verified in a live daemon that the protocol registers on load. Commit =bc965275=. -=org-export-config.el= set =org-export-with-tasks= twice (=("TODO")= then =nil=); the final =nil= won but the stale first line + comment contradicted it. Removed the leftover. =nil= (export no tasks) is the deliberate default — it was already winning, its comment matches, and it sits with the adjacent "without tags / section numbers by default" settings. Added a smoke test that fires the deferred =ox= :config and pins the value to =nil=. Commit =94ef5242=. +**** 2026-05-24 Sun @ 04:30:14 -0500 Scoped video-capture URL to a dynamic binding -**** 2026-05-23 Sat @ 03:48:50 -0500 Fixed java structure-template typo and pinned the aliases -=("java" . "src javas")= expanded to a bogus =#+begin_src javas=; corrected it to =src java=. Added =test-org-babel-config-structure-templates.el=, which requires the module then org-tempo (firing the deferred :config) and asserts =bash=, =zsh=, =el=, =py=, =json=, =yaml=, =java= each map to the intended src language. Fixed in the org-babel commit. +The protocol handler =setq= a global =cj/video-download-current-url= and the capture handler read/cleared it, so an aborted or erroring capture left the stale URL for the next manual capture. Renamed to =cj/--video-download-url= and =let=-bind it around the =org-capture= call instead of mutating a global: the binding lives only for the capture's dynamic extent, so the handler sees the URL while the capture runs and an abort/error unwinds it automatically — no stale state, no manual clear. Manual invocation still prompts. Tests cover bound-URL download, manual prompt, empty-URL error, URL-visible-during-capture, and aborted-capture-leaves-nothing. Commit =b26b74cb=. -**** TODO [#B] Make org-contacts/Mu4e boundaries explicit :refactor: +Note: the sibling =org-webclipper.el= still uses the same global-mutation pattern (=cj/webclip-current-url= / =title=); a separate =:solo:= task tracks that. -=org-contacts-config.el= defines helpers that call Mu4e functions when the -current major mode is a Mu4e mode, and the =use-package org-contacts= block is -=:after (org mu4e)= while also requiring =mu4e= inside =:config=. This works in -the current eager setup, but the ownership boundary is unclear now that -=mu4e-org-contacts-integration.el= exists. +**** 2026-06-12 Fri @ 07:14:11 -0500 Audited shell-command-heavy recording and dwim-shell workflows + +=video-audio-recording.el= and =dwim-shell-config.el= are intentionally close to +the shell: pactl/ffmpeg/qpdf/7z/tesseract/media conversion commands are the +point. They also have the highest process and quoting surface in the config. Expected outcome: -- Decide whether contact capture-from-email behavior belongs in - =org-contacts-config.el= or the Mu4e integration modules. -- Add =declare-function= / autoloads or move Mu4e-specific code behind - =with-eval-after-load 'mu4e=. -- Keep plain Org contact commands usable on systems without Mu4e loaded. -- Add a smoke test for loading =org-contacts-config.el= without Mu4e stubs if - practical. +- Keep the current workflows, but catalog which commands accept filenames, + URLs, passwords, or free-form user input. +- Prefer argv process APIs for commands that do not require a shell. +- For commands that must use shell templates, document which placeholders are + safely quoted by =dwim-shell-command= and add focused tests around password + temp-file cleanup. -**** TODO [#B] Add an Org workflow health check command :feature:solo: +***** 2026-05-23 Sat @ 19:11:30 -0500 Fixed async password temp-file lifetime in dwim-shell -Several Org workflow modules depend on personal paths, optional external tools, -and local package checkouts. Failures currently show up at command time in -different ways, depending on which module hits the missing dependency first. +The four password commands (PDF protect/unprotect, remove-zip-encryption, create-encrypted-zip) deleted the password temp file in =unwind-protect= the instant the async command launched, so =qpdf=/=7z= could start after the file was gone. Extracted =cj/dwim-shell--run-with-password-file= + =cj/dwim-shell--password-cleanup-callback=: the temp file (mode 600) is now deleted from an =:on-completion= callback that fires after the process exits (success or failure), with the synchronous =unwind-protect= kept only as a pre-launch-failure backstop. Rewrote all four commands onto the helper. 5 ERT tests cover the cleanup callback (success/error/missing-file) and the runner (writes 600 file + defers cleanup; cleans up on launch failure). qpdf already passes the password via =--password-file= (out of argv); the 7z argv exposure is split into its own follow-up below. -Recommended improvement: -- Add a lightweight =cj/org-workflow-doctor= command that checks the main Org - workflow prerequisites without mutating user data. -- Report status for core files/directories: =org-dir=, =roam-dir=, =drill-dir=, - =contacts-file=, =webclipped-file=, =cj/hugo-content-org-dir=, and - =cj/reveal-root=. -- Report optional executable/package availability for Pandoc/org-web-tools, - Hugo, reveal.js, org-drill, org-roam, and org-noter. -- Keep startup quiet; run this only on demand. -- Make the checker return structured data so it can be unit-tested and displayed - either in Messages or a buffer. +***** 2026-05-24 Sun @ 04:20:31 -0500 Accepted the brief 7z password-on-argv exposure, documented it -**** 2026-05-24 Sun @ 14:43:13 -0500 Added capture-template key + target smoke tests +Investigated whether 7z could take the password off argv. It can't: 7-Zip 26.01 reads the password only from its controlling TTY, not stdin or a file. Verified empirically — =printf pw | 7z a -p ...= silently created an archive with an *empty* password (the piped value never reaches it), and a round-trip with the same password failed. So the password must go on argv via =$(cat tempfile)= and is briefly visible in the process list while 7z runs. -New =test-org-capture-templates-integrity.el= loads the cleanly-loadable capture modules (=org-capture-config=, =quick-video-capture=, =org-contacts-config=), applies their lazy additions, and asserts no two templates share a dispatch key and that every symbol-valued file target resolves to a non-empty path string. Literal-string targets (the video template's no-save =(file "")=) and lambda targets (drill file pickers) are excluded. Webclipper templates need org-web-tools at registration time, so they stay covered by their own test rather than this batch smoke test. Mutation-checked that the uniqueness assertion flags a duplicate key. Commit =2e3905c7=. +Craig's call (2026-05-24): accept the exposure rather than switch off the .7z format. On a single-user workstation, for a short-lived process, with the password already kept out of shell history by the mode-600 temp file, the residual exposure is acceptable. The gpg-wrapped-tar alternative would close it but change the archive format and decrypt workflow. Recorded the tradeoff in both function docstrings in =dwim-shell-config.el= so the decision is visible at the call site, not just here. -**** TODO [#B] Document Org workflow module ownership and load boundaries :refactor:solo: +***** 2026-05-23 Sat @ 19:18:00 -0500 Quoted/validated user-controlled dwim-shell inputs -The Org workflow is spread across many modules with overlapping responsibilities: -capture templates, keymaps, org-protocol handlers, refile/agenda target -construction, roam notes, publishing, and document annotation. The code is -usable, but future load-order work will be easier with explicit ownership notes. +Closed the four injection-quoting cases. git-clone-clipboard-url now validates the clipboard with =cj/dwim-shell--valid-git-url-p= and passes the URL via =shell-quote-argument= instead of the raw =<>= substitution. GPG recipient and the 7z archive name go through =shell-quote-argument= instead of hand-written single quotes. The ffmpeg thumbnail timestamp is validated with =cj/dwim-shell--valid-ffmpeg-timestamp-p= (digits/colons/dot only) before it reaches =-ss=. The sequential-rename prefix is validated filename-safe with =cj/dwim-shell--safe-rename-prefix-p=. 7 ERT tests cover the three validators (Normal/Boundary/Error); the two =shell-quote-argument= swaps trust the builtin. The fifth case — video concatenation's echo/tr/sed filelist — is a redesign rather than a quoting fix and is split out below. -Recommended improvement: -- Add a short design note under =docs/design/= that maps each Org module to the - behavior it owns. -- Call out which modules may mutate global Org variables, capture templates, - keymaps, and protocol handlers. -- Define which modules should be safe to load in batch mode and which are - allowed to start timers or require interactive packages. -- Link this note from the Org workflow review task and the broader load-graph - refactor. +***** 2026-05-23 Sat @ 19:58:00 -0500 Rebuilt video-concat filelist in Elisp -**** 2026-05-16 Sat @ 03:44:45 -0500 Removed duplicate org-protocol-protocol-alist registration in cj/webclipper-ensure-initialized +=cj/dwim-shell-commands-concatenate-videos= built the ffmpeg concat list with =echo '<<*>>' | tr ' ' '\n' | sed 's/^/file /'=, which split on spaces and broke on quotes. Extracted =cj/dwim-shell--build-concat-filelist=, which renders each path as an escaped =file '...'= line (single quotes escaped as ='\''=), writes it to a temp file in Elisp, and runs =ffmpeg -f concat -i = with a trailing =; rm -f= to clean up after the process exits. =<<*>>= stays only as an inert trailing shell comment so dwim-shell still runs one command over all marked files. 3 ERT tests cover plain paths, spaces, and an embedded quote. -The =webclip= protocol handler is registered twice: -=modules/org-webclipper.el:72-76= inside =cj/webclipper-ensure-initialized= -(unconditional =add-to-list=) and =:207-214= inside a -=with-eval-after-load 'org-protocol= block (=unless (assoc ...)= guard). -=add-to-list= uses =equal= membership so the two are effectively -idempotent, but maintaining two registration paths invites drift if -the alist entry shape ever changes. Pick one site -- the -=with-eval-after-load= block is the more robust location -- and -remove the other. +***** 2026-05-23 Sat @ 20:17:00 -0500 Clarified broad/misleading file-operation commands -**** 2026-05-16 Sat @ 03:44:45 -0500 Validated :url and :title in cj/org-protocol-webclip before stashing +=remove-empty-directories= ran =find . -type d -empty -delete= from the ambient current directory. Now it prompts for an explicit root (via =read-directory-name=), names that root in the confirmation, and runs =find ...= built by =cj/dwim-shell--empty-dirs-command= (2 ERT tests cover the command shape + space quoting). =secure-delete= called =shred= without =-u=, overwriting file contents but leaving the file in place despite the name and the "permanently destroy" prompt; added =-u= (=shred -vfzu=) so it actually unlinks. Both use the inert =<<*>>= comment trick for single-execution. -=modules/org-webclipper.el:124-125= extracts =:url= and =:title= from -the incoming protocol plist with no type or nil check. An unexpected -plist shape silently sets the globals to nil, and downstream code -fails inside the capture handler with confusing messages. Guard with -=(unless (and (stringp url) (not (string-empty-p url))) (user-error ...))= -before stashing. +***** 2026-05-24 Sun @ 04:10:20 -0500 Shell-quoted X11 and audio recording command paths -**** 2026-05-24 Sun @ 07:26:31 -0500 Scoped webclip URL/title to dynamic bindings +The Wayland =wf-recorder= path already quoted its args, but the X11 =ffmpeg= path and the audio-only =ffmpeg= path interpolated mic device, system device, and output filename raw — breaking on directories with spaces or unusual device names. Wrapped all three in =shell-quote-argument= on both paths. Extracted =cj/recording--build-audio-command= (mirroring =cj/recording--build-video-command=) so the audio command is unit-testable, then quoted there. Tests cover device names and filenames with spaces on both builders. Commit =39795e85=. -The protocol handler =setq= globals =cj/webclip-current-url= / =cj/webclip-current-title= that the "W" template and handler read (and cleared), so an aborted/erroring capture left stale state for the next clip. Renamed to =cj/--webclip-url= / =cj/--webclip-title= and =let=-bind them around the =org-capture= call: the template =%(identity ...)= forms and the handler run within that dynamic extent, and an abort/error unwinds the binding automatically — no stale state, no manual clear. Mirrors the quick-video-capture fix. Tests updated to the new contract (visible-during-capture, nothing-left-after, aborted-leaves-nothing). Commit =6dfc41af=. +***** 2026-05-24 Sun @ 04:10:20 -0500 Scoped wf-recorder stop signal to our own process -**** 2026-05-16 Sat @ 03:44:45 -0500 Declared cross-module free vars in mu4e-org-contacts-integration.el +Stop ran =pkill -INT wf-recorder=, signalling every wf-recorder on the system including an unrelated screen capture. Added =cj/recording--interrupt-child-wf-recorder=, which scopes the producer-first interrupt to the wf-recorder child of our own recording shell via =pkill -P =. Producer-first ordering preserved (ffmpeg still sees a clean pipe EOF). The orphan-cleanup at recording start stays a broad by-name kill on purpose — those leftovers come from crashed sessions whose shells are already dead, so there is no live PID to scope to. Tests cover the scoped call, the nil-PID no-op, and that the bare system-wide form is never used. Commit =556f48a2=. -The module reads =contacts-file= (defined in =user-constants.el=) and -calls =cj/get-all-contact-emails= (defined in =org-contacts-config.el=) -without any forward declaration at the top of the file. Byte-compile -in isolation warns about both as free variables / unknown functions. -Add =(eval-when-compile (defvar contacts-file))= and -=(declare-function cj/get-all-contact-emails "org-contacts-config")= -near the existing requires so the compile is clean and the -cross-module dependency is explicit at the top of the file. +***** 2026-05-24 Sun @ 04:10:20 -0500 Created the selected recording directory, not its parent -**** 2026-05-25 Mon @ 17:10:47 -0500 Added mu4e org-contacts completion coverage +The toggles ran =(file-name-directory location)= before =make-directory=, which returns the *parent* for a path without a trailing slash — so the selected directory went uncreated and ffmpeg failed to write into it. Both toggles now route the destination through =cj/recording--normalize-recording-dir= (expand + =file-name-as-directory=) and =make-directory= that, creating the selected directory itself (including names with spaces). Tests cover trailing-slash normalization, idempotence, spaces, and relative-to-absolute expansion. Commit =dc033c75=. -Added =tests/test-mu4e-org-contacts-integration.el= (10 tests). The capf -(cj/org-contacts-completion-at-point) is checked for the header-field and -compose-mode gating both ways, the bounds/table it returns when contacts -exist, and the empty-contacts case. TAB (cj/mu4e-org-contacts-tab-complete) -is checked across all three branches: completion-at-point in a header, -org-cycle in the org-msg body, indent elsewhere. Comma completion and the -direct-insert no-op-outside-header path round it out. mail-abbrev-in-expansion-header-p, -the mode actions, and cj/get-all-contact-emails are stubbed, so the run is -headless with no mu4e/org-contacts dependency. +**** TODO [#B] Make AI conversation persistence path-safe and project-aware :refactor: -*** DOING [#B] Harden programming workflow modules +=ai-conversations.el= has good pure helper seams but is currently untested in +this repo. The path slugging is simple and the save/load/delete commands operate +directly in a single global directory. -Scope: -- =prog-c.el= -- =prog-general.el= -- =prog-go.el= -- =prog-json.el= -- =prog-lisp.el= -- =prog-lsp.el= -- =prog-python.el= -- =prog-shell.el= -- =prog-training.el= -- =prog-webdev.el= -- =prog-yaml.el= -- =coverage-core.el= -- =coverage-elisp.el= -- =test-runner.el= -- =vc-config.el= -- =keyboard-compat.el= -- =dev-fkeys.el= - -Review progress: -- Reviewed 2026-05-03 at high level. -- =dev-fkeys.el= reviewed 2026-05-03 after local edits settled. The focused - dev-fkeys test set passed: 22 test files, 163 ERT tests. -- =coverage-core.el= / =coverage-elisp.el= have strong pure-helper tests. -- Language formatter wiring is covered for Python, Go, shell, webdev, JSON, and - YAML. -- =test-runner.el= has direct tests, but project-scoping is still a design gap. +Expected outcome: +- Add tests for candidate sorting, topic slug collisions, autosave path setup, + and delete confirmation behavior. +- Consider whether conversations should remain global or support project-scoped + subdirectories. +- Confirm autosave never writes partial prompt/response state to an unexpected + file after loading a different conversation. -Completion review 2026-05-15: -- Re-checked the scoped programming workflow modules and current tests. -- =dev-fkeys.el=, coverage modules, formatter wiring, keyboard compatibility, - and test-runner helpers have meaningful focused coverage. -- Remaining issues are logged below: F4 project capability classification, - LSP ownership and smoke coverage, tree-sitter auto-install policy, Git clone - process handling, shell-script executable policy, and formatter process - boundaries. +**** TODO [#B] Harden calendar sync operational behavior around the parser :refactor: -**** 2026-05-25 Mon @ 17:35:02 -0500 Added prog-lisp smoke coverage; assessed the other two +=calendar-sync.el= has broad parser/recurrence coverage, but the operational +path around it still has startup, persistence, and fetch risks. -Added =tests/test-prog-lisp.el= (4 tests) covering the config prog-lisp owns -directly: cj/elisp-setup and cj/common-lisp-setup are each registered on their -mode hook and apply the right buffer locals (4-space/no-tabs/fill-120 for -elisp, 2-space/fill-100 for Common Lisp). The module loads with use-package -stubbed to a no-op, so nothing installs or downloads in batch. +Expected outcome: +- Move private calendar URLs out of source and rotate the exposed feed URLs + before doing further cleanup. +- Avoid immediate network fetches at module load unless explicitly enabled for + interactive sessions. +- Add a per-calendar in-flight guard so a timer tick cannot launch overlapping + syncs for the same calendar. +- Use =curl --fail= or equivalent status handling so HTTP error pages are not + treated as successful ICS downloads. +- Write generated Org files atomically via a temp file and rename. +- Read the local state file with =read-eval= disabled. -=prog-training.el= got no test: it's entirely deferred use-package config with -no top-level surface, and its only owned settings (leetcode language/dir) live -in a deferred =:config= that would make the test package-dependent for no real -value. Forcing a test there would be coverage theater. +**** 2026-05-23 Sat @ 04:18:44 -0500 AI conversation persistence coverage already in place +Premise was stale. =tests/test-ai-conversations.el= (47 cases) already covers slug generation, timestamp parsing, candidate sorting (newest/oldest), latest-file selection, save/load header stripping against a temp dir, autosave path/timer, and delete confirmation — with GPTel stubbed throughout. Acceptance list satisfied; no new file needed. -=prog-general.el= is deferred: it's the one of the three that touches LSP and -tree-sitter, and the task itself says to wait for the LSP/tree-sitter policy -tasks to land before fixing its assertions. Its smoke coverage rides with those. +**** 2026-05-23 Sat @ 03:31:12 -0500 Dirvish helper coverage already in place +The task premise was stale: =dirvish-config.el= now has 14 focused test files (=test-dirvish-config-*.el=, ~100 cases) covering duplicate-naming, resolve-display-path (project/home/absolute/org-link), ediff-pair, html/printable predicates, playlist filtering/sanitizing, wallpaper-program mapping, and the public wrappers. The remaining gaps (playlist name-safety, set-wallpaper nil-file) were filled by the L2668 hardening commit 8fc6432d. No new file needed. -**** TODO [#B] Revisit F4 project classification vs actual project capabilities +**** 2026-05-23 Sat @ 03:21:12 -0500 Declared dirvish-config runtime deps with plain require +Switched =user-constants= and =system-utils= from =eval-when-compile= to plain =require= in =dirvish-config.el=, matching the three sibling requires below. The module builds =dirvish-quick-access-entries= from =code-dir=/=music-dir=/=pix-dir= at load and binds keys to =cj/xdg-open=/=cj/open-file-with-command=, so the deps are genuine runtime inputs. Added =tests/test-dirvish-config-runtime-requires.el= as a dependency-contract smoke test. Fixed in b63c4f83. -=dev-fkeys.el= classifies a project as =interpreted= if it has -=pyproject.toml=, =requirements.txt=, =Pipfile=, or =package.json=, even when it -also has a =Makefile=. That intentionally keeps Python/Node projects on a -Run-only F4 menu, but it also hides useful Compile/Clean options for projects -where =Makefile=, =package.json= scripts, or Projectile cached commands provide -real build/test tasks. +**** 2026-05-23 Sat @ 03:31:12 -0500 Hardened dirvish wallpaper + playlist path helpers +=cj/set-wallpaper= passed =(dired-file-name-at-point)= straight into =expand-file-name=, so no-file-at-point raised a bare wrong-type-argument; added a nil guard that signals a clear user-error. =cj/dired-create-playlist-from-marked= expanded a raw name under =music-dir= with no check; added =cj/--playlist-name-safe-p= to reject any name carrying a directory separator (=../=, absolute, nested) before the path is built. Regression tests went into =test-dirvish-config-wrappers.el= and =test-dirvish-config-playlist.el=. The duplicate/copy-path helpers already guarded nil, so they were left alone. Fixed in 8fc6432d. -Expected outcome: -- Decide whether F4 should classify by language family or by available - capabilities. -- Consider deriving candidates from Projectile's known compile/run/test commands - first, then falling back to markers. -- Keep the current "interpreted markers win" behavior only if that remains the - intentional UX after trying it in mixed Python/Node projects. +**** 2026-05-23 Sat @ 03:38:30 -0500 Coverage already in place for mail + system-commands +The task premise was stale. =mail-config.el= has =test-mail-config-helpers.el= (4), =test-mail-config-transport.el= (7), and =test-mail-config.el= (1) covering executable discovery and transport command assignment. =system-commands.el= has =test-system-commands-keymap.el= (2, keymap shape + candidates) and =test-system-commands-resolve-and-run.el= (13, confirmation routing + command-string construction with shell-command stubbed). Both acceptance lists are satisfied; no new tests needed. -**** PROJECT [#B] Consolidate LSP ownership across programming modules :refactor: +**** 2026-05-24 Sun @ 14:43:13 -0500 Bounded the elfeed YouTube fetch + locked EWW UA scoping -LSP setup is currently split across =prog-general.el=, =prog-lsp.el=, and each -language module. There are multiple =use-package lsp-mode= forms and some -conflicting defaults: -- =prog-general.el= enables snippets/UI doc/sideline behavior. -- =prog-lsp.el= disables snippets/UI doc/sideline-heavy behavior. -- Python, Go, shell, C, and webdev modules both call =lsp-deferred= from local - setup functions and add package hooks that call =lsp-deferred= again. +=cj/youtube-to-elfeed-feed-format= called =url-retrieve-synchronously= with no timeout (a hung request blocks Emacs) and only killed the temp URL buffer when an ID was extracted, leaking it on the parse-failure path. Passed =cj/elfeed-url-fetch-timeout= (10s) and moved fetch+parse into an =unwind-protect= that always kills the buffer. The EWW user-agent advice (=eww-config.el=) was already correctly scoped — it injects the UA only from eww-mode buffers, so package.el and other non-EWW url callers pass through untouched — so no code change there, just tests pinning that scoping and the replace-not-duplicate header behavior. Commit =c097b5b4=. -This probably works because lsp-mode is defensive, but it makes the final -runtime policy hard to predict. +**** 2026-05-16 Sat @ 04:00:00 -0500 Moved Slack which-key registration behind with-eval-after-load -***** TODO [#B] Make =prog-lsp.el= the single owner of generic LSP policy :refactor: +=slack-config.el= calls =which-key-add-keymap-based-replacements= at top level, +while most modules defer which-key registration. If which-key is not loaded or +autoloaded as expected, Slack config can fail during require. Expected outcome: -- Move generic =lsp-mode= and =lsp-ui= defaults out of =prog-general.el=. -- Keep language-specific server variables in language modules. -- Keep one hook path per language for starting LSP. -- Preserve the remote-file guard. - -Pitfalls: -- =lsp-pyright= may still need a language-specific hook to load before LSP - starts. -- 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: +- Wrap the registration in =with-eval-after-load 'which-key=. +- Add a module-load smoke test or byte-compile check if easy. -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-05-16 Sat @ 04:00:00 -0500 Removed httpd-start side effect from markdown-preview -**** TODO [#B] Gate tree-sitter grammar auto-install behind an explicit policy +=modules/markdown-config.el:37-51= starts =simple-httpd= inside an +interactive command, then opens a browser at +=http://localhost:8080/imp=. Starting a network listener as a side +effect of a "preview" command surprises users; once started, the +server keeps running until Emacs exits. Either gate the start +behind an explicit confirmation, document the listener clearly, or +move the server start into a separate =cj/markdown-preview-server-start= +command so =markdown-preview= just opens the URL once the server is +known to be running. -=prog-general.el= sets =treesit-auto-install= to =t=. That means opening a file -can trigger grammar download/build/install behavior. This is convenient on a -fresh machine, but it is a startup/network/build side effect in normal editing -and batch contexts. +**** 2026-05-25 Mon @ 18:29:40 -0500 Moved eshell SSH hosts into a defcustom -Expected outcome: -- Prefer ='prompt= or a custom command such as =cj/install-treesit-grammars=. -- Batch/test startup should never auto-install grammars. -- Document the intentional bootstrap path for a new machine. +Replaced the three inline =eshell/alias= SSH-jump lines with a +=cj/eshell-ssh-hosts= defcustom (an alias→remote-path alist defaulting to the +current gocj/gosb/gowolf entries) that a per-machine config can override or set +to nil. The aliases are now built by iterating it via +=cj/--eshell-define-ssh-aliases=; the pure =cj/--eshell-ssh-alias-commands= +helper makes the construction testable without a live eshell. Tests added in +=tests/test-eshell-config-ssh-aliases.el=. -Originally meant to coordinate with the [#A] Python tree-sitter predicate -syntax issue. That one resolved upstream on 2026-05-14 (see =docs/python- -treesit-predicate-mismatch.txt= RESOLVED footer), so this task no longer -depends on it. +**** 2026-05-16 Sat @ 04:00:00 -0500 Fixed https→http in markdown-preview + extracted server start -**** 2026-05-24 Sun @ 04:30:14 -0500 Hardened clipboard git-clone process and path handling +=modules/markdown-config.el:45= opens +=https://localhost:8080/imp= via =browse-url-generic=, but the +=simple-httpd= listener bound in =httpd-config.el= serves plain +HTTP on port 8080. The =https= scheme causes the browser to +attempt a TLS handshake against a plaintext listener -- the request +fails before any preview content reaches the page, so the entire +feature is broken end-to-end. Change the URL to +=http://localhost:8080/imp= (and consider switching the launch to +=browse-url= so the user's default protocol handler is respected). -=cj/git-clone-clipboard-url= shelled out via =shell-command= and derived the dir with =file-name-nondirectory=, which mishandled scp-style SSH with no slash (=git@host:repo.git= → =git@host:repo=) and silently did nothing on a failed clone. Now clones as a direct =git= process (=call-process=, no shell) with =clone -- url dir= (so a =-=-leading URL can't be read as a flag); the destination comes from =cj/--git-clone-dir-name= (last component split on =/= and =:=, handling HTTPS, scp/ssh:// SSH, local paths); validates non-empty clipboard + writable target dir + non-existing destination; surfaces a non-zero git exit as a =user-error= with the =*git-clone*= output. Tests cover the deriver across schemes + empty-clipboard + clone-failure. Commit =35e4d701=. +**** TODO [#B] Document or vendor strapdown.js CDN dependency in =markdown-preview= :solo: -**** TODO [#B] Decide whether auto-executable shell scripts should be opt-in +=cj/markdown-html= (=modules/markdown-config.el:48-51=) embeds a +=