#+TITLE: Task Archive
#+FILETAGS: :archive:
* Resolved (archived)
** DONE [#B] Fix likely =elpa-mirror-location= path bug :bug:quick:
CLOSED: [2026-05-03 Sun]
=early-init.el= builds =elpa-mirror-location= with:
#+begin_src emacs-lisp
(concat user-home-dir ".elpa-mirrors/")
#+end_src
That likely expands to =~/..= incorrectly, e.g. =/home/cjennings.elpa-mirrors/=
instead of =/home/cjennings/.elpa-mirrors/=. Use =expand-file-name= instead.
Acceptance criteria:
- Local mirror paths resolve under the home directory as intended.
- Add a small testable helper if this logic moves out of =early-init.el=.
Done 2026-05-03:
- Replaced =concat= path construction with =expand-file-name= for
=elpa-mirror-location=, =localrepo-location=, and local mirror archive paths.
- Added =tests/test-early-init-paths.el= to load =early-init.el= with package
side effects stubbed and assert local archive paths.
** DONE [#B] Fix =vc-follow-symlinks= setting in =system-defaults.el= :bug:quick:
CLOSED: [2026-05-03 Sun]
=modules/system-defaults.el= has:
#+begin_src emacs-lisp
(setq-default vc-follow-symlinks)
#+end_src
The comment says "don't ask to follow symlinks if target is version
controlled", but evaluating this leaves =vc-follow-symlinks= as =nil=. That
means the intended prompt suppression is not actually configured. The likely
fix is =t=, but verify the exact Emacs semantics first.
Acceptance criteria:
- Set =vc-follow-symlinks= to the intended value explicitly.
- Add a small regression test or startup smoke assertion for this setting.
- Confirm opening a symlinked, version-controlled file no longer prompts.
Done 2026-05-03:
- Confirmed from Emacs docs that =t= follows version-controlled symlinks without
prompting.
- Set =vc-follow-symlinks= explicitly to =t=.
- Added =tests/test-system-defaults-vc-follow-symlinks.el=.
** DONE [#B] Fix overwritten =C-; != system command prefix :bug:quick:
CLOSED: [2026-05-03 Sun]
=system-commands.el= first binds =cj/system-command-map= under =C-; !=, then
later replaces the same prefix with =cj/system-command-menu=:
#+begin_src emacs-lisp
(keymap-set cj/custom-keymap "!" cj/system-command-map)
...
(keymap-set cj/custom-keymap "!" #'cj/system-command-menu)
#+end_src
That likely makes the documented subkeys such as =C-; ! r= and =C-; ! s=
unreachable.
Expected outcome:
- Decide whether =C-; != is a prefix map or a direct menu command.
- If keeping both, bind the menu inside the prefix, e.g. =C-; ! != or =C-; ! m=.
- Add a key-resolution smoke test for the chosen bindings.
Done 2026-05-03:
- Kept =C-; != as the prefix map.
- Moved the completing-read menu to =C-; ! !=.
- Added which-key labels for the documented subkeys.
- Added =tests/test-system-commands-keymap.el=.
** DONE [#B] Ensure formatters for TS, Python, Go, Shell with automated tests :tests:
CLOSED: [2026-04-30 Thu]
Audit showed the four formatters were already consistently bound to =C-; f=
across the relevant mode-maps. No production change needed — this branch
shipped the regression net only.
5 new files (1 testutil + 4 per-language test files), 17 tests total, all
passing.
Per-language wiring inventory (locked in):
- Python: =blacken-buffer= in =python-ts-mode-map= (use-package =:bind=)
- Shell: =shfmt-buffer= in =sh-mode-map= and =bash-ts-mode-map=
(use-package =:bind=, gated on =:if (executable-find shfmt-path)=)
- Go: =gofmt= via =cj/go-mode-keybindings= hook + =local-set-key=
- TS / JS / Web: =cj/webdev-format-buffer= via =cj/webdev-keybindings= hook
Each test file checks: prog module requires without error, formatter package
is in =features=, format command is fboundp, C-; f binding resolves, and the
underlying executable is on PATH (skipped via =ert-skip= if not installed).
Real-formatting tests (run formatter on misformatted input, assert output)
were deferred — wiring tests catch the highest-frequency regressions cheaply
without crossing the boundary into testing the upstream formatter tools.
** DONE [#A] Continue coverage push on low-coverage modules :tests:
CLOSED: [2026-04-30 Thu]
The four scoped low-coverage modules — =keybindings.el=, =config-utilities.el=,
=org-noter-config.el=, =host-environment.el= — are now covered. 121 new tests
across 18 test files. Plus one production bug fixed in
=cj/validate-org-agenda-timestamps= (property-check branch was dead since the
function was written: =(intern (downcase prop))= built plain symbols where
=org-element-property= expects keywords).
Modules covered (per-function test files, Normal/Boundary/Error categories):
- =keybindings.el= — =cj/jump-open-var=, the auto-generated jump commands.
- =host-environment.el= — laptop/desktop predicates, platform predicates,
display predicates, system-timezone detection. Folded a docstring fix on
=cj/detect-system-timezone= along the way.
- =config-utilities.el= — =with-timer=, =cj/compile-this-elisp-buffer=,
=cj/emacs-build--summary-string=, info-commands smoke. Plus refactor pass
to extract testable internals from the four heavyweight interactives:
=cj/--delete-compiled-files-in-dir=, =cj/--benchmark-method=,
=cj/--recompile-emacs-home=, =cj/--validate-timestamps-in-buffer= +
=cj/--format-validation-report-section=.
- =org-noter-config.el= — preferred-split, title-to-slug,
generate-notes-template, the predicate cluster.
Broader scope (the 11 high-value untested modules, 7 lightly-tested ones, and
~28 use-package wrappers to triage) is tracked under the [#B] "Coverage audit:
untested and lightly-tested modules" entry.
** DONE [#B] Test Slack mark-as-read and bury buffer (C-; S q) :tests:
CLOSED: [2026-04-30 Thu]
Verified working. =cj/slack-mark-read-and-bury= is bound to =C-; S q= in
=modules/slack-config.el=, replacing the previous binding that referenced a
non-existent =slack-buffer-mark-as-read-and-bury=.
** DONE [#A] Fix calendar-sync UNTIL boundary regression :bug:
CLOSED: [2026-05-03 Sun]
Real cause was a Saturday-only flake in the test, not a stale =.elc= as
earlier triage suggested. =test-calendar-sync--expand-weekly-boundary-single-week-5-element-until=
built its byday string from a 0-indexed Sunday-first array
=("SU" "MO" "TU" "WE" "TH" "FR" "SA")= while the production code uses
Monday=1, Sunday=7 throughout. When start-date landed on a Sunday
(start-weekday=7), =(nth 7 array)= returned nil, and inside =expand-weekly=
the =(mod (- nil current-weekday) 7)= form raised
=wrong-type-argument number-or-marker-p nil=. The test failed every
Saturday (when "tomorrow" is Sunday) and passed the other six days.
Fixed in commit =8ec668d= by switching the lookup to
=(nth (1- start-weekday) '("MO" "TU" "WE" "TH" "FR" "SA" "SU"))= — the
same convention as every other weekday-mapping in the codebase. Verified
across all 7 weekdays via faked =current-time=.
Production code was internally consistent; no production change needed.
** DONE [#B] Investigate missing yasnippet configuration
CLOSED: [2026-02-16 Mon]
Resolved: snippets were in ~/sync/org/snippets/ but directory was empty after
machine migration. Restored 28 snippets from backup, relocated snippets-dir
to ~/.emacs.d/snippets/ for source control.
** DONE [#B] Write Complete ERT Tests for This Config [13/13]
CLOSED: [2026-02-16 Mon]
All 13 modules covered: custom-case (43), custom-datetime (10), hugo-config (41),
org-capture-config (22), modeline-config (26), config-utilities (11),
org-agenda-config (31), org-contacts-config (40), ui-config (27),
org-refile-config (16), org-webclipper (31), org-noter-config (30),
browser-config (20). 172 test files, all passing.
** DONE [#B] Validate recording startup
CLOSED: [2026-02-15 Sun 15:40]
Check process status after starting.
Parse ffmpeg output for errors.
Show actual ffmpeg command for debugging.
** DONE [#C] Fix EMMS keybinding inconsistency with other buffers
CLOSED: [2026-02-15 Sun 15:40]
EMMS keybindings conflict with standard buffer keybindings, causing mistypes.
Results in accidental destructive actions (clearing buffers), requires undo + context switch.
Violates Intuitive value - muscle memory should help, not hurt.
** DONE [#B] Update stale model list in ai-config.el
CLOSED: [2026-03-06 Fri]
Model IDs were outdated. Updated to current models (claude-opus-4-6, claude-sonnet-4-6, etc.).
See cleanup task in ai-config.el for full list of related improvements.
** DONE [#C] Graduate easy-hugo into hugo-config.el, retire wip.el, uninstall pomm
CLOSED: [2026-04-22 Wed]
Move the easy-hugo use-package block from modules/wip.el into modules/hugo-config.el so the full Hugo pipeline (new post → ox-hugo export → preview server → SSH deploy) lives in one place and is actually reachable at runtime. wip.el is currently not required in init.el, so its only live block (pomm) never ran anyway.
Scope:
- Verify easy-hugo is usable against current Hugo CLI and the paths in the existing config (~/code/cjennings-net/, /var/www/cjennings/).
- If easy-hugo is healthy: graduate it and propose keybindings under the C-; h hugo prefix.
- If easy-hugo is unmaintained or broken: document the issues, assess whether fixing or forking is viable.
- Delete modules/wip.el entirely and remove the commented-out (require 'wip) line at init.el:156.
- Uninstall pomm (remove from elpa/).
- Confirm make compile no longer warns about wip or pomm.
** DONE [#C] Consider Recording Enhancement via post-processing hooks
CLOSED: [2026-04-04 Sat 12:00]
Auto-compress after recording.
Move to cloud sync directory.
Generate transcript (once transcription workflow exists).
** DONE [#B] Implement coverage reporting (per docs/specs/coverage-spec-implemented.org)
CLOSED: [2026-04-23]
Diff-aware coverage report with pluggable backends. Shipped v1 on 2026-04-23.
Design: [[id:7d7f4486-fad7-4f0a-bd9a-775bd4cd8f7e][docs/specs/coverage-spec-implemented.org]]
What shipped:
- modules/coverage-core.el (engine, backend registry, cj/coverage-report, cj/coverage-report-mode)
- modules/coverage-elisp.el (undercover.el backend, auto-registered on load)
- make coverage Makefile target (simplecov JSON output, per-file isolation, .elc cleanup, exclusion list)
- tests/run-coverage-file.el (undercover driver for the Makefile)
- ERT tests for all pure helpers (parse-simplecov, parse-diff, intersect, format-report, backend registry, scope lookup) plus one smoke test for the command
- F7 global binding
- docs/specs/coverage-spec-implemented.org (design doc with historical LCOV→simplecov pivot note)
Notable pivots during implementation:
- Switched collection format from LCOV to simplecov (undercover's :merge-report t only supports simplecov).
- `make coverage` must delete modules/*.elc first so undercover's source-level instrumentation actually fires.
- Excluded tests/test-all-comp-errors.el from coverage runs (byte-compiles modules, which fails under undercover instrumentation).
Deferred to future tickets:
- Python, TypeScript, Go backends
- Fringe-overlay coverage display (parked over perf concerns)
- Historical coverage tracking
** DONE [#A] Fix "Invalid face attribute :foreground nil" flood :bug:
CLOSED: [2026-04-26 Sun 20:15]
Diagnosed 2026-04-26 — paused at /start-work Gate 2. The diagnostic was originally saved to =~/code/emacs-wttrin/inbox/wttrin-face-flood-diagnosis.txt= but that file has since been cleaned out of the wttrin inbox; the summary below is the surviving record.
Summary: root cause is =wttrin--make-emoji-icon= in =~/code/emacs-wttrin/wttrin.el:598-608=. Builds a face spec with =:foreground foreground= unconditionally when =wttrin-mode-line-emoji-font= is set; the caller passes nil when the cache is fresh, producing =(:family ... :foreground nil)= which Emacs treats as invalid on every redisplay.
Fix lives in the wttrin repo (cross-repo), not =.emacs.d=. Two-commit scope: regression test + fix.
** DONE [#B] Test Slack desktop notifications (DM and @mention) :tests:
CLOSED: [2026-04-26 Sun]
Notifications were silently failing due to two bugs in =cj/slack-notify=:
1. =slack-room-im-p= (nonexistent) → =slack-im-p= (correct EIEIO predicate)
2. =slack-message-to-string= (propertized) → =slack-message-body= (plain text)
Verified in actual Slack use: desktop notifications fire correctly for DMs and @mentions, with the title and message body rendering as expected.
*File:* modules/slack-config.el (cj/slack-notify function)
** DONE [#C] Clean up ai-config.el
CLOSED: [2026-03-06 Fri]
Cleaned up assorted issues in =modules/ai-config.el=:
- Stale model list updated to current IDs (=claude-opus-4-6=, =claude-sonnet-4-6=, etc.).
- Removed duplicate =gptel-backend= setq (lines 284 and 295 both did the same set).
- Deleted the unused =cj/gptel-backends= defvar (duplicated =cj/gptel--available-backends=).
- Moved helpers (=cj/gptel--fresh-org-prefix=, =cj/gptel--refresh-org-prefix=, =cj/gptel-backend-and-model=, =cj/gptel-insert-model-heading=) outside the use-package =:config= block for visibility and byte-compilation.
- Changed =gptel-include-reasoning= from ='ignore= to a buffer name (=*AI-Reasoning*=) so reasoning lands in a separate buffer, isn't re-sent as context, and can be toggled per-session via the gptel menu (=C-; a M=).
- Switched =gptel-magit= loading from a hook to lazy autoloads via =with-eval-after-load 'magit= so it only loads on key press.
- Moved Rewrite from =&= to =C-; a r= and Clear context to =C-; a c= for clearer mnemonics.
** DONE [#B] Use file basename, not buffer name, when moving buffer files :review:bug:quick:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 19:24
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review custom editing utility modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=cj/--move-buffer-and-file= builds the destination as =(concat dir "/" name)=,
where =name= is =(buffer-name)=. If the buffer has been renamed, uniquified
(e.g. =foo.txt<2>=), or otherwise differs from the file basename, the move can
write an unexpected destination filename.
Expected outcome:
- Use =(file-name-nondirectory filename)= for the destination basename unless
the interactive command explicitly asks for a new name.
- Add regression tests for:
- renamed buffer visiting =original.txt=,
- duplicate buffer names / uniquified names,
- target directory with and without trailing slash.
Done 2026-05-03:
- =cj/--move-buffer-and-file= now derives the destination basename from
=buffer-file-name=.
- =cj/move-buffer-and-file= uses the same basename when checking/prompting for
overwrite.
- Added regression coverage for renamed and uniquified buffer names.
** DONE [#B] Fix malformed drill capture template in =org-capture-config.el= :review:bug:quick:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 19:28
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review Org workflow modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
The ="d"= drill capture template appears to have a malformed source link:
#+begin_src org
Source: [[%:link][%:description]
nCaptured On: %U
#+end_src
It is missing the closing =]]= and has a literal leading =n= before "Captured".
Expected outcome:
- Fix the template string.
- Add a narrow test that expands or inspects the template and confirms the
source link plus "Captured On" line are well-formed.
Done 2026-05-03:
- Closed the source link in the regular drill capture template.
- Removed the stray literal =n= before =Captured On=.
- Added =tests/test-org-capture-config-drill-template.el=.
** DONE [#B] Disable auth-source debug logging by default :review:security:quick:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 19:40
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review integrations and application modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=auth-config.el= sets =auth-source-debug= to =t=. Debug output is helpful while
fixing GPG/auth-source issues, but credential lookup debug logging should not be
the steady-state default for a config that handles Slack, AI, REST, mail, and
transcription credentials.
Expected outcome:
- Default =auth-source-debug= to nil.
- Add an explicit troubleshooting command or variable to enable auth debugging
temporarily.
- Confirm no module logs secret values directly on auth failure.
Done 2026-05-03:
- Defaulted =auth-source-debug= to nil via =cj/auth-source-debug-enabled=.
- Added =cj/set-auth-source-debug= and =cj/toggle-auth-source-debug= for
temporary troubleshooting.
- Added =tests/test-auth-config-debug.el=.
- Scanned nearby auth callers; obvious failure messages name hosts/logins but
do not print secret values directly.
** DONE [#B] Quote F6 current-file test commands in =dev-fkeys.el= :review:bug:quick:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 19:44
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=cj/--f6-test-runner-cmd-for= builds shell command strings from relative paths,
directories, and source stems:
#+begin_src emacs-lisp
(format "pytest %s" rel-path)
(format "make test-name TEST=^test-%s-" stem)
(format "go test ./%s" rel-dir)
#+end_src
This is fine for the current repo's simple filenames, but it will break or
misbehave for paths with spaces or shell metacharacters. Since these commands
feed =compile=, either quote each dynamic argument or move to a command-builder
that returns argv plus a shell-rendering function.
Expected outcome:
- Quote =rel-path=, =stem= / test regex, and =rel-dir= appropriately.
- Add regression tests for:
- Python test file under a directory with spaces,
- Elisp module stem containing shell-significant characters,
- Go package directory with spaces.
- Keep existing command strings unchanged for ordinary paths.
Done 2026-05-03:
- Added =cj/--f6-shell-quote-argument= so F6 command strings escape dynamic
paths and test regexes only when needed.
- Quoted Python rel-paths, generated Python test paths, Elisp =FILE= /
=TEST= values, and Go package paths.
- Added regression coverage for Python paths with spaces, Elisp stems with
shell metacharacters, and Go package directories with spaces.
- Confirmed ordinary command strings remain unchanged.
** DONE [#B] Disable mail transport debug logging and validate dependencies :review:security:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 19:57
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review integrations and application modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=mail-config.el= sets =smtpmail-debug-info= to =t= and builds mail commands from
=executable-find= results at config time. If =msmtp= or =mbsync= is missing, the
configuration can silently produce unusable command values. Mail debug output is
also too sensitive to leave enabled by default.
Expected outcome:
- Default =smtpmail-debug-info= to nil.
- Add an explicit mail troubleshooting variable/command for temporary SMTP
debug logging.
- Validate =msmtp= and =mbsync= before assigning send/sync commands, and show a
clear warning or disable the dependent feature when missing.
- Add a module-load test with stubbed =executable-find= results.
Done 2026-05-03:
- Defaulted =smtpmail-debug-info= to nil via =cj/smtpmail-debug-enabled=.
- Added =cj/set-smtpmail-debug= and =cj/toggle-smtpmail-debug= for temporary
troubleshooting.
- Added validation helpers for =msmtp= and =mbsync= so missing executables
warn and do not produce unusable command values.
- Added =tests/test-mail-config-transport.el= with stubbed executable lookup.
** DONE [#B] Make test scratch paths sandbox- and CI-friendly :refactor:tests:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 19:59
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#A] Architecture review follow-up from 2026-05-03
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: refactor
:END:
=tests/testutil-general.el= hardcodes =~/.temp-emacs-tests/=. That caused the
first =make coverage= run to fail under the default workspace sandbox because
tests attempted to write outside the repo and =/tmp=.
Confirmed again 2026-05-03 with =make test=: the default sandbox run reported
32 failing test files across custom-buffer, custom-line, music, Org, undead
buffers, and recording cleanup tests. Rerunning the same command with approval
outside the sandbox passed all 311 test files. This is a test-environment
contract problem, not a regression in those modules.
Expected outcome:
- Let tests honor an env var, for example =CJ_EMACS_TEST_DIR=.
- Default to =(make-temp-file ... t)= or a stable directory under
=temporary-file-directory=.
- Keep an option for a stable local directory when debugging manually.
- Ensure cleanup is robust and guarded against deleting outside the selected
test root.
Acceptance criteria:
- =make test-file FILE=test-custom-line-paragraph-join-line-or-region.el=
works without special home-directory write permission.
- =make coverage= works in a clean sandbox/CI environment.
- Update any docs or Makefile notes that assume =~/.temp-emacs-tests/=.
Done 2026-05-03:
- Changed =cj/test-base-dir= to honor =CJ_EMACS_TEST_DIR= for stable local
debugging and otherwise create a unique directory under
=temporary-file-directory=.
- Replaced prefix-string path checks with =file-in-directory-p= and added a
deletion guard that refuses broad roots such as =temporary-file-directory=.
- Updated =make clean-tests= to clean the new temp-root pattern and the legacy
=~/.temp-emacs-tests= directory.
- Added =tests/test-testutil-general.el=.
- Confirmed default sandbox =make test= passes: 312 test files.
** DONE [#B] Fix C single-file compile command path handling :review:bug:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 20:11
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=prog-c.el= builds the fallback single-file compile command from =(buffer-name)=:
#+begin_src emacs-lisp
(format "gcc -Wall -Wextra -g -o %s %s"
(file-name-sans-extension (buffer-name))
(buffer-name))
#+end_src
This breaks for renamed buffers, duplicate buffer names, paths with spaces, and
files outside =default-directory=.
Expected outcome:
- Use =buffer-file-name= for source path and derive output from the file path.
- Shell-quote both paths.
- If the buffer is not visiting a file, show a clear message or use a safe temp
target.
- Add regression tests for filenames with spaces and renamed buffers.
Done 2026-05-03:
- Added =cj/c--single-file-compile-command= and changed the fallback path to
use =buffer-file-name= instead of =(buffer-name)=.
- Shell-quoted source and output paths.
- Made non-file buffers signal a clear =user-error=.
- Added =tests/test-prog-c-compile-command.el= for spaces, shell
metacharacters, renamed buffers, and non-file buffers.
** DONE [#B] Replace shell-based coverage git diff calls with argv process calls :review:robustness:refactor:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 20:11
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=coverage-core.el= uses =shell-command-to-string= for git diff scopes, including
forms with command substitution:
#+begin_src emacs-lisp
git diff $(git merge-base HEAD main)..HEAD --unified=0
#+end_src
The inputs are mostly fixed, but this code is central tooling and should avoid
shell parsing entirely.
Expected outcome:
- Use =process-file= / =call-process= with argv lists.
- Compute merge bases with a separate git invocation.
- Surface git failures as clear =user-error= messages.
- Preserve the existing parser and report formatting tests.
Done 2026-05-03:
- Added argv-boundary tests before the implementation change.
- Replaced =shell-command-to-string= with =process-file= based git helpers.
- Compute merge-base with a separate =git merge-base HEAD = invocation
before running =git diff ..HEAD --unified=0=.
- Surface non-zero git exits as =user-error= messages that include the git
argv, exit status, and command output.
- Updated the interactive coverage report smoke test to stub =process-file=.
** DONE [#B] Cache or cheapen VC work in the custom modeline :review:perf:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 20:24
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review UI and navigation modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=modeline-config.el= computes VC branch/state in a mode-line =:eval= form using
=vc-backend=, =vc-working-revision=, =vc-git--symbolic-ref=, and =vc-state=.
Even though it only displays for the selected window, this can become expensive
in large repositories, remote/TRAMP buffers, or slow filesystems.
Expected outcome:
- Measure the current cost in normal git repos and a TRAMP/remote-like case if
available.
- Cache branch/state per buffer and invalidate on buffer/file save, VC refresh,
or timer.
- Avoid VC calls for remote files unless explicitly enabled.
- Add tests around any pure formatting/cache invalidation helpers.
Pitfalls:
- Mode-line code runs often; avoid anything that can block redisplay.
- Do not lose the useful active-window-only behavior.
Done 2026-05-03:
- Added buffer-local VC modeline caching with a short TTL, plus cache clearing
on save and revert.
- Kept the active-window-only modeline rendering behavior.
- Skipped VC work for remote files by default, with a custom option to opt in.
- Added focused tests for cache reuse, TTL refresh, remote-file bypass, cache
clearing, and VC rendering metadata.
- Measured on this repo after the change: uncached reads were about 2.4 ms
each, cached reads were about 0.0025 ms each, and remote-skipped reads avoid
VC calls while still paying the cheap =file-remote-p= check.
** DONE [#B] Make Projectile command-cache revert state compilation-local :review:robustness:bug:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 21:11
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=dev-fkeys.el= protects Projectile's compile/test/run command caches by
capturing prior state in the global =cj/--projectile-revert-state= and reverting
on failed compile when the cached command changed. The idea is useful and well
covered, but the state is global while compilation processes are asynchronous.
Risk:
- Starting another Projectile compile/test/run before the first finish hook
fires can overwrite the state.
- The finish hook is installed even when no project/cache state was captured.
- A failure from one compilation buffer could theoretically act on state from a
later command.
Expected outcome:
- Store revert metadata on the compilation buffer/process where possible, or
close over immutable state in a one-shot hook instead of using one global
variable.
- Only install the revert hook when state was captured.
- Add a test that simulates two overlapping compile processes finishing out of
order.
Done 2026-05-03:
- Changed Projectile command-cache revert capture to return immutable state
instead of storing live compile metadata in one global variable.
- Installed one-shot buffer-local compilation finish hooks on the compilation
buffer returned by Projectile, so overlapping compiles keep separate revert
metadata.
- Avoided installing revert hooks when no project/cache state was captured.
- Added regression coverage for two overlapping compiles finishing out of order.
** DONE [#C] Tighten =dev-fkeys.el= load-order contract with Projectile :review:cleanup:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 21:17
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=init.el= loads =dev-fkeys.el= before =prog-general.el=, while =prog-general.el=
owns the =projectile= setup. =dev-fkeys.el= currently works through autoloads,
=fboundp= checks, and top-level advice, but the dependency is implicit.
Expected outcome:
- Either require/load Projectile before installing advice, or move the
=dev-fkeys= require after Projectile setup.
- Keep direct batch requiring of =dev-fkeys.el= test-friendly.
- Add a module-load smoke test for "Projectile not loaded yet" and "Projectile
loaded after dev-fkeys".
Done 2026-05-03:
- Replaced raw top-level Projectile =advice-add= calls with named advice
wrappers and an explicit idempotent installer.
- Registered advice immediately when Projectile is already loaded, otherwise
delayed installation with =eval-after-load=.
- Kept direct batch requiring of =dev-fkeys.el= from forcing Projectile to load.
- Added smoke tests for deferred registration, already-loaded registration, and
bounded installation behavior when Projectile functions are unavailable.
** DONE [#B] Retire legacy =cj/--projectile-revert-on-fail= and global revert state :review:chore:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 21:32
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
After scoping the projectile cache-revert state to each compile (commit
=31edc86=), =cj/--projectile-revert-on-fail= and the global
=cj/--projectile-revert-state= are production-dead. They survive only so
=tests/test-dev-fkeys--projectile-revert-on-fail.el= keeps exercising the
inner decision logic via the legacy wrapper.
Expected outcome:
- Delete =cj/--projectile-revert-on-fail= and =cj/--projectile-revert-state=
from =modules/dev-fkeys.el=.
- Re-point the existing =test-dev-fkeys--projectile-revert-on-fail.el= cases
at =cj/--projectile-revert-state-on-fail= (or rename the file to match
the new target).
- Confirm the broader dev-fkeys test set still passes after the rename.
Done 2026-05-03:
- Removed the production-dead legacy wrapper and global revert state from
=dev-fkeys.el=.
- Repointed the existing revert tests at =cj/--projectile-revert-state-on-fail=.
- Removed stale test bindings/assertions that only existed for the legacy global
state.
** DONE [#C] Review duplicate or competing search/keybinding setup in =selection-framework.el= :review:cleanup:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 23:27
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review UI and navigation modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=selection-framework.el= binds =C-s= to =consult-line= and later rebinds it to
=cj/consult-line-or-repeat=. The final behavior is probably intended, but the
earlier binding is dead configuration and makes the file harder to reason about.
Expected outcome:
- Remove the intermediate =C-s= binding or explain it.
- Add a small test or smoke check that =C-s= resolves to
=cj/consult-line-or-repeat= after the module loads.
Verify 2026-05-03:
- Removed the intermediate global =C-s= binding to =consult-line=.
- Kept the final =C-s= binding to =cj/consult-line-or-repeat=.
- Added a smoke test that loads =selection-framework.el= with package setup
stubbed and asserts =C-s= resolves to =cj/consult-line-or-repeat=.
** DONE [#C] Move and test theme persistence behavior :review:tests:refactor:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 23:46
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review UI and navigation modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=ui-theme.el= persists theme names to =theme-file= and loads fallback themes
when the file is absent or invalid. The current default path is built from
=org-dir= as =emacs-theme.persist=, which makes UI theme persistence depend on
Org-directory configuration and keeps an Emacs preference outside the Emacs
home directory.
Desired direction:
- Make the persisted theme file a dotfile inside =user-emacs-directory=, e.g.
=.emacs-theme= or another clear dotfile name.
- Remove the runtime need for =org-dir= from theme persistence.
- Keep the theme persistence code self-contained in =ui-theme.el= unless an
existing constants helper is a better local fit.
- Preserve the current user-facing behavior: chosen themes persist, unreadable
or invalid saved themes fall back, and literal ="nil"= means no enabled theme.
- Refactor the current large theme-load function into smaller helpers for:
reading persisted theme names, disabling enabled themes, loading one named
theme, applying a persisted theme value, and loading fallback themes.
- Prefer =defcustom= for user-facing persistence/fallback settings.
- Replace generic =cj/read-file-contents= / =cj/write-file-contents= names with
theme-specific helpers or move generic helpers elsewhere.
- Prefer =write-region= over visiting the file with =write-file= for persistence.
- Decide whether the top-level =(cj/load-theme-from-file)= side effect should
remain in the module or become an explicit init call; preserve startup behavior
either way.
Useful tests:
- The default =theme-file= expands under =user-emacs-directory= and does not
depend on =org-dir=.
- Reading a missing/unreadable theme file returns nil.
- Writing to a writable temp theme file succeeds.
- Invalid theme name triggers fallback path without leaving multiple themes
enabled.
- The literal ="nil"= disables themes.
- Loading a valid persisted theme uses that theme and does not also load the
fallback.
- Theme application disables existing themes before loading a valid or fallback
theme, so themes do not stack.
- Theme writes use the configured =theme-file= and do not visit that file in a
temp buffer.
Keep tests isolated by binding =theme-file= to a temp file and mocking
=load-theme= / =disable-theme= where appropriate. Avoid mutating the real
=custom-enabled-themes= state in tests.
Pitfalls:
- =ui-theme.el= currently calls =cj/load-theme-from-file= at module load time,
so tests should either bind =theme-file= before loading or mock file/theme
effects carefully.
- If changing the persisted filename, consider whether a migration path from
the old =org-dir/emacs-theme.persist= location is worth doing now or should
be a separate compatibility task.
Verify 2026-05-03:
- Moved the default =theme-file= to =(expand-file-name ".emacs-theme"
user-emacs-directory)=.
- Removed the =org-dir= / =user-constants= dependency from =ui-theme.el= theme
persistence.
- Split theme persistence into theme-specific helpers for read/write,
disabling themes, named theme loading, fallback loading, and applying a
persisted value.
- Switched persistence writes to =write-region=.
- Moved startup theme loading out of module load side effects and into
=init.el= immediately after requiring =ui-theme=.
- Added focused tests for the default path, missing reads, writes,
=write-region= use, valid persisted themes, invalid fallback, missing
fallback, and literal ="nil"=.
- Verified with =make test-file FILE=test-ui-theme-persistence.el=,
=make test-file FILE=test-all-comp-errors.el=,
=make test-file FILE=test-dupre-theme.el=, and full =make test=.
** DONE [#B] Make test-runner focus state project-scoped :review:tests:bug:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 23:46
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review programming workflow modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=test-runner.el= stores =cj/test-focused-files= and =cj/test-mode= globally.
When switching between projects, focused test filenames and mode can bleed into
the next project.
Expected outcome:
- Scope focused files and mode by project root.
- Keep the current UI commands unchanged.
- Coordinate with the existing [#B] "Add project-aware ERT test isolation when
switching projects" task so test registration and focus state follow the same
project boundary.
Verify 2026-05-03:
- Added per-project test-runner state keyed by Projectile project root, with
focused files and all/focused mode tracked independently per project.
- Kept the existing interactive commands and legacy public variables mirrored
to the current project state.
- Removed the hard test-time dependency on requiring Projectile before project
root calls can be mocked.
- Added regression tests proving focused files and mode do not bleed across
projects.
- Verified with =make test-file FILE=test-test-runner.el=,
=make test-file FILE=test-all-comp-errors.el=,
=make test-file FILE=test-dev-fkeys--f6-test-runner.el=,
=make test-file FILE=test-dev-fkeys--f6-current-file-tests-impl.el=, and
full =make test=.
** DONE [#B] Add project-aware ERT test isolation when switching projects :tests:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 23:46
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:END:
When switching between elisp projects (e.g., emacs.d to Chime), previously loaded
ERT tests remain in memory causing confusion and wrong tests to run.
**Problem:**
- ERT tests globally registered in Emacs session
- `M-x ert RET t RET` runs ALL loaded tests from ALL projects
- Can accidentally run emacs.d tests when working on Chime
- Current workaround: restart Emacs (loses session state)
**Solution:**
Create `cj/ert-clear-tests` and `cj/ert-run-current-project-tests`:
- Clear tests when switching projects (hook into project-switch)
- Use test name prefixes to selectively clear (cj/ vs chime-)
- Only run current project's tests
**Success Criteria:**
- Switch projects -> old tests cleared
- Only current project's tests run with `M-x ert`
- Works with both interactive and batch runs
Verify 2026-05-03:
- Added =cj/ert-clear-tests= to delete ERT tests loaded by this runner from
other known project roots while keeping the current project's tests.
- Added =cj/ert-run-current-project-tests= and routed =cj/test-run-all= through
a current-project selector, so the test runner's "all" path runs all tests
for the current project rather than every loaded ERT test in the session.
- Hooked =cj/test-project-switch-reset= into
=projectile-after-switch-project-hook= after Projectile loads.
- Added regression tests for clearing other-project ERT tests and selecting
only current-project test names.
- Verified with =make test-file FILE=test-test-runner.el=,
=make test-file FILE=test-all-comp-errors.el=,
=make test-file FILE=test-dev-fkeys--f6-test-runner.el=,
=make test-file FILE=test-dev-fkeys--f6-current-file-tests-impl.el=, and
full =make test=.
** DONE [#B] Sanitize calendar-generated Org headings and properties :review:bug:
CLOSED: [2026-05-03 Sun]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-03 Sun 23:52
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review integrations and application modules
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review
:END:
=calendar-sync--event-to-org= sanitizes description body text against accidental
Org headings, but event summaries, locations, organizers, statuses, and URLs are
inserted into headings/property drawers directly. Calendar text containing
newlines, leading stars, or property drawer markers can corrupt the generated
Org structure.
Expected outcome:
- Add separate sanitizers for Org heading text and property values.
- Preserve readable event text while escaping or flattening structural
characters.
- Add tests for summaries with newlines/stars and locations with property-like
lines.
Verify 2026-05-03:
- Added separate sanitizers for Org heading text and Org property values.
- Event summaries now flatten newlines and convert leading heading stars to
dashes before being inserted as Org heading text.
- Location, organizer, status, and URL values now collapse structural
whitespace into single-line property values before insertion into the
property drawer.
- Added regression tests for summaries with newlines/stars and property values
containing =:END:=, property-looking text, and heading-looking text.
- Verified with =make test-file FILE=test-calendar-sync--event-to-org.el=,
=make test-file FILE=test-calendar-sync--sanitize-org-body.el=,
=make test-file FILE=test-all-comp-errors.el=,
=make test-file FILE=test-calendar-sync.el=,
=make test-file FILE=test-calendar-sync--parse-event.el=,
=make test-file FILE=test-calendar-sync--event-start-time.el=, and full
=make test=.
** DONE [#B] Add a no-config startup test for =calendar-sync.el= :review:security:refactor:
CLOSED: [2026-05-04 Mon]
:PROPERTIES:
:ARCHIVE_TIME: 2026-05-04 Mon 00:05
:ARCHIVE_FILE: ~/.emacs.d/todo.org
:ARCHIVE_OLPATH: Emacs Open Work/PROJECT [#B] Module-by-module review and hardening/Review Org workflow modules/PROJECT [#A] Split personal calendar configuration from =calendar-sync.el=
:ARCHIVE_CATEGORY: todo
:ARCHIVE_TODO: DONE
:ARCHIVE_ITAGS: review security refactor
:END:
Bind =calendar-sync-calendars= to nil and verify:
- requiring the module does not start a timer,
- =calendar-sync-status= reports the missing configuration cleanly,
- no network process is started.
Verify 2026-05-03:
- Removed the tracked top-level personal calendar plist from =calendar-sync.el=,
leaving =calendar-sync-calendars= nil by default.
- Added an ignored private config path, =calendar-sync.local.el=, loaded when
readable so local calendar definitions can stay outside git.
- Added =calendar-sync.local.el= to =.gitignore= and moved the current local
calendar plist into that ignored file to preserve this machine's workflow.
- Gated top-level auto-start behind =(not noninteractive)= so batch/test loads
do not start timers or network fetches, even when private config exists.
- Added startup tests for no-config loads, missing-config status reporting,
private config loading, and private config not auto-starting in batch.
- Verified with =make test-file FILE=test-calendar-sync-no-config-startup.el=,
=make test-file FILE=test-calendar-sync.el=,
=make test-file FILE=test-all-comp-errors.el=, and full =make test=.
** DONE [#C] Add focused tests for early startup archive construction :tests:
CLOSED: [2026-05-10 Sun]
=tests/test-early-init-paths.el= covers path constants, but not archive
selection, archive priorities, refresh decisions, or the offline/localrepo
branches that make startup reproducible.
Useful assertions after package bootstrap is extracted:
- Local repo and local mirrors are added only when their directories exist.
- Local archives keep higher priority than online archives.
- =cj/use-online-repos= disables online archives and refresh attempts.
- Stale or missing online archive caches request refresh only through the
extracted bootstrap path, not by loading unrelated modules.
Verify 2026-05-10:
- Extended =tests/test-early-init-paths.el= to cover local archive presence,
local-vs-online priority, offline archive omission, fresh-cache no-refresh,
and missing-cache refresh behavior.
- Ran =make test-file FILE=test-early-init-paths.el=.
** DONE [#C] Move inline GPT tool wiring out of =init.el= :startup:refactor:
CLOSED: [2026-05-10 Sun]
=init.el= contains a =with-eval-after-load 'gptel= block that mutates
=load-path= and requires local files from =~/.emacs.d/gptel-tools=. This is
feature-specific integration code inside the top-level load graph, and it will
be hard to test or defer cleanly while it stays inline.
Expected outcome:
- Move the tool registration into =ai-config.el= or a small dedicated module.
- Guard the local tool directory and individual tool files so missing optional
files produce a clear message rather than breaking startup after =gptel= loads.
- Keep =init.el= limited to coarse module loading until the load-graph refactor
removes most eager =require=s.
- Add a smoke test for the missing-directory path if the helper is pure enough.
Verify 2026-05-10:
- Moved optional GPTel tool loading into =ai-config.el= via
=cj/gptel-load-local-tools=.
- Removed the inline =with-eval-after-load 'gptel= tool block from =init.el=.
- Added =tests/test-ai-config-gptel-local-tools.el= for missing-directory,
present-tool, and missing-file behavior.
- Ran focused AI config tests and checked parens for =init.el= and
=modules/ai-config.el=.
** DONE [#C] Clean up Org keymap ownership and duplicate maps :cleanup:refactor:
CLOSED: [2026-05-10 Sun]
=org-config.el= creates =cj/org-map= under =cj/custom-keymap=, then later
creates a separate =cj/org-keymap= under =C-; O=. Other Org modules bind their
own global prefixes directly. This works with the current eager load order, but
it makes the intended owner of Org commands less clear.
Expected outcome:
- Pick one owner for the Org command prefix.
- Move module-specific menus under that owner or document why they remain
separate (=C-c n= for org-roam may be worth keeping).
- Avoid duplicate definitions for =C-; O= and =cj/org-map=.
- Coordinate with the broader custom keymap/load-order architecture task.
Verify 2026-05-10:
- Removed the duplicate =cj/org-keymap= and kept =cj/org-map= as the single
owner of =C-; O= through =cj/custom-keymap=.
- Kept =C-; O c= bound to =cj/org-clear-element-cache=, which handles all Org
buffers by default and only the current Org buffer with a prefix argument.
- Added =tests/test-org-config-keymap-ownership.el= and updated the existing
Org sort test to load newer source in the presence of ignored =.elc= files.
- Ran =make test-file FILE=test-org-config-keymap-ownership.el= and
=make test-file FILE=test-org-sort-by-todo-and-priority.el=.
** DONE [#A] Make repo reconciliation non-destructive by default :data:refactor:
CLOSED: [2026-05-10 Sun]
Before this refactor, =reconcile-open-repos.el= recursively scanned repos and,
for dirty repos, ran
=git stash --quiet=, =git pull --rebase --quiet=, and =git stash pop --quiet=
before opening Magit. That is high blast radius for a convenience command: stash
pop conflicts, untracked files, submodules, and worktrees can all create messy
states.
Verify 2026-05-10:
- Dirty repos now open Magit for review without running stash, pull, or stash
pop.
- Clean repos still pull with =git pull --rebase --quiet= via =process-file=.
- Git calls now use argv lists through =cj/reconcile--git=.
- Reconcile results distinguish =pulled=, =needs-review=, =skipped=,
=pull-failed=, and =status-failed=.
- Repo discovery prunes heavy/generated directories and stops at repo roots by
default.
- HTTP/HTTPS remote skipping is explicit and configurable via
=cj/reconcile-skipped-remote-regexp=.
- Ran all reconcile ERT files and byte-compiled =reconcile-open-repos.el=.
*** DONE [#A] Change dirty repo handling to review-first :bug:
Expected outcome:
- Clean repos may still pull automatically if desired.
- Dirty repos should open Magit or a review buffer before any stash/pull/pop.
- If an auto-reconcile mode is kept, require an explicit prefix argument or
separate command name.
- Update the current dirty-repo tests so they assert the new review-first
behavior instead of encoding =git stash= / =git pull= / =git stash pop= as the
desired path.
*** DONE [#A] Replace shell git calls with process helpers and parse statuses :refactor:
Expected outcome:
- Use =process-file= / =call-process= with argv lists.
- Capture stdout/stderr per repo for a final report.
- Distinguish clean, dirty, skipped, pull-failed, and needs-review states.
- Add tests with stubbed git command results.
*** DONE [#A] Prune expensive directories while discovering repos :refactor:
=cj/find-git-repos= recursively walks the configured project/code roots and
checks every directory for a nested =.git=. That can wander through
=node_modules=, =.venv=, =target=, vendored source, build output, and nested
dependency checkouts.
Expected outcome:
- Add a configurable prune list for heavy/generated directories.
- Stop descending once a repo root has been found unless explicitly requested.
- Add tests for nested repos and ignored heavy directories.
*** DONE [#A] Make remote skip policy explicit and configurable
=cj/reconcile--reference-clone-p= treats HTTP/HTTPS remotes as reference clones
and skips them. That may be right for this machine, but the behavior is encoded
as a naming mismatch and can skip ordinary repos.
Expected outcome:
- Rename the predicate to reflect the actual policy, or make the policy
configurable.
- Report skipped repos with the reason in the final reconcile output.
- Keep tests for SSH remotes, HTTP remotes, and local/file remotes.
** DONE [#B] ai-vterm: occasional wrong-edge replay after buffer-move dance :bug:
CLOSED: [2026-05-10 Sun]
Shipped 2026-05-09 in commit =26e9763= "fix(ai-vterm): harden F9 toggle across multi-window and buffer-move". The fix maps cardinal directions to frame-edge variants on replay (=right= → =rightmost=, =below= → =bottom=), switches captured units from frame-fractions to absolute body-cols / body-lines, wraps replay sizes in =(body-columns . N)= / =(body-lines . N)= cons forms so dividers don't shift the body, and uses =delete-window= (with =one-window-p= guard) instead of =quit-window= so buffer-moved windows don't leak. 7 regression tests added covering each scenario; 80 ai-vterm tests pass.
Surfaced 2026-05-09. After an extended sequence with both vterm and
ai-vterm visible, switching orientations, buffer-moving claude
between positions, and toggling each independently, claude
eventually replayed at the right side when its captured direction
should have been =below= (it had just been buffer-moved to the
bottom and toggled there).
The full sequence that hit it:
1. F9 to open claude (right side).
2. F12 to open vterm. M-S-t to flip vterm to right-side -- gives
dashboard | vterm | claude. Toggle each off/on; both behave.
3. F12 vterm off. M-S-t flips claude to left half. Toggle both
off/on; both behave.
4. Toggle both off. F12 vterm on. M-S-t flips vterm to bottom.
Toggle both on/off; both behave.
5. Buffer-move claude to the bottom.
6. Toggle claude there -- claude pops up at the right instead of
at the bottom.
** DONE [#B] Scope F12 (vterm-toggle) to non-claude vterm buffers, preserve user orientation :refactor:bug:
CLOSED: [2026-05-10 Sun]
Shipped 2026-05-09 in commit =554b32d= "feat(vterm): F12 toggle that excludes claude and preserves geometry". F12 now binds =cj/vterm-toggle= (replaces the =vterm-toggle= package binding). =cj/--vterm-toggle-buffer-p= excludes =claude [= prefixed buffers from the candidate set; =cj/--vterm-toggle-capture-state= records direction + body size at toggle-off; =cj/--vterm-toggle-display-saved= replays via =(body-columns . N)= / =(body-lines . N)= cons forms with cardinal direction mapped to frame-edge variant. Toggle-off uses =delete-window= (with =one-window-p= guard) so buffer-move scenarios don't leak ghost windows. The hard-coded =(window-height . 0.7)= override is gone — user-resized geometry persists. 19 new tests across buffer-filter, dispatch, and display.
F12 previously ran =vterm-toggle=, which picked the most-recent vterm buffer
as the toggle target. When that target was a =claude []= buffer (which
has its own F9/C-F9/M-F9 dispatch via =modules/ai-vterm.el=), F12 ended up
toggling Claude. The display-buffer rule in =modules/eshell-vterm-config.el=
already excluded =claude [= names from the bottom-window placement, but the
exclusion only governed /where/ a buffer landed once vterm-toggle had chosen
it -- not which buffer got chosen.
Two changes shipped:
1. *Filter claude buffers from vterm-toggle's target set* via
=cj/--vterm-toggle-buffer-p=, which ignores buffers whose names start with
"claude [".
2. *Respect user-modified window orientation.* Captured direction + body size
at toggle-off; replayed via =(body-columns . N)= / =(body-lines . N)= cons
forms. The hard-coded =(window-height . 0.7)= override is gone.
** DONE [#C] Move vterm-copy-mode binding off C-c C-t to the personal keymap :chore:quick:
CLOSED: [2026-05-10 Sun 02:02]
Default vterm binding is =C-c C-t=, which collides with the =C-c= space many modes
reach for and is awkward to hit when the terminal is the active buffer. Move it
to the personal keymap (=C-;= prefix) — pick a mnemonic letter (e.g. =C-; V c=
for "vterm copy") and unbind the default in =vterm-mode-map=. Update
=modules/eshell-vterm-config.el= alongside any related vterm bindings.
Implemented with a broader =C-; V= vterm menu, clickable URLs in vterm buffers,
=C-; V c= for raw =vterm-copy-mode=, and =C-; V C= for tmux-pane history
capture into a temporary Emacs buffer.
** DONE [#A] AI-Term-Related Improvements
*** DONE Check for widen/shorten buffer keys.
The keybinding you "thought you had" is =windsize= on =C-s-= (Ctrl+Super) — a tiling WM eats Ctrl+Super, which is why it didn't seem to exist. Shipped 2026-05-11 in commit =f837e5f= "feat(window): resize the split with C-; b ": =C-; b ///= moves the active window's divider that way (via =windsize=), then keeps =cj/window-resize-map= active so bare arrows keep nudging until any other key (or =C-g= / ==); =C-u N C-; b = resizes by N. The old =C-s-= bindings were dropped; =windsize= is now =:commands=-deferred with =windsize-cols=/=windsize-rows= at 2. =cj/window-resize-sticky= (in ui-navigation.el) dispatches on the arrow that triggered it and arms the loop. New ERT tests; all green.
*** DONE Evaluate this buffer should be in personal keybindings also.
=eval-buffer= is now on =C-; b e= (it already had =C-c b=). =e= had been =cj/view-email-in-buffer= and the requested fallback =C-; b m= is =cj/move-buffer-and-file=, so email-view moved to =C-; b E= (docstring + which-key updated too). All in =modules/custom-buffer-file.el=.
*** DONE Last ai-project used should be topmost in completing-read.
Shipped 2026-05-11 in commit =c14d6c8= "feat(ai-vterm): order the project picker by most-recently-used". The picker's active group (projects with a live tmux session) now leads with projects opened this session, most-recent first (=cj/--ai-vterm-mru=, pushed by =cj/--ai-vterm-show-or-create=), then the rest of the active group alpha, then the no-session group alpha. Bundled fix: =cj/--ai-vterm-tmux-session-name= now sanitizes =.= / =:= → =_= the way tmux does, so =.emacs.d= (real session =aiv-_emacs_d=) is correctly matched to its session and shows up in the active group (and crash-recovery reattaches instead of spawning a duplicate). New tests + updated tests; all green.
*** DONE Kill other window that leaves the split where it is.
Didn't exist (the closest, =cj/kill-other-window= on =M-S-o=, *deletes* the other window). Shipped 2026-05-11 in commit =0ddbcde= "feat(window): kill the other window's buffer with C-; b K": =cj/kill-other-window-buffer= (in undead-buffers.el, on =C-; b K=) kills or buries the buffer shown in the other window and leaves that window and the split alone — the window then shows whatever bury/kill surfaces next. Reuses =cj/kill-buffer-or-bury-alive= so =cj/undead-buffer-list= buffers (=*scratch*= etc.) are buried; with 3+ windows it acts on =next-window=; errors with "No other window" if there's only one. =M-S-o= / =cj/kill-other-window= kept as-is (different op). 4 new ERT tests; all green.
*** DONE Kill this buffer/window that leaves the split.
Yes — the command is =cj/kill-buffer-and-window= (in =modules/undead-buffers.el=), bound to =C-; b k= (keymap entry in =modules/custom-buffer-file.el=, under the "buffer and file menu"). It does =(delete-window)= on the current window unless it's the only one, then kills (or buries, for "undead" buffers like =*scratch*=) the buffer — so in a 3-column split, =C-; b k= in column 2 leaves columns 1 and 3 as a normal 2-column split. No code change needed.
Footnote on the =M-S-c= memory: =M-S-c= was Emacs's default =capitalize-word= and is now =time-zones= (=modules/chrono-tools.el=) — it was never this command. The =M-S-= window-killing family is =M-S-o= → =cj/kill-other-window= and =M-S-m= → =cj/kill-all-other-buffers-and-windows=.
*** DONE M-w shouldn't close the buffer or copy-mode
Shipped 2026-05-11 in commit =949bdeb= "feat(vterm): unify the keys in vterm copy-mode and tmux history". Both scrollback surfaces (=vterm-copy-mode= and the tmux-history buffer) now share one key story: =M-w= copies the active region and stays put (copy several things in a row); =C-g=, ==, or =q= leaves without copying; =RET= is unbound (no "copy and exit" — vterm's default =RET → vterm-copy-mode-done= binding removed). Dropped the now-dead =cj/vterm-tmux-history-copy-and-quit= (=M-w= then =q= is the equivalent). Also moved =cj/vterm-tmux-history= from =C-; x C= to =C-; x h= (unshifted, frees =C=) and refreshed the file's stale commentary header. Tests updated.
*** DONE cursor still orange after hitting return.
Shipped 2026-05-11 in commit =a70bb98= "fix(ui-config): use the writeable cursor color in a live vterm". Root cause: =vterm-mode= sets =buffer-read-only=, so the post-command cursor-color hook painted the cursor the read-only color (orange) any time point was in a vterm — copy-mode and the live terminal alike. Fix: a live vterm (=vterm-mode= and not =vterm-copy-mode=) now reports =unmodified= (white); =vterm-copy-mode= still reports =read-only= (orange), which Craig confirmed he wants. Extracted =cj/--buffer-cursor-state= for testability; 7 new ERT tests.
*** DONE open in other window question/issue
Shipped 2026-05-11 in commit =071fb5e= "feat(ai-vterm): keep emacsclient files out of the agent window". =server-start= left =server-window= nil, so =emacsclient -n= opened files in the selected window — which is the agent window when you're typing in it. Fix in ai-vterm.el: =server-window= now points at =cj/--ai-vterm-server-display=, which routes the file to a non-agent window (splitting one off the agent when it's the only window); emacsclient from anywhere else still goes through =pop-to-buffer=. Helper =cj/--ai-vterm-non-agent-window= picks the target (skips the minibuffer, dedicated windows, agent windows). 7 new ERT tests. Confirmed working — direction-agnostic, picks the "other" window whichever side the agent is on.
** DONE [#A] Optimize org-capture target building performance :perf:
CLOSED: [2026-05-11 Mon 13:05]
15-20 seconds every time capturing a task (12+ times/day).
Major daily bottleneck - minutes lost waiting, plus context switching cost.
Implemented 2026-05-11: cache validated =file+headline= target markers in
=org-capture-config.el= so repeated task captures into =Inbox= skip Org's
full-file headline scan. Added regression coverage in
=tests/test-org-capture-config-target-cache.el=.
** DONE [#A] Fix Slack reaction workflow (C-; S !) :bug:
CLOSED: [2026-05-11 Mon 14:08]
Reactions via ~C-; S !~ (~slack-message-add-reaction~) have two problems:
1. *Emoji picker only shows GitHub-style names* — without the ~emojify~ package,
~slack-select-emoji~ falls back to a flat ~completing-read~ over 1600+ names
fetched from GitHub's iamcal/emoji-data. Common names like ~thumbsup~ and ~pray~
are buried. A curated shortlist of common reactions would fix the UX.
2. *CRITICAL: post-command-hook bug traps user in Slack buffer* —
~slack-reaction-echo-description~ is added to ~post-command-hook~ (buffer-local)
in all Slack buffers. When the cursor lands on a reaction widget, it reads the
~reaction~ text property and calls ~slack-reaction-help-text~. If the reaction
EIEIO object is malformed, the error fires on *every keystroke*, making it
impossible to switch buffers, run M-x, or even C-g. The only escape is killing
Emacs externally (~pkill emacs~).
The fix must address this hook FIRST before any other reaction work.
Approach: advise ~slack-reaction-echo-description~ with ~condition-case~ to
silently catch errors, or remove it from ~post-command-hook~ entirely.
Relevant code in emacs-slack:
- ~slack-buffer.el:399~ — adds hook
- ~slack-buffer.el:374~ — ~slack-reaction-echo-description~ definition
- ~slack-reaction.el:72~ — ~slack-reaction-help-text~ method
Implemented 2026-05-11:
- Added a safe advice around ~slack-reaction-echo-description~. If malformed
reaction data errors from the buffer-local ~post-command-hook~, the hook is
removed for that buffer and a single message is shown instead of trapping
every keystroke.
- Rebound ~C-; S !~ to ~cj/slack-message-add-reaction~, which presents a short
common reaction list first and keeps an ~Other...~ fallback to upstream
~slack-message-reaction-input~.
- Added regression coverage in =tests/test-slack-config-reactions.el=.
*Discovered:* 2026-03-06
** DONE [#B] Coverage audit: untested and lightly-tested modules :tests:
CLOSED: [2026-05-11 Mon 14:38]
Snapshot of test-coverage gaps as of 2026-04-26. The existing [#A] "Continue coverage push" task already targets =keybindings.el=, =config-utilities.el=, =org-noter-config.el=, and =host-environment.el=; this entry catalogs the rest so future sessions have a working list.
*Methodology.* 102 modules in =modules/=, cross-referenced against =tests/= using fuzzy name matching (full module name, drop =-config=/=-setup= suffix, first hyphen segment). Categorized by likely test value.
*High-value untested (substantial logic, real test value):*
- =ai-conversations= — gptel persistence + autosave; 13 functions
- =quick-video-capture= — yt-dlp queue, org-protocol; 5 functions
- =dashboard-config= — custom commands (=cj/dashboard-only=, etc.)
- =external-open= — partially refactored; helpers covered, commands still bare
- =keyboard-compat= — terminal vs GUI Meta+Shift translation
- =help-config= and =help-utils= — interactive help and lookup commands
- =mail-config= — helpers (some covered via transcription tests; rest bare)
- =show-kill-ring= — kill-ring UI logic
- =system-commands= — shell command wrappers
- =ui-navigation= and =ui-theme= — navigation + theme switching
- =wrap-up= — init-finalize helpers
*Lightly covered (1–2 tests, likely many uncovered functions):*
- =modeline-config= (2 tests)
- =org-agenda-config= (2)
- =org-capture-config= (2)
- =org-reveal-config= (2)
- =transcription-config= (1) — helpers tested, start/stop loop bare
- =jumper= (1)
- =keyboard-macros= (1)
*Likely low-value (mostly use-package wrappers):*
About 28 modules are dominated by use-package + hooks + keybinds — testing them would mostly test Emacs/use-package itself. Examples: =auth-config=, =diff-config=, =dirvish-config=, =elfeed-config=, =erc-config=, =eww-config=, the =prog-*= language modules, etc. For each, review whether the file has any helper functions beyond use-package. If yes, write characterization tests. If not, document as "no unit tests appropriate" so the next audit skips it.
*Approach.* Pick 2–3 modules per session from the high-value list. Refactor-first if needed (split interactive wrapper from pure helper per =.claude/rules/elisp-testing.md=), then write Normal/Boundary/Error coverage. Re-run =cj/coverage-report= (F7, project scope) after each batch so progress is measurable.
*Cross-references:*
- 2026-04-22 session (not archived) — coverage v1 shipped, 59.6% baseline
- [[file:.claude/rules/elisp-testing.md][.claude/rules/elisp-testing.md]] — per-function test files, refactor-first, three required categories
*2026-05-11 refresh.* Re-ran =make coverage= after excluding timing-sensitive
=tests/test-lorem-optimum-benchmark.el= from coverage instrumentation. The
benchmark file still runs in normal test-file/unit flows, but Undercover slows
timing assertions enough to make it unsuitable for coverage. Low-coverage means
instrumented modules below 50% executable-line coverage, plus modules missing
from SimpleCov entirely. For missing modules, first decide whether the file has
testable project logic; if it is just use-package/keybinding glue, document it
as intentionally low-value instead of forcing brittle tests.
*** 2026-05-24 Sun @ 15:40 Refreshed against a clean make-coverage run
The per-module percentages previously listed here were stale. This session's test-writing covered most of the originally-listed modules: =prog-python= 0%→100%, =hugo-config= 17.7%→91.7%, =undead-buffers= 5.7%→85.7%, and =selection-framework=, =keyboard-compat=, =system-utils=, =system-defaults=, =ui-navigation=, =prog-go= now sit at ~100%. Re-measured against a clean =make coverage=; only modules genuinely below ~60% remain below as gaps, with current numbers. Modules in the 60-80% band (e.g. =calendar-sync= 76%, =music-config= 77%, =ai-conversations= 74%, =calibredb-epub-config= 73%, =org-noter-config= 73%, =custom-misc= 72%, =test-runner= 72%) are adequately covered and dropped from the backlog. Several remaining low entries are low only because the uncovered lines are use-package / interactive / process glue, not untested logic — flagged inline.
*** 2026-05-24 Sun @ 15:45 Assessed the sub-60% cluster; filled the real gaps, closed the rest
Read each sub-60% module to separate genuine untested logic from interactive/config glue.
Filled (new tests):
- =markdown-config.el= — =cj/markdown-html= (buffer → strapdown HTML) now tested (normal + empty buffer). Preview/server commands stay interactive-only. Commit =c6a81743=.
- =media-utils.el= — =cj/select-media-player= now tested (choice sets default; non-match leaves it). Commit =c6a81743=.
- =elfeed-config.el= — =cj/extract-stream-url= + =cj/elfeed-process-entries= covered earlier this session (32%→66%). Commit =35fa6297=.
Assessed already-covered (pure logic tested; remaining % is interactive only — no action):
- =flyspell-and-abbrev.el= — =cj/find-previous-flyspell-overlay= and =cj/--require-spell-checker= already have Normal/Boundary/Error tests; the rest is interactive (toggle, goto-previous, then-abbrev).
- =dashboard-config.el= — navigator builders + launcher binding already tested; the rest is =cj/dashboard-only= (interactive redisplay).
- =ai-quick-ask.el= — =--initial-text=, =--extract-response=, =--seed-text= already tested; the rest is the interactive ask/dismiss/continue flow.
- =prog-general.el= (10%) and =restclient-config.el= (50%) — LSP/use-package config and interactive new-buffer/open-file; no pure logic to cover.
- =vc-config.el= (7.9%) and =quick-video-capture.el= (50%) — pure logic already tested (git-clone path derivation; video URL dynamic-binding + capture-template registration); uncovered lines are magit/difftastic/git-timemachine config and interactive toggles.
Net: the coverage backlog is cleared — every module's testable logic is covered; the residual low percentages are interactive/config/process code that the testing rules say not to chase.
** DONE [#B] Review all config and pull library functions into system-lib file :refactor:
Superseded by =PROJECT [#B] Consolidate shared utility helpers= (the structured version of this, with =docs/specs/utility-consolidation-spec-doing.org= as the spec and =docs/design/utility-inventory.org= as the config-wide audit -- 30 candidate helpers across all modules, decided 11 Migrate / 3 Leave / 13 Defer). The system-lib extractions shipped 2026-05-10: =c75e36f= (=cj/executable-find-or-warn= from mail-config), =f1e8f08= (=cj/shell-quote-argument-readable= from dev-fkeys), =57e558c= (=cj/process-output-or-error= + =cj/git-output-or-error= from coverage-core), =aa72245= (=cj/file-from-context= from system-utils), plus the earlier =8e8152e= (=cj/log-silently=) -- each with its own test file. The rest of the 11 Migrate items landed as new =-lib.el= modules in the same marathon (=cj-cache-lib.el=, =cj-org-text-lib.el=, =external-open-lib.el=, =cj-window-geometry-lib.el=, =cj-window-toggle-lib.el=). The 13 deferred candidates remain tracked under the Consolidate-shared-utility-helpers PROJECT, not here.
** DONE [#C] Clean up calibredb-epub-config.el :refactor:bug:
CLOSED: [2026-05-11 Mon 14:55]
1. *Remove ~:defer 1~ from calibredb use-package* — loads calibredb 1 second after
startup even though ~:commands~ and ~:bind~ already handle lazy loading. Free
startup time.
2. *Double rendering on EPUB open* — ~cj/nov-apply-preferences~ calls
~(nov-render-document)~ explicitly, but it runs as a ~nov-mode~ hook which fires
after nov already renders. Every EPUB open renders twice.
3. *visual-fill-column-width doesn't adapt on resize* — calculated once at open
time based on window size. Resizing or splitting the window won't recalculate
text width. Consider hooking ~window-size-change-functions~ or
~window-configuration-change-hook~.
4. *~calibredb-search-page-max-rows 20000~* — effectively disables pagination.
Could slow down the search buffer if library grows large. Monitor or lower.
5. *Anonymous lambda for zathura keybinding* — ~("z" . (lambda ...))~ won't show
a name in which-key or describe-key. Replace with a named function.
*File:* modules/calibredb-epub-config.el
Implemented 2026-05-11: removed the timed calibredb load, removed the explicit
=nov-render-document= call from the =nov-mode= hook to avoid double rendering,
made Nov text width recalculate after window configuration changes, lowered
=calibredb-search-page-max-rows= from 20000 to 500, and replaced the anonymous
zathura binding with =cj/nov-open-external=. Added focused helper coverage in
=tests/test-calibredb-epub-config.el= for the adaptive width calculation and
named external-open command.
** DONE [#C] Update email setup script for the work account :chore:
CLOSED: [2026-05-11 Mon 14:21]
Follow-up to the deepsat mu4e work shipped 2026-04-27. The mu4e config (=modules/mail-config.el=), =.mbsyncrc=, =.msmtprc=, and the encrypted password file (=.config/.dmailpass.gpg=) all gained a third account. There is an "email setup script" (per Craig's mention while wrapping up that work) that needs the equivalent updates so a fresh machine bootstraps with all three accounts. Craig will name the specific script when picking this up.
Likely shape:
- Wherever the script writes / templates =.mbsyncrc=, add the dmail block (5-channel layout, mirroring the gmail block).
- Wherever it writes =.msmtprc=, add the dmail SMTP account (passwordeval against =~/.config/.dmailpass.gpg=).
- Ensure the encrypted password file exists or is sourced correctly during setup.
Implemented 2026-05-11: updated =scripts/setup-email.sh= so the setup flow
handles the deepsat/dmail account alongside gmail and cmail. The script now
creates =~/.mail/dmail=, passes =craig.jennings@deepsat.com= to =mu init=,
and installs/validates =~/.config/.dmailpass.gpg= using the same encrypted-file
pattern as gmail. While there, the credential bootstrap was made explicit:
gmail and dmail keep encrypted =.gpg= files because mbsync/msmtp decrypt them at
use time, while cmail is decrypted to the plaintext ProtonBridge password file.
** DONE [#C] Stand up packaging CI for personal Elisp packages :ci:feature:
CLOSED: [2026-05-11 Mon 14:08]
Get =chime=, =org-msg=, and =wttrin= covered by automated package-quality checks. Three pieces, all aimed at the same set of repos, so tracked together:
1. *melpazoid* — MELPA-submission validator. Run against each package; gives a pre-submission checklist so packages don't bounce on basics.
2. *package-lint* — elisp-specific package linter. Catches header issues, autoload problems, version-spec drift. Can be run locally as part of =make lint= and in CI.
3. *elisp-check GitHub Action* — zero-config CI workflow that wraps the above plus byte-compile and basic tests. One =.github/workflows/elisp.yml= per package.
Order of execution: package-lint first (most actionable, fastest feedback), then elisp-check (CI wiring), then melpazoid (heavier; only matters if/when submitting to MELPA).
** DONE [#D] Optimize lorem-optimum performance and liber-primus.txt size :perf:
CLOSED: [2026-05-11 Mon 14:17]
Lorem-optimum text generation is generally slow but doesn't completely break workflow.
Two benchmark tests were disabled (marked :slow) because they take MINUTES instead of seconds.
**Current State:**
- Tests disabled to unblock test suite (DONE 2025-11-09)
- Performance is acceptable for daily use, but could be better
- liber-primus.txt may be too large for optimal performance
**Investigation:**
1. Profile lorem-optimum to find bottlenecks
2. Check if liber-primus.txt size needs optimization
3. Optimize performance to get tests under 5 seconds
4. Re-enable benchmark tests once performance is acceptable
**Related Files:**
- modules/lorem-optimum.el (needs profiling and optimization)
- tests/test-lorem-optimum-benchmark.el (tests disabled with :tags '(:slow))
- liber-primus.txt (corpus file, may need size optimization)
Implemented 2026-05-11: optimized generation hotspots in =modules/lorem-optimum.el=
by avoiding repeated string/list appends, caching random Markov keys as a vector,
and hardening title generation while preserving empty-chain behavior. Re-enabled
the benchmark tests in =tests/test-lorem-optimum-benchmark.el= by removing their
=:slow= tags and added a title-generation regression test in
=tests/test-lorem-optimum.el=. Checked =assets/liber-primus.txt= directly; it is
36,475 bytes / 5,374 words, so no corpus shrink was needed. The benchmark file
now runs all 10 tests in under one second, with 100K-word learning measured under
200 ms on this machine.
** DONE [#D] Migrate lsp-eldoc-hook to eldoc-documentation-functions :chore:quick:
CLOSED: [2026-05-11 Mon 14:12]
=modules/prog-lsp.el:68= sets =lsp-eldoc-hook= to nil. Byte-compile flags it as obsolete since lsp-mode 9.0.0; replacement is =eldoc-documentation-functions=. Find the lsp-mode-supplied entry there and remove it (or set the variable buffer-locally per the new API). Discovered 2026-04-26 during refactor audit on the file-watch-ignored-extras change.
Implemented 2026-05-11: replaced the obsolete =lsp-eldoc-hook= assignment with
=cj/lsp--disable-eldoc-hover=, installed from =lsp-managed-mode-hook=. The helper
removes =lsp-eldoc-function= from buffer-local
=eldoc-documentation-functions= after lsp-mode adds it. Covered in
=tests/test-prog-lsp--add-file-watch-ignored-extras.el=.
** DONE [#B] Simplify mail attachment save workflow :feature:
Saving attachments out of mu4e is currently a multi-step dance via =mu4e-view-save-attachments= + embark + vertico. The flow documented in =modules/mail-config.el:10-17= goes:
#+begin_quote
After running =mu4e-view-save-attachments=:
- invoke =embark-act-all= in the completion menu, then RET to save all
- OR TAB (=vertico-insert=), comma each file to mark, RET to save selected
#+end_quote
That's four keystrokes for "save all to default dir" and N+2 for "save the one I want." Both common cases should be one keystroke.
Proposed shape:
- =cj/mu4e-save-all-attachments= → save every attachment in current message to a sensible default dir (=~/Downloads/= or per-thread). One keystroke.
- =cj/mu4e-save-attachment-here= → completing-read on attachment names; save selected one. One keystroke + selection.
- Bind both under =C-; e= (the existing email map already has =a= and =d= for attach/delete in compose).
Open question: should the "save all" target be a fixed dir, prompt every time, or use the directory of an associated org-noter / project context? Flagged for design decision when this lands.
Decision: save all should prompt every time.
*Files:* =modules/mail-config.el= (add helpers, wire into mu4e-view-actions and the =C-; e= keymap).
Implemented 2026-05-11: added direct mu4e view attachment save commands in
=modules/mail-config.el=. =cj/mu4e-save-all-attachments= prompts once for a
directory and saves every attachment-like MIME part. =cj/mu4e-save-attachment-here=
prompts for a directory, then uses =completing-read= to save one attachment.
Both reuse mu4e's MIME part metadata, uniquify hook, path joiner, and
=mm-save-part-to-file= save primitive instead of driving the existing
multi-select completion UI. Duplicate filenames are disambiguated by part index.
Bound under =C-; e S= and =C-; e s= with which-key labels. Covered by
=tests/test-mail-config-attachments.el=.
Extended 2026-05-11: added =cj/mu4e-save-some-attachments= on =C-; e m=. It
prompts for the destination directory, opens a dedicated =*mu4e attachments*=
selection buffer, and lets the user mark rows with RET, mark all with =a=,
unmark all with =u=, save marked with =s=, and quit with =q=. The selection
buffer shows labels, MIME types, and approximate sizes while reusing the same
attachment save helpers.
Committed and pushed 2026-05-11 as =1aa8d0f= "feat(mu4e): simpler attachment-save commands on C-; e S/s/m"; 18 ERT tests in =tests/test-mail-config-attachments.el=. (Two small UX follow-ups — `entry-at-point' user-error outside a row, and clearing marks / auto-quit after save — are tracked under "Post-batch review follow-ups (2026-05-11)".)
** DONE [#B] EPUB text renders full-width: visual-fill-column margins not applied in nov-mode :bug:
*** Resolved 2026-05-12
Fixed in =b7c6b2c= "fix(nov): center the EPUB text by setting window margins directly" -- took the "preferred" plan below: `nov-text-width' is now a column count (~80% of the window's natural width) so nov's `shr' fills the text itself, and `cj/nov-update-layout' centers the block with `set-window-margins' directly (plus `set-window-fringes ... t' to push the fringes off the reading area). `visual-fill-column' is dropped from nov entirely -- its margin-setting still mysteriously never applied, but that's moot now. `+'/`=' / `-'/`_' re-flow and re-center; a buffer-local `kill-buffer-hook' resets the margins/fringes. The text-width math factored into `cj/nov--natural-window-width' + `cj/nov--text-width'. Remaining nit: see "EPUB text is slightly left-of-center" below.
*** Problem
Opening an EPUB renders the text filling 100% of the window width, not the configured ~80%. =modules/calibredb-epub-config.el=, =cj/nov-apply-preferences= (on =nov-mode-hook=).
Before the 2026-05-12 work it was the opposite — a too-narrow ~third-of-the-window strip — caused by a feedback loop (=cj/nov--text-width-for-window= computed from =window-body-width=, which is post-margin, so each =cj/nov-update-layout= pass shaved the column by another margin fraction, bottoming out at =cj/nov-min-text-width= = 40). Commit =1c5c8bd= "fix(nov): rework the EPUB reading-width layout" fixed the loop (width now computed from the window's *natural* column count, idempotent) and split out a pure =cj/nov--text-width= helper with a regression test; =4d9a206= set the default =cj/nov-margin-percent= to 10 (= 80% text); both also re-added =b3b537f='s =(nov-render-document)= for the cold open, made =cj/nov-update-layout= a command, and bound =+= / === / =-= / =_= in =nov-mode-map= to adjust the width live (clamp 0..25, i.e. text 50%..100%). The *width computation* and the *loop* are fixed. The *margin application* is not — hence 100%.
*** Why 100% specifically
=cj/nov-apply-preferences= sets =(setq-local nov-text-width t)=. With =nov-text-width= = t, =nov-render-html= renders the text *unfilled* — it swaps =shr-fill-line= for =nov-fill-line=, which only indents, never wraps — so the buffer holds one long logical line per paragraph, and =visual-line-mode= is relied on to wrap it visually at the window's *text-area* width. =cj/nov-update-layout= is supposed to narrow that text area by turning on =visual-fill-column-mode= with =visual-fill-column-width= set to ~80% of the window's columns and letting =visual-fill-column--adjust-window= set the left/right *window display margins*. The margins never get set, so the text area stays the full window width → text wraps at 100%.
*** Diagnostics captured (Craig's running Emacs, in the EPUB buffer, 2026-05-12)
=M-: (list :margin cj/nov-margin-percent :body-w (window-body-width) :vfc-w visual-fill-column-width :vfc-mode (bound-and-true-p visual-fill-column-mode) :vfc-feat (featurep 'visual-fill-column) :wmargins (window-margins) :ntw nov-text-width)= →
=(:margin 10 :body-w 152 :vfc-w 121 :vfc-mode t :vfc-feat t :wmargins (nil . nil) :ntw t)=
So: the new code IS loaded (=cj/nov-margin-percent= 10), =visual-fill-column= IS loaded, =visual-fill-column-mode= IS on, =visual-fill-column-width= IS correct (121 = 80% of 152) — but =(window-margins)= is =(nil . nil)=. =M-x cj/nov-update-layout= (which calls =visual-fill-column--adjust-window=) does NOT change it; =M-: (condition-case e (progn (cj/nov-update-layout) (window-margins)) (error e))= → =(nil . nil)= (no error caught, margins still nil). So =visual-fill-column='s margin-setting path (=visual-fill-column--adjust-window= → =visual-fill-column--set-margins= → =set-window-margins=) is not landing in nov-mode buffers.
*** Why it doesn't apply — UNKNOWN
Code-reading =visual-fill-column-2.7.0= didn't pin it down. =visual-fill-column--adjust-window= does =(with-selected-window window (visual-fill-column--reset-window window) (when visual-fill-column-mode (... (visual-fill-column--set-margins window))))=. For the result to be =(nil . nil)=, either =--set-margins= isn't reached (the =(when visual-fill-column-mode ...)= check is false in whatever buffer =with-selected-window= makes current) or it computed left=right=0 (=set-window-margins window 0 0= → =(window-margins)= = =(nil . nil)=). =--set-margins= computes 0/0 only when =total-width= (≈ window-width) ≤ =visual-fill-column-width= (121) — and window-width is 152, so it shouldn't. Candidate causes not yet ruled out: (a) the =default= face is remapped to "Merriweather" :height 180 in nov buffers (via =face-remap-add-relative= in =cj/nov-apply-preferences=), and =set-window-margins='s units (canonical frame-font columns) vs. the remapped 18pt buffer columns may be confusing the column math; (b) =--adjust-window= being invoked on the wrong window (it defaults to =(selected-window)=, not the EPUB's window — relevant when nov-mode-hook runs before =find-file= switches the window, and possibly later); (c) a =visual-fill-column= 2.7.0 / Emacs 30 regression with =nov-fill-line=-style rendering; (d) something resetting the margins after they're set.
*** Plan forward — preferred: stop delegating the width to visual-fill-column
Set =nov-text-width= to a *computed integer* instead of =t=, so nov's =shr= fills the rendered text to that width itself — no dependence on =visual-fill-column='s window margins working at all. =visual-fill-column= then only *centers* the already-narrow block (if it works; if it still doesn't, the text is left-aligned at ~80%, which is acceptable). Specifically:
- =cj/nov-apply-preferences=: =(setq-local nov-text-width (cj/nov--text-width-for-window))= (integer) instead of =t=.
- =cj/nov-update-layout=: recompute and =setq-local= both =nov-text-width= and =visual-fill-column-width=, then call =(nov-render-document)= so =shr= re-flows the text at the new width (currently it only re-sets the vfc width). Still keep the =visual-fill-column-mode= + =--adjust-window= calls for centering.
- =+= / =-= keep working: they adjust =cj/nov-margin-percent= then call =cj/nov-update-layout=, which now re-renders.
- =cj/nov-min-text-width= (40) stays the absolute column floor.
TDD test-first. Touches =modules/calibredb-epub-config.el= + =tests/test-calibredb-epub-config.el=. ~25 lines.
*** Alternatives considered
(1) Keep =nov-text-width= = t + =visual-fill-column= and keep poking at *why* the margins don't apply — needs more in-Emacs diagnostics (e.g. trace =visual-fill-column--set-margins=, check =(window-margins)= right after =(set-window-margins win 15 16)=, check whether a stray window param clamps it). Higher uncertainty.
(2) Left-align at the computed width with no centering at all (drop =visual-fill-column= from nov entirely) — simpler, but loses the centered look Craig wanted.
Preferred is the =nov-text-width=-as-integer approach because it's robust regardless of what =visual-fill-column= does.
** DONE [#B] Post-batch review follow-ups (2026-05-11) :refactor:tests:
Minor items found while reviewing the 2026-05-11 commit batch (a70bb98..2b88c6a). The major fix (org-capture cache-key consistency) and the coverage gaps were already handled in commits =fc94e5b= / =e0e0ecd= / =2b88c6a=; these are the leftovers.
*** DONE [#B] Give the benchmarks a real home (`make benchmark' or `:tags '(:perf)') :tests:perf:
The 2026-05-11 lorem-optimum perf work (=7f353e9=) dropped the `:slow' tags from the benchmark tests so they run in every `make test', and one (`benchmark-learn-100k-words') gained an absolute wall-clock threshold (`(should (< time 5000.0))'). Then =1f4c692= excluded `test-lorem-optimum-benchmark.el' from `make coverage' because undercover's instrumentation breaks those thresholds. That's a fragmented policy and the thresholds are machine-dependent (a slower CI runner or older laptop could blow 5s). Pick one: (a) restore `:tags '(:perf)' on the benchmark tests and add a `make benchmark' target that runs them, or (b) replace the absolute thresholds with relative checks ("100K is no more than ~20x slower than 10K") that catch O(N^2) regressions without depending on the machine. Either way `make test' should stop running absolute-time benchmarks by default.
*** DONE [#B] Verify Nov EPUB renders at the right width on first open :bug:
There WAS a regression, deeper than =b3b537f=: `cj/nov--text-width-for-window' computed the column from `window-body-width' (post-margin), so `cj/nov-update-layout' (on `window-configuration-change-hook') shrank the column on every pass — a feedback loop bottoming out at `cj/nov-min-text-width' (40 cols) regardless of `cj/nov-margin-percent'. Fixed 2026-05-12 in =1c5c8bd= "fix(nov): rework the EPUB reading-width layout": width now from the window's natural column count (idempotent), pure `cj/nov--text-width' helper + regression test, `cj/nov-margin-percent' default 12 (~76% text), `b3b537f's `(nov-render-document)' re-added for the cold open, `cj/nov-update-layout' made a command, and `+'/`='/`-'/`_' added in `nov-mode-map' to adjust the width live (50%..100%). Visual confirm in real Emacs still pending Craig's restart.
*** DONE [#B] Surface `cj/slack-message-add-reaction' errors outside a Slack buffer :ux:
`cj/slack-message-add-reaction' (C-; S !, added in =bbd1b73=) silently no-ops when `slack-current-buffer' is nil — e.g. if the binding fires outside a Slack buffer. The `when-let*' chain just bails with no feedback. Add a `user-error "Not in a Slack buffer"' (and the same for `slack-buffer-team' returning nil) so the misuse surfaces instead of being swallowed.
*** DONE [#B] Rename `cj/lsp--disable-eldoc-hover' to `cj/lsp--remove-eldoc-provider' :refactor:
The function (added in =96d5d6a=) removes one specific provider — `lsp-eldoc-function' — from the buffer-local `eldoc-documentation-functions'. If lsp-mode ever adds another eldoc provider, the current function wouldn't catch it; the name promises more than it does. Rename to match what it actually does and update the `add-hook' callsite + the regression test.
*** DONE [#B] Add `bats' test infra and cover `scripts/setup-email.sh' helpers :tests:
The 2026-05-11 email-setup work (=eddc103=) added `install_encrypted_password' and `decrypt_password' — cleanly factored (filenames in, file-or-`exit 1' out) but untested, since the repo has no shell-test infrastructure. With a temp `$PASSWORD_DEST_DIR' and mocked `gpg'/`cp', they'd test cleanly. Add `bats' (or pick an alternative), wire a `make test-shell' target, and cover the two helpers plus the dest-exists-skip and missing-source-fails paths.
*** DONE [#B] Split the mu4e attachment workflow out of `mail-config.el' :refactor:
The 2026-05-11 mu4e attachment commit (=1aa8d0f=) added ~247 lines to `mail-config.el' for a self-contained attachment-save UI (helpers + three commands + a `special-mode'-derived selection buffer). None of it depends on the rest of `mail-config'. As that file grows, moving this into `modules/mu4e-attachments.el' (or `mail-attachments-lib.el', matching the `-lib.el' convention) would keep both files easier to read. The seam is clean.
*** DONE [#B] Clear marks (or auto-quit) after `cj/mu4e-attachment-selection-save-marked' :ux:
After saving the marked attachments, the `*mu4e attachments*' buffer (=1aa8d0f=) stays open with the same marks intact — pressing `s' again re-saves the same set silently. Decide what the workflow wants: auto-`quit-window' after a successful save, or clear the marks and stay so the user can save another batch. Right now it does neither.
** DONE [#D] Create print function for dirvish bound to uppercase P :feature:
Add a print function that works on printable files (PDF, txt, org, etc.) and bind it to uppercase P in dirvish-mode. Should detect file type and use appropriate print command (lpr for text files, print dialog for PDFs, etc.).
** DONE [#D] Collapse the duplicated per-file test loop in the Makefile :chore:
=test-unit=, =test-integration=, and =coverage= each carry a near-identical ~40-line shell loop (run each file in its own Emacs, count passes, collect failures, print a summary box). The three drifted once already (the =:perf= tag filter had to be added in three places). Extract a single =define=d shell function or a helper recipe parametrized by test list + extra =-l= args + label, and have the three targets call it. Cosmetic — the Makefile works — so low priority. Noticed 2026-05-12 while adding =make benchmark=.
** DONE [#A] Add Telegram Messaging
https://github.com/zevlg/telega.el
Make sure there is a setup script to run, so that the docker container can be installed post emacs dotfiles repository clone on a fresh install
also, let's add an icon to the dashboard for this. perhaps this is the beginning of the third row? If so, add a child task to review and balance the dashboard icons
Shipped this session:
- =modules/telega-config.el= -- =use-package telega= with
=telega-use-docker t=; launcher on =C-; G= (=C-; t= and =C-; m t=
were both taken).
- Dashboard Row 3 added with the Telegram icon; dashboard-mode-map =g=
key launches =telega=.
- =scripts/setup-telega.sh= -- verifies docker presence + daemon
reachability; pulls =$TELEGA_DOCKER_IMAGE= when set, otherwise
announces =M-x telega-server-build= for the in-Emacs build path.
7 bats tests in =tests/test-setup-telega.bats= (docker stubbed).
- Auth (phone + verification code) is interactive on first =M-x telega=
-- not scripted.
*** DONE [#A] Add =scripts/setup-telega.sh= for TDLib docker container :feature:
Pull or build the telega TDLib container so a fresh-clone install can
run telega without a system-wide TDLib build. Mirror the
=scripts/setup-email.sh= pattern: =main()= wrapped in a
=BASH_SOURCE == 0= guard so the script is sourceable for bats tests;
bats test file =tests/test-setup-telega.bats= with =docker= stubbed.
*** DONE [#A] Review and balance dashboard icon layout :refactor:
CLOSED: [2026-05-14 Thu]
Adding the Telegram icon started a third row that has only one entry.
Decide whether to (a) leave it asymmetric and let the row fill in as
new launchers arrive, (b) move an existing icon down to balance 5/5/2
or similar, or (c) reorganize by category (work / read / chat / play).
Picked (c) -- the categories actually exist and a 4/4/4 grid
balances cleanly:
- Row 1 Work: Code / Files / Terminal / Agenda
- Row 2 Read & Learn: Feeds / Books / Flashcards / Music
- Row 3 Communication: Email / IRC / Slack / Telegram
Drive-by fix in the same commit: Music had an icon but no
`dashboard-mode-map' keybinding, so the visual launcher couldn't be
fired without the mouse. Added =m=. Reordered the existing
`define-key' calls to mirror the row layout so reading the keymap
top-to-bottom matches the icons left-to-right.
Surfaced when Telegram landed in Row 3 alone.
** DONE [#B] Add VERIFY and DOING blocks to the main agenda view :feature:
The main agenda "d" command (=cj/main-agenda-display=, F8) currently
renders four blocks: OVERDUE -> HIGH PRIORITY UNRESOLVED -> SCHEDULE
-> PRIORITY B. Insert two new blocks around SCHEDULE so a glance at
the daily view also surfaces what's in flight and what's waiting on a
manual check:
- Above SCHEDULE: all tasks with TODO state VERIFY (header:
=VERIFICATION=).
- Below SCHEDULE: all tasks with TODO state DOING (header:
=IN-PROGRESS=).
Resulting block order:
OVERDUE -> HIGH PRIORITY -> *VERIFICATION* -> SCHEDULE -> *IN-PROGRESS* -> PRIORITY B
Decisions:
- *Scope*: same as the other blocks -- every entry in
=org-agenda-files=, no per-project filter.
- *Scheduled / deadlined entries*: included. A VERIFY task with a
scheduled date for today appears in both the VERIFICATION block and
the SCHEDULE block. Mirrors the HIGH PRIORITY block's behavior.
- *Habit / PROJECT skips*: skip habits via
=cj/org-skip-subtree-if-habit=. Don't skip PROJECT-keyword entries
(the =(todo "VERIFY")= and =(todo "DOING")= match is keyword-exact
so PROJECT parents wouldn't appear anyway, and a PROJECT in VERIFY
state would be deliberate).
Implementation locations:
- =modules/org-agenda-config.el= -- two new entries inside
=org-agenda-custom-commands= "d" block, each a =(todo "STATE" ...)=
with =org-agenda-overriding-header=, the shared
=cj/--main-agenda-prefix-format=, and the habit skip-function.
- =modules/org-agenda-config.el= -- two header defvars
(=cj/main-agenda-verify-title= / =cj/main-agenda-doing-title=) for
symmetry with =cj/main-agenda-overdue-title= etc.
Regression coverage:
- Extend =tests/test-org-agenda-config-skip-functions.el= with
structural assertions: the "d" command has six blocks in the
expected order, the new VERIFICATION / IN-PROGRESS blocks reference
the shared prefix-format symbol, carry the right
=org-agenda-overriding-header=, and run the habit skip.
** DONE [#A] Org Agenda fixes :bug:
*** 2026-05-13 Wed @ 13:05:21 -0500 Skip CANCELLED entries from main agenda SCHEDULE
see the following screenshot
/home/cjennings/pictures/screenshots/2026-05-13_071428.png
Fix shipped on main: commit =8e57950=. Added an org-agenda-skip-function
to the SCHEDULE block of the "d" command in =org-agenda-custom-commands=
that filters entries with TODO state CANCELLED. Scope is deliberately
narrow -- DONE and FAILED scheduled tasks still render.
Tests in =tests/test-org-agenda-config-skip-functions.el= (Normal +
Boundary) lock in the configuration form on the agenda block and
verify the other blocks aren't accidentally carrying the same skip.
*** DONE [#A] Refactor: extract org-agenda-prefix-format literal :refactor:
=modules/org-agenda-config.el= currently inlines =" %i %-15:c%?-15t% s"=
across four blocks of =org-agenda-custom-commands= (overdue, hi-pri,
schedule, priority-B). Extract into a defvar (e.g.
=cj/--main-agenda-prefix-format=) and reference it from each block.
Surfaced during the audit for the CANCELLED-schedule fix.
Fix: new =cj/--main-agenda-prefix-format= defvar in
=modules/org-agenda-config.el=; all four blocks of the "d" command now
reference the symbol instead of inlining the literal. Regression test
in =tests/test-org-agenda-config-skip-functions.el= walks the blocks
and asserts each =org-agenda-prefix-format= entry resolves to the
shared symbol -- so a future tweak to one block can't silently diverge
from the others.
*** 2026-05-13 Wed @ 13:27:39 -0500 Clear dedicated before toggling window split
Reproduction steps
- open an org file (I was using this projects's todo.org file
- hit the f8 button to open the agenda view. it opens fine.
- toggle-window-split
>>> The agenda displays on both panes after the toggle.
see snapshot below
/home/cjennings/pictures/screenshots/2026-05-13_071603.png
Fix shipped on main: commit =97f0f8e=. Root cause was the dedicated
=*Org Agenda*= window (set via =display-buffer-alist= rule) rejecting
the internal =set-window-buffer= swap. The non-dedicated buffer never
crossed and both panes ended up showing the agenda.
=modules/ui-navigation.el= now clears dedicated on both windows at the
top of =toggle-window-split= before the swap. The toggle is an
explicit layout change, so preserving per-window dedicated through it
would just re-trigger the same wedge on the next invocation.
Tests in =tests/test-ui-navigation--toggle-window-split.el= (5 tests,
Normal + Boundary) cover the no-dedicated baseline, the bug-trigger,
post-toggle cleared state, and the 1-window / 3-window no-op cases.
Verified red against the unfixed code (the bug-trigger test errored
=Window is dedicated to '*test-toggle-b*'=) before applying the fix.
Live verification pending: =M-x load-file modules/ui-navigation.el=,
then walk through F8 + M-S-t in a fresh session.
*** DONE [#A] Enhancement: replace todo indicators with project name
In the overdue section, the high priority section, and the priority B section, each of the entries has a todo: indicator, which is the name of the file.
This is not useful. Based on how I'm using emacs, every entry is likely to come from a file named todo.org.
A much preferrable option would be to have the project's name there instead.
so, for instance this todo.org file would show "emacs.d" as the project name in place of todo.
see snapshot below for an example of the current state.
/home/cjennings/pictures/screenshots/2026-05-13_071840.png
Fix: =cj/--org-todo-category-from-file= +
=cj/--org-set-todo-category= in =modules/org-agenda-config.el=
hook =org-category= buffer-locally to the parent directory's
basename (with a single leading dot stripped, so =.emacs.d= reads
as =emacs.d=) whenever a todo.org file opens. Explicit
=#+CATEGORY:= still wins. 14 tests in
=tests/test-org-agenda-config-category.el= cover normal /
boundary / error paths; full =make test-unit= green.
** DONE [#A] Save journal buffer after marking a task DONE :bug:
CLOSED: [2026-05-14 Thu]
When a task transitions to a done state, =cj/org-roam-copy-todo-to-today=
in =modules/org-roam-config.el= refiles a copy of the heading into the
day's roam journal (creating the file if missing) -- example:
=/home/cjennings/sync/org/roam/journal/2026-05-14.org=. The journal
buffer is left modified-but-unsaved, so closing Emacs always prompts
about open unsaved buffers with no obvious source.
Function intends to save via two routes:
- =org-after-refile-insert-hook= let-bound to =#'save-buffer= -- a
single-function value rather than a list. =run-hooks= calls a bare
function value, so this should fire, but verify it does in the
capture+refile context (and that it runs in the target buffer, not
the source).
- The =:config= block of =use-package org-refile= advises =org-refile=
=:after= with =org-save-all-org-buffers=. That only runs once
=org-refile= is loaded; if the DONE transition fires before
org-refile's =:defer .5= elapses, the advice isn't attached yet.
Fix candidates:
- Drop the let-binding and call =(save-buffer)= explicitly in the
target buffer after the =org-refile= call, before
=save-window-excursion= unwinds. Deterministic, doesn't depend on
hook timing.
- Or eager-load =org-refile= so the =:after= advice attaches before any
DONE transition can fire.
Test: mark a TODO done from a non-journal buffer, then check
=buffer-modified-p= on the dated journal buffer. Should be nil.
** DONE [#B] Extend dired/dirvish =T= to transcribe videos, not just audio :feature:
CLOSED: [2026-05-14 Thu]
Today =T= on an audio file in dired/dirvish triggers
=cj/transcribe-audio-at-point= and only accepts files matching
=cj/audio-file-extensions= (=cj/--audio-file-p= rejects anything
else with a =user-error=). Want the same one-key flow on video
files -- so a =.mp4= or =.mkv= recording can be transcribed without
hand-extracting the audio track first.
Likely shape:
- New =cj/video-file-extensions= in user-constants.el (mp4, mkv,
mov, webm, avi, m4v, ...).
- =cj/--video-file-p= sibling of =cj/--audio-file-p=.
- =cj/--start-transcription-process= (or a wrapper) detects video,
shells out to ffmpeg to extract the audio track to a temp file
(=ffmpeg -i in.mp4 -vn -acodec copy out.m4a= or similar; pick a
codec the backend accepts), then transcribes the temp file and
cleans up.
- =cj/transcribe-audio-at-point= accepts both audio and video via
=(or (cj/--audio-file-p f) (cj/--video-file-p f))=; the
surrounding pipeline knows when to insert the ffmpeg step.
Open design questions:
- Keep the function named =transcribe-audio-at-point= (treats video
as "audio-bearing") or rename to =transcribe-media-at-point= and
add an alias? Rename probably cleaner.
- ffmpeg availability check + =cj/executable-find-or-warn= pattern
on first use.
- Where the temp audio file lives -- alongside the video (visible),
or =temporary-file-directory= (clean). Probably the latter for
videos the user doesn't want to clutter.
- Do we keep the temp audio after transcription, or always delete?
The log file already retains diagnostic info; extracted audio is
derivable. Default to delete; offer a custom to keep.
Test surface: =cj/--video-file-p= happy/edge cases, the ffmpeg
extract step (stub =call-process=), and the dispatch in
=cj/transcribe-audio-at-point= against a video path.
** DONE [#C] Surface org narrowing + sparse-tree under =C-; O= :refactor:
CLOSED: [2026-05-14 Thu]
Final layout flatter than the original proposal: no =n= or =s=
sub-prefixes. Lowercase letters create / narrow / sparse-tree;
the same letter capitalized cancels. `n' / `N' = narrow / widen.
`s' / `S' = match-sparse-tree / show-all. `t' / `T' =
show-todo-tree / show-all (both capitals point at the same
`org-show-all' so the mental model is "capital cancels the
lowercase I just ran"). `R' = `org-reveal' (no lowercase pair --
`r' is the table-row sub-prefix); F2 (the old reveal binding) is
freed up. Sibling-stepping is on `>' / `<' at the top level.
Four new ERT assertions in
=tests/test-org-config-keymap-ownership.el= lock the shape.
The narrowing and sparse-tree commands already exist in
=modules/org-config.el=, but they're bound only inside the
=:bind (:map org-mode-map ...)= block and scattered across `C-c'
shortcuts -- nothing in `cj/org-map' (`C-; O') surfaces them, so
which-key never shows them and discoverability is poor.
Existing bindings worth promoting (org-config.el ~line 141-150):
- =C-\\= =org-match-sparse-tree=
- =C-c N= =org-narrow-to-subtree=
- =C-c >= =cj/org-narrow-forward=
- =C-c <= =cj/org-narrow-backwards=
- =C-c = =widen=
- == =org-reveal= (the reveal-narrowed-context command,
not org-reveal-config.el)
Proposal:
Add a sub-menu under `C-; O':
- `C-; O n' -- narrow operations (sub-prefix)
- `n s' narrow to subtree
- `n e' narrow to element
- `n >' narrow forward sibling
- `n <' narrow backward sibling
- `n w' widen
- `C-; O s' -- sparse-tree operations (sub-prefix)
- `s s' org-match-sparse-tree (by tag/property/todo match)
- `s t' show all TODOs
- `s p' show entries with a priority
- `s r' org-reveal (open the surrounding context of point)
Add the which-key labels alongside. Keep the existing `C-c'
bindings as-is for muscle memory.
Open question: should `cj/org-narrow-forward' /
`cj/org-narrow-backwards' have their own sub-letters under `n', or
just be under `n >' / `n <' as written above? The arrow-symbol
keys read naturally as "next/previous" so probably keep them.
** DONE [#B] F9 toggle should restore single-window layout for AI-vterm :bug:
When the AI-vterm buffer is the only window in the frame (e.g. after =C-x 1=) and
F9 is pressed, =cj/ai-vterm= buries the buffer (correct), but the next F9
redisplays the agent in a split rather than restoring the single-window full-frame
layout. F9 should toggle off/on while preserving the lone-window state.
Fix: new =cj/--ai-vterm-last-was-bury= flag in =modules/ai-vterm.el=.
The toggle-off branch sets it to t when =one-window-p= is true (bury
path) or nil when =delete-window= runs. =cj/--ai-vterm-display-saved=
checks the flag at toggle-on: if t and the frame is still single-window,
it replaces the selected window's buffer in place via =set-window-buffer=
rather than splitting via =display-buffer-in-direction=. Flag is
consumed (cleared) by either branch so it never stays stale.
5 tests in =tests/test-ai-vterm--single-window-toggle.el= cover:
flag set on bury, flag cleared on delete-window, flag respected only
when still one-window, flag not set when bury didn't run, and the
end-to-end roundtrip. Full =make test-unit= green.
** DONE [#B] AI-vterm scrollback history should replace agent buffer in place :feature:
When viewing the scrollback history of an AI-vterm buffer, the history view should
replace the live agent buffer in the same window rather than splitting or popping
a separate window. Goal: read past output without losing the agent's frame slot,
then snap back to the live buffer when done.
Decisions on the open questions:
- *Trigger*: reused the existing =cj/vterm-tmux-history= command (=C-; x h=).
No new command -- it already captures the tmux pane and runs from any
vterm buffer including agents.
- *Round-trip*: =q= / == / =C-g= already restore the origin in
the same window via =cj/vterm-tmux-history-quit=. Same key as the
scrollback mode's other exits.
- *F9 integration*: deferred. Pressing F9 in history mode now treats the
history buffer as non-agent (its name is =*vterm tmux history: ...*=,
not =agent [...]=) so dispatch falls through to redisplay-recent + a
saved-direction split. A user who wants to toggle agent off should
press =q= first, then F9. Filed as a follow-up if it bites.
Fix: =modules/vterm-config.el= -- one line. =pop-to-buffer buffer=
became =switch-to-buffer buffer= so the history view replaces the origin
in the selected window instead of going through display-buffer's split
logic. Quit was already in-place via =set-window-buffer=.
New test in =tests/test-vterm-tmux-history.el= asserts the selected
window's buffer becomes the history buffer with no extra window
created (=one-window-p= still t). Existing tests dropped their
=pop-to-buffer= stub since =switch-to-buffer= works directly in batch.
Full =make test-unit= green.
** DONE [#B] Add ERT coverage for modules below 70% :tests:
CLOSED: [2026-05-14 Thu]
Coverage snapshot from =make coverage= on 2026-05-14 (post-push):
=5958/6861= executable lines covered (=86.8%=) across 73 tracked module files.
All tracked modules now sit at 70% or above. The two stragglers
(=system-defaults.el= and =system-commands.el=) were resolved by
attacking the instrumentation pattern rather than adding more tests:
- =system-defaults.el= 8.3% -> 100%: switched the helper-functions
test from per-test =(load ...)= reloads inside =cl-letf= to a
single top-level =(require 'system-defaults)= wrapped in stubs,
so undercover sees one load instead of N reloads.
- =system-commands.el= 69.4% -> 100%: switched =cj/system-cmd='s
=(interactive (list (read-shell-command ...)))= to the equivalent
string spec =(interactive "sSystem command: ")=, which lets
undercover instrument the function body that was previously
showing as 0 hits, plus added one test that captures and invokes
the =run-at-time= lambda body directly.
Lesson for future coverage work: when ERT tests exercise a function
but the body shows 0 hits, suspect undercover/edebug instrumentation
failing on a specific Lisp form (=interactive= with a destructured
spec, backquote-destructured =pcase-let=, etc.), not the tests.
*** DONE [#B] Add ERT tests for =modules/prog-python.el= (21/21, 100.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/selection-framework.el= (3/3, 100.0%) :tests:
*** DONE [#B] Add ERT tests for =modules/keyboard-compat.el= (29/29, 100.0%) :tests:
*** DONE [#B] Add ERT tests for =modules/prog-webdev.el= (21/21, 100.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/calibredb-epub-config.el= (95/133, 71.4%) :tests:
*** DONE [#B] Add ERT tests for =modules/system-defaults.el= (12/12, 100.0%) :tests:
CLOSED: [2026-05-14 Thu]
Rewrote =tests/test-system-defaults-functions.el= to call
=(require 'system-defaults)= once at top level (with the
side-effecting primitives stubbed via =cl-letf= wrapping the
require) instead of looping per-test =(load ...)= reloads inside
=cl-letf=. Undercover only saw the first load, so the function
bodies showed as uncovered even though every test ran them. Loading
once -- with the same stubs -- fixed the gauge and pulled coverage
to 12/12. Added two more tests to exercise the previously-unhit
list-without-comp guard and the non-string-message format branch.
*** DONE [#B] Add ERT tests for =modules/ui-navigation.el= (46/48, 95.8%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/prog-go.el= (24/27, 88.9%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/system-commands.el= (51/51, 100.0%) :tests:
CLOSED: [2026-05-14 Thu]
The =interactive= form on =cj/system-cmd= was =(interactive (list
(read-shell-command "...")))= -- a destructured list form. Edebug-
based undercover instrumentation didn't see past it, so the function
body registered 0 hits even though the tests called it directly.
Switched to the equivalent string spec =(interactive "sSystem
command: ")= and the body instrumented as expected. Added one more
test that captures the =run-at-time= lambda inside
=cj/system-cmd-restart-emacs= and invokes it directly so the inner
=call-process-shell-command= branch registers as covered.
*** DONE [#B] Add ERT tests for =modules/external-open.el= (31/33, 93.9%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/org-webclipper.el= (59/59, 100.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/system-utils.el= (26/26, 100.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/org-reveal-config.el= (68/81, 84.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/coverage-elisp.el= (19/19, 100.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/org-noter-config.el= (72/99, 72.7%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/ai-config.el= (160/191, 83.8%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/slack-config.el= (70/74, 94.6%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/org-roam-config.el= (80/80, 100.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/custom-text-enclose.el= (145/145, 100.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/dirvish-config.el= (174/185, 94.1%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/hugo-config.el= (88/96, 91.7%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/org-refile-config.el= (50/51, 98.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/org-contacts-config.el= (64/79, 81.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/transcription-config.el= (150/162, 92.6%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/music-config.el= (213/278, 76.6%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/mail-config.el= (14/19, 73.7%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/custom-buffer-file.el= (167/212, 78.8%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/org-agenda-config.el= (103/104, 99.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/host-environment.el= (53/57, 93.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/custom-ordering.el= (101/101, 100.0%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/ui-theme.el= (39/40, 97.5%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/custom-comments.el= (317/358, 88.5%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/ui-config.el= (28/31, 90.3%) :tests:
*** DONE [#B] Add ERT tests for =modules/custom-whitespace.el= (80/82, 97.6%) :tests:
*** DONE [#B] Add ERT tests for =modules/jumper.el= (97/99, 98.0%) :tests:
*** DONE [#B] Add ERT tests for =modules/test-runner.el= (160/222, 72.1%) :tests:
CLOSED: [2026-05-14 Thu]
*** DONE [#B] Add ERT tests for =modules/browser-config.el= (62/76, 81.6%) :tests:
** DONE [#A] Fix Python tree-sitter font-lock query syntax error :bug:
CLOSED: [2026-05-14 Thu]
Diagnosed 2026-04-26 — paused at /start-work Gate 2. Root cause was system-level, not in =.emacs.d=: Emacs 30.2 + tree-sitter library 0.26.x predicate-syntax mismatch. Emacs sent =#match= (no =?= suffix), tree-sitter 0.26 rejected anything but =#match?=. Affected every =:match=, =:equal=, =:pred= predicate in every treesit-aware mode, not just Python.
Full investigation, reproduction, and fix-option analysis in:
[[file:docs/python-treesit-predicate-mismatch.txt][docs/python-treesit-predicate-mismatch.txt]]
Resolved 2026-05-14 by an upstream emacs Arch-package revision bump (=30.2-2= → =30.2-3=, shipped 2026-05-03) — most likely carrying a downstream patch to =treesit.c='s predicate translation. Bug no longer reproduces: the exact failing query runs cleanly via =treesit-query-capture=, and =font-lock-ensure= on a real Python file under =python-ts-mode= completes with no =treesit-query-error=. No local override applied to =modules/prog-python.el=. Matches option A from the investigation's fix-options ("WAIT FOR UPSTREAM EMACS FIX").
** DONE [#C] EPUB text is slightly left-of-center (shr word-wrap shortfall) :bug:
CLOSED: [2026-05-14 Thu 23:39]
(2026-05-12) Visual review of the reading-width rework is done -- it's good. Not sure I actually need this nit fixed; the left-of-center bias is minor and the `+'/`-' keys let me nudge it. Parking here until I decide it bothers me enough.
After =b7c6b2c=, the EPUB text block is centered with `set-window-margins' at `(natural - nov-text-width) / 2' each side -- but the *rendered* text is a bit narrower than `nov-text-width' columns, because `shr' wraps at word boundaries, so the typical line ends a few columns short of the fill width. The text is left-aligned within its `nov-text-width'-wide fill region, so the unused tail of that region adds to the right margin -- the block reads as shifted left of center. Adjusting `cj/nov-margin-percent' (the `+'/`-' keys) re-flows and happens to look better at some widths (probably the line-ending pattern lands tighter), which is the same effect, not a real difference.
Plan: in `cj/nov-update-layout', after the render, measure the actual widest line (`(save-excursion (goto-char (point-min)) (let ((m 0)) (while (not (eobp)) (end-of-line) (setq m (max m (current-column))) (forward-line 1)) m))') and center on *that* instead of on `nov-text-width'. Or, cheaper but coarser: bias the left margin by a small fudge (a column or two). The measure-the-text approach is correct; do it if it's not too slow on big chapters (it scans the buffer once per render -- the buffer's already in memory, so likely fine). =modules/calibredb-epub-config.el=, =tests/test-calibredb-epub-config.el=.
** DONE [#B] Write spec on what's needed for music-config not to depend on EMMS
CLOSED: [2026-05-15 Fri]
What if we were writing this as it's own package and couldn't use EMMS. What would that look like?
The spec should be in docs/
Another task should be created to implement the spec
Spec written in [[id:423bc355-18d3-4e39-9e7a-f768b865d95b][Design: music-config Without EMMS]].
** DONE [#B] Update gptel models :chore:
CLOSED: [2026-05-14 Thu]
Anthropic side: bumped Opus 4.6 → 4.7 (current frontier); Sonnet 4.6
and Haiku 4.5 stay (still current). Default model setq also bumped
to =claude-opus-4-7= in both places (=cj/ensure-gptel-backends= and
the =use-package gptel :config= block).
OpenAI side: bigger refresh. Old menu (=gpt-4o=, =gpt-5= original,
=gpt-4.1=, =o1=) was all in the cohort retired from ChatGPT on
2026-02-13 -- still callable via API but no longer the path forward.
New menu: =gpt-5.5= (current flagship), =gpt-5.4-mini= (fast/cheap),
=o3= (reasoning).
Stale docstring example in =cj/gptel--current-model-selection=
also bumped to match.
gptel's bundled =:models= list only goes through May-2025 model IDs
but the constructor passes whatever string you supply straight to the
API, so newer model names work fine without a gptel upgrade.
** DONE [#B] Add gptel toggle to M-F9 :refactor:
CLOSED: [2026-05-15 Fri]
Rebound =M-= from =cj/ai-vterm-pick-buffer= to =cj/toggle-gptel=
in both the global keymap and =vterm-mode-map=. The pick-buffer
command and its helper =cj/--ai-vterm-pick-buffer-candidates= were
deleted entirely along with the candidates test file.
F9 family after this change:
- == ai-vterm toggle (unchanged)
- =C-= ai-vterm project picker (unchanged)
- =M-= gptel *AI-Assistant* window toggle (NEW)
Two existing test files updated:
=test-ai-vterm--f9-in-vterm.el= (binding assertions flipped to the
new function).
=test-ai-vterm--pick-buffer-candidates.el= deleted.
Module commentary + the =cj/ai-vterm= docstring updated to describe
the new M-F9 behavior.
*** 2026-05-15 Fri @ 02:21:00 -0500 Add explicit ai-vterm -> ai-config command boundary for cj/toggle-gptel
=make compile= warned that =cj/toggle-gptel= was not known to be
defined when =modules/ai-vterm.el= was byte-compiled. Added an
interactive autoload declaration in =ai-vterm.el= alongside the
other cross-module declarations:
#+begin_src elisp
(autoload 'cj/toggle-gptel "ai-config" nil t)
#+end_src
The dependency is now explicit, =make compile= is clean, and
requiring =ai-vterm= in isolation leaves =cj/toggle-gptel= fboundp
as an autoload sigil pointing at =ai-config=. Added a regression
test in =test-ai-vterm--f9-in-vterm.el=:
=test-ai-vterm-toggle-gptel-autoloaded-without-ai-config=. Verified
with =make compile= (no warning) and
=make test-file FILE=test-ai-vterm--f9-in-vterm.el= (5/5 pass).
** DONE [#B] Modify C-; b p :feature:
CLOSED: [2026-05-15 Fri]
- (EWW) copy EWW url when in an EWW buffer.
- (calibre) copy path to an epub or pdf or other document if those are shown in docview or pdfview
Shipped this session: =cj/copy-buffer-source-as-kill= replaces the
old =cj/copy-path-to-buffer-file-as-kill= (kept as a =defalias= for
backwards compat). Dispatch alist =cj/buffer-source-functions= keys
on =major-mode= → thunk; =buffer-file-name= is the fallback.
Bindings: =C-; b p= now copies whatever is the right "source" for
the current mode. which-key relabeled "copy buffer source" (was
"copy file path").
First-batch dispatches: =eww-mode= (eww URL), =elfeed-show-mode=
(entry link), =dired-mode= / =dirvish-mode= (file at point),
=doc-view-mode= / =pdf-view-mode= (covered by the fallback to
=buffer-file-name=). 10 new ERT tests in
=tests/test-custom-buffer-file-copy-buffer-source.el= cover the
dispatch paths + the alias + the keymap.
Deferred to a follow-up task: =mu4e-view-mode=, =org-mode= at a
heading, =help-mode=, =Info-mode=, =magit-log-mode= /
=magit-commit-mode= / =magit-status-mode=, =xref--xref-buffer-mode=
/ =grep-mode= / =compilation-mode=, =image-mode=, =archive-mode=.
These need format decisions (Message-ID vs link vs subject, id link
vs CUSTOM_ID vs heading text, etc.) before implementation.
** DONE [#C] Extend cj/buffer-source-functions to more modes :feature:
CLOSED: [2026-05-15 Fri]
Followup to =Modify C-; b p=. The first batch covered eww,
elfeed-show, dired/dirvish, and doc-view/pdf-view (via the
buffer-file-name fallback). These modes still need a decision +
implementation:
- =mu4e-view-mode= → Message-ID, =mu4e:msgid:...= link, or
Subject + From?
- =Info-mode= → an org-style =[[info:(manual)Node][label]]= link
Each one is a small addition to =cj/buffer-source-functions= in
=modules/custom-buffer-file.el= plus a test. Pick a format per
mode, then implement.
*** 2026-05-15 Fri @ 02:21:00 -0500 Make Info buffer-source output match the documented org link format
Updated the =Info-mode= thunk in =cj/buffer-source-functions=
(=modules/custom-buffer-file.el=) to return the full org bracket
link =[[info:(manual)Node][(manual) Node]]= instead of the bare
target =info:(manual)Node=. Label format =(manual) Node= keeps the
manual name and node name both grep-friendly in note files.
Existing test
=test-copy-buffer-source-info-mode-formats-as-org-info-link= on a
=.info.gz= file now asserts the bracket form. Added a new boundary
test
=test-copy-buffer-source-info-mode-handles-uncompressed-info-file=
for plain =.info= input so the suffix-stripping branch is locked
in. Verified with
=make test-file FILE=test-custom-buffer-file-copy-buffer-source.el=
(15/15 pass).
*** 2026-05-15 Fri @ 00:11:47 -0500 Brainstorm: additional buffer-source ideas
Today =C-; b p= invokes =cj/copy-path-to-buffer-file-as-kill=, which only
handles file-visiting buffers and errors otherwise. The proposed
extension turns it into a dispatcher: ask the current buffer "what's
your source?" and copy that, falling back to =buffer-file-name=.
Grouping ideas by yield (most useful first) so an implementation can
prioritize:
*Likely highest-leverage (matches Craig's daily workflows):*
- =eww-mode= → =(eww-current-url)= (already in task body).
- =elfeed-show-mode= → entry URL via =(elfeed-entry-link
elfeed-show-entry)=. Closes the loop for "I'm reading this article,
let me share it / open it in browser."
- =mu4e-view-mode= / =mu4e-headers-mode= → either the Message-ID as a
=mu4e:msgid:...= link or the From + Subject as plain text. Useful
for citing emails in org notes.
- =org-mode= on a heading → the heading's =CUSTOM_ID= or =ID= as a
full =[[id:...][title]]= link. Already partly covered by
=org-store-link=; the value here is "give me the link form even
outside an org-store flow."
- =dired-mode= / =dirvish-mode= → =(dired-get-filename)= for the file
at point, not the dired buffer's =default-directory=. Subtly
different from current behavior because dired *is* file-visiting in
a sense.
- =doc-view-mode= / =pdf-view-mode= → the underlying file path. Often
IS =buffer-file-name=, but explicit dispatch makes the behavior
predictable. Calibre integration (task body) is a special case of
this -- calibre wraps the path through a different lookup.
*Useful for occasional workflows:*
- =help-mode= → the symbol being described (=help-xref-following= or
parsing the *Help* buffer header). Pairs with /describe-function/
/describe-variable/.
- =Info-mode= → an org-style =[[info:(manual)Node][label]]= link.
- =magit-log-mode= / =magit-commit-mode= → the commit SHA at point,
optionally as a clickable form for the remote.
- =magit-status-mode= → the project root (or repo URL via
=vc-git-repository-url=).
- =xref--xref-buffer-mode= / =grep-mode= / =compilation-mode= → the
=file:line= location at point.
- =image-mode= → the image file path.
- =archive-mode= (tar/zip) → =archive-file-name= plus the entry name.
*Probably skip:*
- =vterm-mode= / =eshell-mode= → no meaningful "source"; would just
copy the buffer name. Edge case at best.
- =w3m-mode= → covered by EWW for Craig; w3m use is rare here.
- =calc-mode= → "current value" isn't really a "buffer source"; better
served by a dedicated calc keybinding.
*Implementation shape:*
A dispatch alist mapping major-mode → thunk that returns a string
(or nil to fall through), with =buffer-file-name= as the final
fallback. Something like:
#+begin_src emacs-lisp
(defvar cj/buffer-source-functions
'((eww-mode . (lambda () (eww-current-url)))
(elfeed-show-mode . (lambda () (elfeed-entry-link elfeed-show-entry)))
(dired-mode . (lambda () (dired-get-filename nil t)))
...))
(defun cj/copy-buffer-source-as-kill ()
(interactive)
(let* ((handler (alist-get major-mode cj/buffer-source-functions))
(source (or (and handler (funcall handler))
(buffer-file-name)
(user-error "Buffer has no copyable source"))))
(kill-new source)
(message "Copied: %s" source)))
#+end_src
Rename the command (=cj/copy-buffer-source-as-kill=) since it's no
longer specifically about a file path. Keep =C-; b p= binding so
muscle memory survives.
** DONE [#C] Rebind org-noter insert-note to =n= (so it's =C-; n n=) :refactor:
CLOSED: [2026-05-15 Fri]
The org-noter prefix =C-; n= currently has =i= for insert-note and =n=
for sync-next-note. Move insert-note onto =n= -- it's the most-used
action in a noter session and deserves the doubled prefix letter.
Current bindings in =modules/org-noter-config.el= (=cj/org-noter-map=):
- =i= -> =cj/org-noter-insert-note-dwim=
- =n= -> =org-noter-sync-next-note=
- =p= -> =org-noter-sync-prev-note=
- =.= -> =org-noter-sync-current-note=
Proposed bindings
- n -> =cj/org-noter-insert-note-dwim=
- > -> =org-noter-sync-next-note=
- < -> =org-noter-sync-prev-note=
- =.= -> =org-noter-sync-current-note=
Update the =which-key= labels in the same module and any test that asserts the keymap shape.
** DONE [#D] Dedup the doubly-defined functions in calibredb-epub-config.el :cleanup:
CLOSED: [2026-05-15 Fri]
=make compile= flags =calibredb-epub-config.el= for defining =cj/calibredb-clear-filters= (line ~79) and =cj/nov-jump-to-calibredb= (line ~277) twice each — the later definition silently shadows the earlier. Find which copy is current, delete the stale one. Pre-existing; noticed 2026-05-12 while fixing the Nov text-width loop.
Diagnosis: there was no actual duplicate. Only one =(defun ...)=
of each name in the source. The "defined multiple times" warning
fired because use-package's =:bind= expansion makes the
byte-compiler count the referenced symbol as a definition when the
target function is defined in the same file -- then sees the actual
=defun= later and warns about a redefinition.
Fix: reorder so each =defun= appears /before/ the =use-package=
block that references it via =:bind=. Concrete moves:
- =cj/calibredb-clear-filters= moved above =(use-package calibredb
...)=.
- =cj/nov--metadata-get= + =cj/nov--file-path= +
=cj/nov-jump-to-calibredb= (the entire jump-to-calibredb cluster)
moved above =(use-package nov ...)=. Helpers had to move
alongside the public function so the byte-compiler doesn't emit
free-function warnings for them.
After: both "defined multiple times" warnings are gone. All unit
tests still pass. Net line count unchanged (just reordered).
** DONE [#B] Convert
Shipped 2026-04-26 in commit 781b46e. Implementation: =cj/lsp-file-watch-ignored-extras= (thirteen patterns) and =cj/lsp--add-file-watch-ignored-extras= in =modules/prog-lsp.el=, called from the lsp-mode use-package =:config=. Seven ERT tests in =tests/test-prog-lsp--add-file-watch-ignored-extras.el=, all green.
Manual verify (tomorrow): restart Emacs, open =~/code/deepsat/orchestration_dashboard_mvp/backend/test_mission_image_api.py=, watch for the file-watch prompt. Expected: no prompt, or count well below the previous 1905. If still prompting at ~1905, iterate on the pattern list.
After verification: drop the redundant =lsp-file-watch-ignored-directories= entry from the deepsat MVP's =.dir-locals.el= here and on velox.
Setting =lsp-file-watch-ignored-directories= via the project's =.dir-locals.el= doesn't apply at the buffer level. Confirmed via =M-: lsp-file-watch-ignored-directories= in a Python buffer — value is the lsp-mode default, not the 7 patterns we wrote in dir-locals. The safety prompt was answered with =!= and the dir-locals are otherwise live (the projectile commands take effect).
Fix: move the seven patterns into the lsp config module as a global default with =setq-default= or per-pattern =add-to-list=. The patterns are project-agnostic build/cache directories — safe as defaults for any project.
Patterns to add:
- =[/\\\\]node_modules\\'=
- =[/\\\\]\\.ruff_cache\\'=
- =[/\\\\]dist\\'=
- =[/\\\\]coverage\\'=
- =[/\\\\]test-results\\'=
- =[/\\\\]playwright-report\\'=
- =[/\\\\]tf[/\\\\]\\.terraform\\'=
After landing: =M-x lsp-workspace-shutdown=, reopen a Python file, confirm the directory count drops well below the default threshold of 1000 (currently 1905). Then remove the redundant entries from the deepsat MVP's =.dir-locals.el= here and on velox.
Discovered 2026-04-26 testing dashboard MVP F-key setup.
** DONE [#C] Investigate sqlite finalizer error on init :bug:
CLOSED: [2026-05-15 Fri]
=*Messages*= shows =finalizer failed: (wrong-type-argument sqlitep nil)= during init. A package is finalizing an sqlite handle that's already nil — indicates a teardown bug somewhere. Likely culprits: forge, magit-todos, or any package using the sqlite backend.
Investigation order:
1. =M-x toggle-debug-on-message= with a regex matching =finalizer failed=.
2. Restart Emacs to capture the backtrace.
3. Check =modules/git-config.el= (forge) and any other sqlite-using module.
Single occurrence per session, no visible impact yet. Track in case it grows.
Discovered 2026-04-26 in =*Messages*=.
Resolution 2026-05-15: confirmed gone. Live session (2h uptime): no
=finalizer= / =sqlitep= / =wrong-type-argument sqlite= match in
=*Messages*= (3966 bytes) or =*Warnings*=. Fresh namespaced daemon
(=emacs --daemon=sqlite-verify=): forced =forge= load, ran 10 GC
cycles with =sit-for= pauses, =sqlite-available-p= and
=forge-database-file= both confirmed live -- still zero hits across
1282 bytes of =*Messages*=. If it recurs, arm
=toggle-debug-on-message= on the regex =finalizer failed= to capture
a backtrace.
** DONE [#A] org-element--list-struct issue when using gptel magit :bug:
CLOSED: [2026-05-16 Sat]
Launch Emacs
Stage a file using magit
Commit using magit
Use gptel magit to generate a commit message
Commit the file
>>> commit is successful
Stage another file using magit
Commit using magit
Use gptel magit to generate a commit message
Commit the file
>>> error org-element--list-struct: Tab width in Org files must be 8, not 4. Please adjust your ‘tab-width’ settings for Org mode
** DONE [#A] transient-setup error when running gptel magit :bug:
CLOSED: [2026-05-15 Fri]
When running gptel magit during a commit message on this machine, I get the following error consistently:
transient-setup: Cannot open load file: No such file or directory, gptel-magit
** DONE [#C] Implement flycheck modeline customization :feature:
CLOSED: [2026-05-16 Sat]
Spec: [[id:76979608-956e-474f-90a8-8d0c958101a0][docs/specs/flycheck-modeline-customization-spec-implemented.org]] (Option 4 / hybrid).
=modules/flycheck-config.el= got two new =:custom= lines:
=flycheck-mode-line-prefix= → "🐛", =flycheck-mode-success-indicator= →
" ✓". =flycheck-mode-line-color= stays default-t so counts pick up
=error= / =warning= faces automatically.
=modules/modeline-config.el= got one new =(:eval ...)= form in
=mode-line-format=, placed between the recording indicator and
=cj/modeline-vc-branch=. Two guards: =(mode-line-window-selected-p)=
gates to the active window; =(bound-and-true-p flycheck-mode)= prevents
the call from firing in buffers where flycheck hasn't loaded.
=tests/test-modeline-config-flycheck-segment.el= -- 3 smoke tests
asserting the segment is present and both guards are in place. The
existing modeline tests stay green.
** DONE [#B] Gptel Work :refactor:cleanup:feature:
CLOSED: [2026-05-16 Sat]
Keep gptel as a focused side-tool for one-off conversations, impromptu help, and the rewrite-region code helper. Workflow stays distinct from the dedicated Claude-Code agents launched via F9, so per-project agent sessions don't get cluttered with general-purpose chat.
In scope:
- The =cj/ai-keymap= (=C-; a=) commands in =modules/ai-config.el=.
- The save/load/delete + autosave flow in =modules/ai-conversations.el=.
- The local-tools surface in =gptel-tools/= and the loader =cj/gptel-load-local-tools=.
- gptel-magit's three triggers (M-g in git-commit, =g= in magit-commit transient, =x= in magit-diff transient).
Out of scope: the F9 =ai-vterm= Claude-Code launcher (=modules/ai-vterm.el=) — separate module, working well.
Closing event log:
- Rewrote =gptel-tools/update_text_file.el= in pure Elisp + wired into =cj/gptel-local-tool-features=; 48 ERT tests.
- Split gptel-magit wiring into per-feature =with-eval-after-load= blocks (=git-commit=, =magit-commit=, =magit-diff=); rewrote the lazy-loading test to inspect =after-load-alist= directly.
- Added 36 ERT tests for =ai-conversations.el= (helpers, autosave hook, interactive save/delete).
- Added 52 ERT tests for the other five gptel-tools files; small refactor on =read_buffer.el= and =write_text_file.el= to extract testable helpers.
- =cj/gptel-autosave-toggle= + =[AS]= mode-line indicator, bound to =C-; a A=.
- =cj/gptel-quick-ask= one-shot Q&A buffer with =q= / =escape= / =c= bindings (new module =ai-quick-ask.el=), bound to =C-; a q=.
- Directive-picker wrappers around =gptel-rewrite= (=ai-rewrite.el=); =C-; a r= picks directive + rewrites, =C-; a R= redoes with a different directive.
- Dired-style saved-conversations browser (=ai-conversations-browser.el=) with RET/l/d/r/g/q bindings, bound to =C-; a b=.
- Shortlist design doc at =docs/design/gptel-tools-shortlist.org= for additional gptel tools (7 ADOPT, 2 DEFER, 1 SKIP); live community-tool survey remains as follow-up work for Craig.
*** 2026-05-16 Sat @ 01:17:58 -0500 Rewrote update_text_file.el and wired it into cj/gptel-local-tool-features
I rewrote =gptel-tools/update_text_file.el= in pure Elisp. The previous
version shelled out to sed for everything, had a stray quote terminator
at EOF, produced literal backslash-n where actual newlines were
expected, and prompted via =y-or-n-p= redundantly with gptel's own
=:confirm t= flag.
The five operations (=replace=, =append=, =prepend=, =insert-at-line=,
=delete-lines=) split into pure string transforms that test without
touching the disk. The file-level wrapper validates the path, enforces
the 10MB size limit, takes a timestamped backup, and writes atomically.
No backup is created when the operation is a no-op.
=tests/test-update-text-file.el= covers Normal / Boundary / Error per
operation plus the wrapper -- 48 tests green. Added =update_text_file=
to =cj/gptel-local-tool-features= so gptel exposes it on next restart.
*** 2026-05-16 Sat @ 01:31:03 -0500 Split the magit wiring into per-feature with-eval-after-load blocks
Root cause: =magit.el= calls =(provide 'magit)= BEFORE its
=(cl-eval-when (load eval) ...)= block requires =magit-commit= and
=magit-stash=. A single =with-eval-after-load 'magit= fires while
those transient prefixes are still undefined, and
=transient-append-suffix= silently no-ops on missing prefixes
(documented behavior unless =transient-error-on-insert-failure= is
set). Two of three triggers failed silently because of this; only
M-g worked, because =git-commit= IS required before the provide.
Fix: replace the single =with-eval-after-load 'magit= with three
per-feature blocks (=git-commit=, =magit-commit=, =magit-diff=). Each
hooks the exact dependency the wiring needs.
The existing lazy-loading test was rewritten to check
=after-load-alist= registration directly rather than driving the
hooks via =provide= -- in Emacs 30 batch mode, =provide= does not
fire registered =eval-after-load= callbacks; only an actual =load=
does. Inspecting the registration is stronger evidence anyway: the
guard against the regression is "no entry for =magit=, entries for
=git-commit=, =magit-commit=, =magit-diff=," which is exactly what
the test asserts.
*** 2026-05-16 Sat @ 01:33:20 -0500 Added ERT coverage for ai-conversations.el
=tests/test-ai-conversations.el= covers every helper in the module
plus the interactive entry points. 36 tests across Normal / Boundary /
Error categories: slug normalization, timestamp decoding, file
enumeration (existing topics, latest-for-topic, candidate ordering for
both =newest-first= and =oldest-first=), the save-buffer/strip-headers
round-trip, the autosave-after-send + autosave-after-response hooks,
the install-once guard for the post-response hook, and the
save/delete interactive entry points exercised via =cl-letf= stubs.
Per-test temp directories; no writes outside them.
*** 2026-05-16 Sat @ 01:39:11 -0500 Added ERT coverage for the gptel-tools .el files
Five new test files cover the five remaining gptel tools beyond
=update_text_file= (which was tested with its rewrite):
- =tests/test-gptel-tools-read-buffer.el= -- 5 tests for the new
=cj/read-buffer--get-content= helper extracted from the
=gptel-make-tool= lambda.
- =tests/test-gptel-tools-write-text-file.el= -- 10 tests for the
helpers extracted from =write_text_file.el= (validate-path,
backup-name, ensure-parent, run with normal/overwrite/error
paths).
- =tests/test-gptel-tools-read-text-file.el= -- 12 tests for the
pre-existing helpers: =cj/validate-file-path=,
=cj/get-file-metadata=, =cj/check-file-size-limits=,
=cj/detect-binary-file=, =cj/handle-special-file-types=.
- =tests/test-gptel-tools-list-directory-files.el= -- 15 tests for
the =list-directory-files--*= helpers (mode-to-permissions for
files/dirs/executables, get-file-info, extension filter, formatter,
recursive vs flat listing, error path).
- =tests/test-gptel-tools-move-to-trash.el= -- 10 tests for the
=gptel--move-to-trash-*= helpers (unique-name generation with and
without extension, path validation gating HOME and /tmp, critical
directory rejection, perform on files and directories).
Two small refactors landed first to make the tooling testable:
=read_buffer.el= and =write_text_file.el= had their main bodies
inlined into the =gptel-make-tool= lambdas; I extracted them into
=cj/read-buffer--get-content= and =cj/write-text-file--run= (plus
=--validate-path=, =--backup-name=, =--ensure-parent=) following the
Internal/Wrapper split documented in =elisp-testing.md=.
52 new tests, all green.
*** 2026-05-16 Sat @ 02:01:48 -0500 Wrote the gptel-tools shortlist design doc
[[file:docs/design/gptel-tools-shortlist.org][docs/design/gptel-tools-shortlist.org]] covers each of the candidates
called out in the task body plus a few obvious adjacents. Decisions:
- *ADOPT* (7): =search_in_files=, =git_status= / =git_log= /
=git_diff= (three tools), =web_fetch=, =search_emacs_help=,
=find_file_by_name=, =take_screenshot=. Each gets a sketch in the
doc (args, validation, implementation outline).
- *DEFER* (2): =run_shell_command= (huge surface, click-fatigue
risk; ADOPT-bucket tools cover most legit use cases), =org_capture=
(needs UX design for template pre-fill and round-trip).
- *SKIP* (1): =eval_elisp= (code execution from a model is too
dangerous even with confirm-each-call).
Follow-up work surfaced in the doc:
1. *Live community survey* -- walk the gptel README's tool examples,
MELPA =gptel-tool-*=, GitHub =gptel-make-tool= search,
karthink's gptel repo. I couldn't do live web research from
this session; that pass remains for Craig to do or to delegate.
2. *Per-tool implementation sub-tasks* -- each ADOPT entry deserves
its own [#B] under =Gptel Work= when Craig reviews this shortlist.
3. *Sandboxing convention* -- decide whether =web_fetch= needs an
allowlist of outbound URLs, and the same call for
=run_shell_command= if it's promoted from DEFER.
Three open questions called out for review at the bottom of the
doc.
*** 2026-05-16 Sat @ 01:54:34 -0500 Added directive-picker wrappers around gptel-rewrite
New module =modules/ai-rewrite.el= with two commands:
- =cj/gptel-rewrite-with-directive= (=C-; a r=, replacing the bare
=gptel-rewrite= binding): completing-read on a directive name from
=cj/gptel-rewrite-directives=, then rewrite the active region.
- =cj/gptel-rewrite-redo-with-different-directive= (=C-; a R=): replay
the prior region with a different directive (markers are saved
buffer-local so the region survives accept/reject of the first
rewrite).
Open-question answer: the directive is injected via a one-shot
=let=-binding on =gptel-rewrite-directives-hook= (an abnormal hook
that gptel-rewrite already supports for per-call system messages),
not by mutating =gptel-directives= globally. No advice on
=gptel-rewrite= and no state to clean up after the call returns.
Directives ship inline as a =defcustom= alist with the six names
called out in the task body (=terse=, =fix-grammar=,
=refactor-readability=, =add-docstring=, =explain-as-comment=,
=shorten=) so customization is straightforward without a separate
file layer.
9 tests in =tests/test-ai-rewrite.el= cover the defcustom shape,
the wrapper (normal path, no-region error, unknown-directive
error, last-state recording), and the redo (replays prior region,
errors when no previous, excludes the current directive from the
re-pick prompt). =gptel-rewrite= stubbed for tests so no rewrite
UI fires.
*** 2026-05-16 Sat @ 01:59:44 -0500 Built the saved-conversations browser
New module =modules/ai-conversations-browser.el= +
=cj/gptel-browse-conversations= entry point bound to =C-; a b=
(which-key labelled "browse conversations"). Opens a dired-style
=*GPTel-Conversations*= buffer in =cj/gptel-browser-mode= (a
=special-mode= derivative).
Each row shows date, time, topic slug, and a preview of the most
recent message (configurable length via
=cj/gptel-browser-preview-length=, default 60 chars). Rows sort
newest first.
Bindings in the browser:
- =RET= / =l=: load the conversation (delegates to
=cj/gptel-load-conversation= with the file pre-selected via a
=cl-letf= stub on =completing-read= so the user isn't prompted
twice), then bury the browser window.
- =d=: delete the file under point after =y-or-n-p= confirmation,
re-render.
- =r=: rename the file under point; preserves the timestamp,
slugifies the new topic, refuses unchanged input and existing
targets.
- =g=: refresh.
- =n= / =p=: next / previous row.
- =q=: quit-window.
21 tests in =tests/test-ai-conversations-browser.el= cover the
helpers (topic parsing, header stripping, preview shaping for
truncate / short / empty cases, row-for-file with both
conversation and non-conversation filenames, rows enumeration,
render output for empty and populated cases, newest-first sort,
rename-target preservation of timestamp + slug, rename-target
error on missing timestamp) and the file-touching actions (delete
with y, cancel with n, rename, rename-on-empty-line error).
*** 2026-05-16 Sat @ 01:46:55 -0500 Added cj/gptel-quick-ask one-shot command
New module =modules/ai-quick-ask.el=. Bound to =C-; a q= via
=cj/ai-keymap= (which-key labelled "quick ask").
=cj/gptel-quick-ask=: read a prompt in the minibuffer, create the
=*GPTel-Quick*= buffer in =cj/gptel-quick-mode= (a special-mode
derivative with =q= / =escape= / =c= bindings), insert "Q: "
and the response marker, then call =gptel-request= with =:stream t=
streaming into the buffer.
=cj/gptel-quick-dismiss= (=q= / =escape=): delete the window and
kill the buffer. Idempotent when the buffer is absent.
=cj/gptel-quick-continue= (=c=): extract the prompt and response,
seed them into =*AI-Assistant*= under proper org headings (matching
=cj/gptel--fresh-org-prefix= shape), display the side window,
dismiss the quick buffer.
13 tests in =tests/test-ai-quick-ask.el=:
- Pure helpers: initial-text shape, extract-response (normal /
multi-line / no-marker / empty), seed-text shape (with and without
response).
- =ask=: creates the buffer in the right mode with the prompt
recorded, calls =gptel-request=, errors on empty prompt.
- =dismiss=: kills the buffer, no-op when absent.
- =continue=: seeds =*AI-Assistant*= with both prompt and response,
dismisses the quick buffer, errors when called outside a quick
buffer.
=gptel-request= stubbed in tests so no network call happens.
*** 2026-05-16 Sat @ 01:41:51 -0500 Added cj/gptel-autosave-toggle + [AS] mode-line indicator
=cj/gptel-autosave-toggle= flips =cj/gptel-autosave-enabled= in the
current GPTel buffer. Bound to =C-; a A= via =cj/ai-keymap=
(which-key labelled "toggle autosave"). When autosave is OFF and no
filepath is configured, the command prompts to save the conversation
first so a save target exists. When autosave is ON, the command
turns it off.
=cj/gptel-autosave-mode-line-format= surfaces " [AS]" in the
mode-line when autosave is on, blank when off. Installed via a
=gptel-mode-hook= so every GPTel buffer picks it up. The install
helper is idempotent.
6 new tests in =tests/test-ai-conversations.el= cover the enable /
disable paths, the no-filepath prompt path, the
not-a-gptel-buffer error path, the mode-line format evaluation, and
the install idempotence.
** CANCELLED [#D] Add status dashboard for dwim-shell-command processes :feature:
CLOSED: [2026-05-16 Sat 11:12]
This was closed because all of the dwim commands finish before this would be necessary.
Create a command to show all running dwim-shell-command processes with their status.
Currently, there's no unified view of multiple running extractions/conversions.
**Current behavior:**
- Each command shows spinner in minibuffer while running
- Process buffers created: `*Extract audio*`, etc.
- On completion: buffer renamed to `*Extract audio done*` or `*Extract audio error*`
- No way to see all running processes at once
**Recommended approach:**
Custom status buffer that reads `dwim-shell-command--commands`.
Can add mode-line indicator later as enhancement.
** CANCELLED [#D] Track ELPA upstream byte-compile warnings (esxml, poetry) :chore:
CLOSED: [2026-05-16 Sat 11:13]
Fixed the esxml issue in the config. not using poetry any longer
Two ELPA packages emit byte-compile warnings on =make compile= that aren't fixable in this repo:
1. =elpa/esxml-20250421.1632/esxml.el= — =Warning: Unknown type: attrs= and =Unknown type: stringp= (a defcustom =:type= spec).
2. =elpa/poetry-20240329.1103/poetry.el= — =Warning: Case 'X will match 'quote'= for four cases (=post-command=, =projectile=, =project=, =switch-buffer=). Quoted symbols inside =pcase= clauses — should be unquoted upstream.
No action in this repo. Revisit when packages update. File upstream issues if warnings linger past a few months.
Discovered 2026-04-26 in =*Messages*= during compile.
** DONE [#B] ai vterm sizing :feature:
CLOSED: [2026-05-20 Wed]
if on a laptop, ai vterm should come up from the bottom 75%
if on a desktop, ai vterm should come from the right side 50%
Shipped =feedb78= "feat(ai-vterm): default to bottom-75% on laptop, right-50% on desktop". Host-aware defaults via =cj/--ai-vterm-default-direction= / =cj/--ai-vterm-default-size= (branch on =env-laptop-p=); defcustoms =cj/ai-vterm-desktop-width= (0.5) + =cj/ai-vterm-laptop-height= (0.75). 6 new tests. Laptop path confirmed live; desktop path unit-tested, manual GUI check pending until next at a desktop.
** DONE [#C] Dashboard buffer too long :bug:
CLOSED: [2026-05-20 Wed]
The dashboard often opens scrolled — content is partly above the visible
window, the bottom half of content sits in the middle of the screen, and
the actual bottom of the buffer is empty lines. The banner image + the
three navigator rows + several explicit newlines push the content too
high. Even the smallest screen would fit the content if the gratuitous
empty lines were trimmed.
Shipped =4ac1b81= "fix(dashboard): trim padding newlines and reset
window-start on open". Trimmed the startupify padding from five
newlines to two and added =set-window-start= to =point-min= in
=cj/dashboard-only=; characterization test in
=tests/test-dashboard-config.el=. Opens at the top now, verified live.
** DONE [#C] org-contacts-files nil error at launch :bug:quick:
CLOSED: [2026-05-21 Thu]
Root cause: =org-contacts-files= was set via the deferred =:custom=, so it was still nil when the agenda-finalize anniversaries hook fired at launch. Fixed by setting it eagerly at require time + guarding the wrapper. Shipped =099a771=.
Launch emits:
: [org-contacts] ERROR: Your custom variable 'org-contacts-files' is nil.
Surfaced 2026-05-21. =org-contacts-files= isn't set (or is set after org-contacts loads / to an empty value), so org-contacts has no contacts file to read. Fix: point =org-contacts-files= at the intended contacts org file before org-contacts initializes.
** DONE [#B] Verify + commit ai-vterm graceful close (C-S-) :test:quick:
CLOSED: [2026-05-21 Thu]
Verified live (M-f9 closes the agent + tmux session, confirm guard works). Shipped =c38683f=; also consolidated the F9 family onto ai-vterm (M-f9 = close).
Triggered by: 2026-05-20 ai-vterm close command.
=cj/ai-vterm-close= is built but uncommitted (WIP in
=modules/ai-vterm.el= + new =tests/test-ai-vterm--close.el=, 7 tests
passing, clean-load smoke OK). It kills the agent's tmux session, then
its vterm buffer + window, after a =y-or-n-p= confirm. Bound =C-S-=
globally and in =vterm-mode-map=. Needs live verification before commit:
- Launch an agent (F9), press =C-S-=: the confirm prompt fires,
the vterm buffer + window go away, and =tmux ls= shows the
=aiv-= session gone.
- No-agent case: =C-S-= → "No AI-vterm agent buffers to close".
- Confirm guard: answer =n= → the agent stays.
- Confirm the =C-S-= chord actually reaches Emacs (PGTK/Wayland);
pick a different key if a layer swallows it.
Once verified, =/review-code= + commit
=feat(ai-vterm): add graceful agent close on C-S-=.
** DONE [#B] gptel fork not loading: gptel-make-anthropic void :bug:
CLOSED: [2026-05-22 Fri]
:PROPERTIES:
:LAST_REVIEWED: 2026-05-22
:END:
=cj/toggle-gptel= (and gptel chat generally) errors with:
: cj/ensure-gptel-backends: Symbol's function definition is void: gptel-make-anthropic
Surfaced 2026-05-21 (was hit via =M-f9=, which used to run =cj/toggle-gptel=). =gptel-make-anthropic= being void means gptel isn't loaded (or didn't load cleanly) at the point =cj/ensure-gptel-backends= runs. Lead suspect: the 2026-05-18 switch to the local fork via =:load-path "~/code/gptel"= + =:ensure nil= in =modules/ai-config.el= — if the fork doesn't load, none of the =gptel-make-*= constructors are defined. Check that =~/code/gptel= is on the load-path and loads (the prior session also trashed =elpa/gptel-0.9.9.4=, so elpa is no longer a fallback), then confirm =cj/ensure-gptel-backends= runs after gptel is available rather than before.
Note: =M-f9= no longer triggers this — the F9 family was consolidated onto ai-vterm, so =M-= now runs =cj/ai-vterm-close= (permanent). =cj/toggle-gptel= lost its binding in the process; once gptel loads cleanly, decide on a new key for it (or leave it unbound).
** DONE [#C] make test-name aborts on gptel-dependent test files :tests:quick:
CLOSED: [2026-05-22 Fri]
:PROPERTIES:
:LAST_REVIEWED: 2026-05-22
:END:
=make test-name TEST== loads *every* test file before ERT applies the name selector, so an unrelated file that fails to load takes the whole run down. Currently =tests/test-gptel-tools-*.el= (and likely the transcription tests) error at load with =Symbol's function definition is void: gptel-make-tool= because gptel isn't available in batch, aborting with Error 255 even when the selected tests have nothing to do with gptel.
Surfaced 2026-05-21 while running the calendar-sync suite — had to fall back to loading the calendar-sync test files directly. Fix options: guard the gptel-dependent test files to skip cleanly when gptel is absent (e.g. =(when (require 'gptel nil t) ...)= or an ert skip), stub =gptel-make-tool= in a shared testutil, or have =test-name= load only files whose names match the pattern instead of all of them.
Resolution (2026-05-22): the diagnosis above was wrong. The =test-gptel-tools-*.el= files already stub =gptel-make-tool= and =(provide 'gptel)= when gptel is absent, so they load fine in batch. The real abort was =tests/test-system-defaults-functions.el= leaking =default-directory=: it requires =system-defaults=, which runs =(setq default-directory user-home-dir)= at load, and =test-name= then resolved every following relative =-l tests/X.el= against the wrong directory. Fixed in 4fbe435f — =test-name= passes absolute paths to =-l=, and the test contains the leak with a =let=-binding around the require.
** DONE [#C] Consolidate auth-source secret-funcall idiom :refactor:
CLOSED: [2026-05-22 Fri]
:PROPERTIES:
:LAST_REVIEWED: 2026-05-22
:END:
Fixed: extracted =cj/auth-source-secret-value= (host + optional user → secret or nil) into =system-lib.el= (a leaf, so calendar-sync stays off ai-config/gptel). All four callers delegate; ai-config layers its required-secret error on top. Dropped the now-dead =(require 'auth-source)= from the three delegating modules. f6e5885b.
The auth-source lookup + funcall-the-secret block is duplicated four times: =calendar-sync--calendar-url= (calendar-sync.el), =cj/auth-source-secret= (ai-config.el), =cj/--auth-source-password= (transcription-config.el), and =cj/--slack-token= (slack-config.el). All share =(let ((secret (plist-get (car (auth-source-search ...)) :secret))) (if (functionp secret) (funcall secret) secret))=.
Surfaced 2026-05-21 by the code review on the calendar auth-source work — flagged as the fourth copy. Extract one low-level helper into a leaf module both can load (=system-lib.el= or =auth-config.el=), then delegate all four to it. Note the semantics differ: =cj/auth-source-secret= forces =:user "apikey"= and =error=s on miss, while the calendar helper wants a no-user lookup that returns nil on miss — so the shared primitive needs optional user + nil-on-miss, with the erroring/required-user behavior layered on top where needed. Don't make calendar-sync depend on ai-config (it drags in the gptel stack).
** DONE [#B] Keybinding: rewrite TODO+priority as sorted timestamp :feature:quick:
CLOSED: [2026-05-22 Fri]
:PROPERTIES:
:LAST_REVIEWED: 2026-05-22
:END:
*** 2026-05-22 Fri @ 08:35:05 -0500 Approach (revised): finalize-task command, journal-aware + depth-aware
Bound =C-; O d= (=cj/org-map=, d = "date"). Command =cj/org-finalize-task=:
1. Guard: in org-mode, on a heading carrying a non-done todo keyword (else =user-error=).
2. =completing-read= over =org-done-keywords= (dynamic — tracks =org-todo-keywords=; default DONE).
3. =(let ((org-log-done nil)) (org-todo STATE))= — fires the journal-copy hook (=org-roam-config= copies the whole subtree to today's daily under "Completed Tasks"). =org-log-done= is bound nil so the command owns the CLOSED line; the hook keys off =org-state=, not =org-log-done=, so the copy still fires.
4. Dispatch per todo-format (capture the keyword BEFORE the transition):
- level >= 3, OR keyword was VERIFY → dated rewrite: strip keyword + =[#X]= cookie, prepend =(format-time-string "%Y-%m-%d %a @ %H:%M:%S %z")=, keep tags. Done as a text edit, not via =org-todo=, so the hook doesn't double-fire.
- level <= 2 and not VERIFY → close in place: keep the chosen done keyword, add a date-only =CLOSED: [YYYY-MM-DD Day]= line.
Tests: ERT in org temp-buffers with the journal hook bound to nil; the pure transform helper tested directly with an injected TIME for a deterministic stamp. Commit: =feat(org-config): ... with tests=, direct to main.
** DONE [#C] Reconcile duplicate org-log-done setting :refactor:
CLOSED: [2026-05-22 Fri]
=modules/org-config.el= and =modules/org-roam-config.el= both set =org-log-done=, so the effective value was load-order-dependent. Set it once in =cj/org-todo-settings= to ='time= (the dated-completion workflow wants a CLOSED timestamp on every TODO->DONE) and dropped the org-roam duplicate. Fixed in 5f8e1bc7.
Triggered by: 2026-05-22 L56 finalize-task work.
** DONE [#C] Always save the daily after a journal task-copy :feature:
CLOSED: [2026-05-22 Fri]
=cj/org-roam-copy-todo-to-today= (=org-roam-config.el=) only saved today's daily in the refile branch. Pulled the save into =cj/--org-roam-save-daily=, which now runs on both paths and writes only when the buffer is modified, so a crash or shutdown never loses a freshly-copied task. Fixed in f07ce74d.
Triggered by: 2026-05-22 L56 finalize-task work.
** DONE [#B] Collapse dashboard navigator + keymap duplication :refactor:
CLOSED: [2026-05-22 Fri]
:PROPERTIES:
:LAST_REVIEWED: 2026-05-22
:END:
Fixed: extracted a single =cj/dashboard--launchers= table; =cj/dashboard--navigator-rows= and =cj/dashboard--bind-launchers= derive the icon rows and the keybindings from it. Behavior-preserving (verified by tests + a live dashboard check). 5 ERT tests in test-dashboard-config-launchers.el.
Triggered by: 2026-05-18 Dashboard buffer too long refactor audit.
=modules/dashboard-config.el= inlines 12 launcher commands twice — once
as anonymous lambdas inside =dashboard-navigator-buttons= (lines
128-189) and once as anonymous lambdas inside the
=dashboard-mode-map= =define-key= block (lines 200-218). Adding a
13th launcher requires editing two places, and the icon-row order and
keymap order drift independently.
Refactor sketch: a single =defconst cj/dashboard--launchers= holding
=(KEY ICON-FAMILY ICON-NAME LABEL TOOLTIP COMMAND)= tuples, then
derive both =dashboard-navigator-buttons= (grouped 4-per-row) and the
keybindings from that list with a small helper.
** DONE [#C] Dashboard banner subtitle off-center :bug:quick:
CLOSED: [2026-05-22 Fri]
:PROPERTIES:
:LAST_REVIEWED: 2026-05-22
:END:
The banner subtitle "Emacs: The Editor That Saves Your Soul" renders off-center relative to the dashboard width.
Surfaced 2026-05-21. Fixed: dashboard-banner-title-offset 5 → 3 (5 over-shifted left). Verified centered via off-screen capture.
** DONE [#C] Dashboard navigator icons and section titles uncolored :bug:quick:
CLOSED: [2026-05-22 Fri]
:PROPERTIES:
:LAST_REVIEWED: 2026-05-22
:END:
The navigator icons and the "Projects", "Bookmarks", and "Recent Files" section titles render in the default face. They should pick up colors from the Dupre color theme instead.
Surfaced 2026-05-21. Fixed: set dashboard-items-face to steel+2 so the navigator (icons + labels) and the list items pick up a theme color; section titles stay blue via dashboard-heading. Root cause found while debugging: the navigator is rendered with a dashboard-items-face OVERLAY (overlays beat text properties), so the per-button dashboard-navigator face is inert — the nav and the items are painted by the same face, dashboard-items-face. Separating their colors would require overriding that overlay; tracked as a follow-up.
** DONE [#B] ai-vterm popup adds a third split instead of taking a half :bug:next:
CLOSED: [2026-05-25 Mon]
F9 raises ai-vterm in a new split rather than reusing the existing window layout. With the frame already split vertically (two side-by-side windows), F9 produces three columns with ai-vterm wedged in the center; expected: ai-vterm occupies the right half. Same failure horizontally — when the frame is split top/bottom and ai-vterm rises from the bottom, it should take the bottom half instead of adding a third row.
Repro: split the frame in two (vertically or horizontally), press F9.
Likely area: ai-vterm's display/window-placement rule splits the selected window unconditionally instead of reusing the target half (display-buffer-alist / side-window config).
** DONE [#B] projectile open todo in other window :bug:next:
CLOSED: [2026-05-25 Mon]
Opening the project todo via C-c C-p t should always open in the other window if the window is split.
** DONE [#C] Make elfeed-config tests byte-compile-safe :test:
CLOSED: [2026-05-25 Mon]
The =cj/elfeed-process-entries= tests in =tests/test-elfeed-config-helpers.el= only pass when =elfeed-config= loads as interpreted source. The byte-compiled function inlines the =elfeed-entry-link= struct accessor, so the function stubs are bypassed and the inlined accessor type-checks a real =elfeed-entry=. The batch test environment has no elfeed package, so the tests can't build real structs either. Rewrite the tests (define a stand-in =elfeed-entry= cl-struct, or make elfeed loadable in batch) so they survive byte-compilation. This blocks annotating elfeed-config with its load-graph header (the last unclassified init module).
** DONE [#C] Manually verify cj/org-finalize-task journal copy :test:
CLOSED: [2026-05-25 Mon 08:33]
Confirm the live behavior the unit tests mock out. In a real Emacs (org-roam loaded), run =C-; O d= on a level-3 sub-task and on a level-2 task. Expect the sub-task to flip to a dated entry, the level-2 to keep its keyword and gain a date-only CLOSED line, and in both cases a copy to land in today's daily under "Completed Tasks".
Triggered by: 2026-05-22 L56 finalize-task work.
** DONE [#C] Org TODO-keyword colors not dupre-themed :bug:
CLOSED: [2026-05-25 Mon]
Fixed in 32cfe216: org-todo-keyword-faces and org-priority-faces now point at named dupre-org-* faces (closest palette color per keyword) with dimmed variants for unfocused windows. Root cause was that dupre defined its own faces only via custom-theme-set-faces, never defface, so they failed when applied directly; added a defface registration block for all dupre faces.
The org TODO/DOING/DONE (and other keyword) colors don't match the dupre palette — they're showing default org colors rather than dupre tones. Likely needs changes in two places: the org keyword faces in the theme (=org-todo=, =org-done=, =org-headline-done=, and friends in =themes/dupre-faces.el=) and any =org-todo-keyword-faces= mapping set in the org config (=org-config.el= / =org-capture-config.el=), which may hardcode non-dupre colors. Reconcile both so keyword colors come from the palette.
Triggered by: 2026-05-25 auto-dim theming work.
** DONE [#C] Make standalone byte-compile load paths match module dependencies :tests:cleanup:
CLOSED: [2026-05-25 Mon]
Resolved: added =make compile-file FILE== (load path = modules + themes + tests + package-initialize) as the documented single-file compile command, plus =-L themes= on =make compile=. Bare =emacs -Q= stays unsupported by design; the documented command resolves local compile-time deps. Verified dashboard-config.el (undead-buffers) and dupre-faces.el (dupre-palette) both compile. The parallel PostToolUse byte-compile hook also wants =-L themes=, but =.claude/hooks/validate-el.sh= is rulesets-owned (synced at startup, so a local edit reverts), so that fix is routed to the rulesets inbox rather than committed here.
Bare =emacs -Q --batch --eval '(byte-compile-file "modules/dashboard-config.el")'= fails because =undead-buffers= is not on the load path, even though normal init/test loading succeeds. Decide whether standalone compile checks should use the project test harness/load path, or whether modules with compile-time local dependencies should add explicit load-path setup or lighter declarations.
Acceptance:
- =dashboard-config.el= can be byte-compiled through the documented local command without missing =undead-buffers=.
- The fix generalizes to other modules with local compile-time dependencies instead of special-casing only dashboard.
- Document the intended command in the Makefile/test docs if the answer is "use the harness, not bare =emacs -Q=".
Triggered by: 2026-05-25 dashboard transparency and vterm auto-dim work.
** DONE [#C] latex-config WIP state :refactor:
CLOSED: [2026-05-25 Mon]
The =init.el= require for =latex-config= carried a bare "WIP need to fix" comment with no detail on what was broken. Retired that comment while classifying foundation modules; the underlying state still needs investigation. Read =modules/latex-config.el=, determine what's incomplete, and either finish it or scope a real task.
Investigated 2026-05-25. The comment came from the original repo import (=092304d9=); no detail about the original breakage survives. The module byte-compiles clean and works. =company-auctex= is not a current bug — company is still the live framework, and its removal is already scoped under the corfu-migration spec below. Found one real defect: =cj/--latex-select-pdf-viewer= ran on every LaTeX buffer and blindly pushed onto =TeX-view-program-selection=, stacking duplicate =output-pdf= entries against its own idempotency docstring. Fixed in =b007a9b8= (remove-then-cons) and added =tests/test-latex-config.el= (the module had none) covering selection, preference order, fallback, idempotency, and default override.
** DONE [#C] Org tag column too close to the heading text :org:display:
CLOSED: [2026-05-26 Tue]
Shipped in commit 63192749: =org-tags-column= set to 0 plus a font-lock display property that right-aligns tags to the window edge, tracking width live with nothing baked into files. It was an org display setting, not pearl. The same change covers the inline "align further out" note that was queued separately.
** DONE [#C] mu4e launch removes the window split :quick:solo:
CLOSED: [2026-05-26 Tue]
Shipped in commit 3acdb28e. Root cause was mu4e's main-view =display-buffer-full-frame= action (mu4e-window.el), not =delete-other-windows= on start. Fixed via a =display-buffer-alist= entry (mu4e's documented override point) routing =*mu4e-main*= to the current window (reuse-window then same-window), so the split survives. Registered eagerly so it applies on first launch. Tests cover registration + split preservation.
** DONE [#C] Slack window should open in the other window when split :quick:solo:
CLOSED: [2026-05-26 Tue]
Shipped in commit 6c7f9ae2: =slack-buffer-function= set to =cj/slack--display-buffer= (=pop-to-buffer= with =inhibit-same-window= + reuse/use-some/pop-up action), so a room reuses the split's other window and never takes over the selected one. Tests cover split-placement and the selected-window-preserved invariant.
** DONE [#B] Restore the daily-prep keybinding under Projectile :feature:keybinding:
CLOSED: [2026-05-26 Tue]
Shipped in commit 8e5efcab and verified live: =C-c p d= opens =inbox/today-prep.org= in the other window, project-scoped; deadgrep-in-dir moved to =C-c p G=, plain deadgrep dropped, deadgrep-here stays on =C-c p g=. Settled questions: lowercase d, per-project, other window via =find-file-other-window=. Tests in =tests/test-prog-general-open-project-daily-prep.el=.
=C-c p d= should open the project's daily prep (=/inbox/today-prep.org=, a stable symlink) and no longer works. Keep it project-scoped under Projectile on purpose: the daily prep only exists in the work project, so a project-scoped opener in =projectile-command-map= is the right home, mirroring =cj/open-project-root-todo= (=C-c p t=). Filed from the work-project session 2026-05-26 — it's an Emacs-config change, so it lives here.
Root cause: there is no daily-prep binding or opener anywhere in the config (checked the modules and the running daemon — no "prep" function). It was almost certainly eval'd live into the daemon in a past session and never written to a module, so it vanished on restart. The fix must be persisted to a module, not just eval'd live. =C-c p d= currently resolves to =cj/deadgrep-in-dir=, so the =d= slot is taken.
Approach: mirror =cj/open-project-root-todo= at =modules/prog-general.el:175= and its =:bind (:map projectile-command-map ...)= block (lines 153-155). The prep file is in a subdir (=inbox/today-prep.org=), not the project root, so target the subdir path directly rather than =cj/find-project-root-file= (which only scans the root):
#+begin_src emacs-lisp
(defun cj/open-project-daily-prep ()
"Open inbox/today-prep.org in the current Projectile project root."
(interactive)
(if-let ((root (projectile-project-root)))
(let ((file (expand-file-name "inbox/today-prep.org" root)))
(if (file-exists-p file)
(cj/--find-file-respecting-split file)
(message "No inbox/today-prep.org in project: %s" root)))
(message "Not in a Projectile project")))
#+end_src
Open questions to settle when we tackle it:
- Which key? =d= is taken (=cj/deadgrep-in-dir=). Free lowercase in =projectile-command-map=: =h=, =n=, =w=, =y= (none a strong "daily prep" mnemonic). Or override =d=, or add a sub-prefix.
- Behavior outside the work project? Resolving relative to =projectile-project-root= makes it per-project; only work has a prep doc, so elsewhere it hits the "No prep" message. Acceptable, hard-scope to work, or offer to create one?
- Same window or other window? Mirror =cj/open-project-root-todo='s =cj/--find-file-respecting-split=, or plain =find-file=?
** DONE [#B] Headline indicators wrap to a second row :bug:org:
CLOSED: [2026-05-27 Wed]
Fixed 2026-05-27 (commit 822e7a37). =cj/org-tag-right-margin= raised from 5 to 9 in =modules/org-config.el:111= — sized empirically from a rendered measurement via the headless screenshot harness, not from column arithmetic (the trailing " · ▾" measures 4 cols by =string-width= but the fallback ▾ renders wider than reported and =:align-to= stretch rounds, so the real overflow exceeded the nominal count). Regression fixture checked into =tests/manual/headline-wrap/{fixture.org,README.org}=.
Trigger had been: a heading carrying both an org-tidy =·= (hidden =:PROPERTIES:= drawer) and the fold ellipsis " ▾" (folded with subtree) wrapped past the window edge because the reservation didn't account for the indicator pair under the rendered (not nominal) width.
** CANCELLED [#B] Rework dev F-keys: compile+run (F4), test (F6), coverage (F7) :feature:
CLOSED: [2026-05-28 Thu]
:PROPERTIES:
:LAST_REVIEWED: 2026-05-22
:END:
Superseded by the F-key Completion task below. The 2026-05-27 audit found this ticket roughly 75% shipped (F4 dispatcher, F7 coverage, format-key migration off F6 all in); the remaining 25% (Phase 2b — per-language test discovery, "Run a test..." menu, M-F6 fast path, buffer-local last-test, "No tests found" error) is now tracked there with its own evidence-backed child tasks.
*** TODO [#B] Format keybindings move off F6 :refactor:cleanup:
Move blacken-buffer (python), shfmt-buffer (sh), and clang-format-buffer (c)
off F6 onto the =C-; f= prefix, which already hosts format-buffer bindings.
Also remove projectile-run-project from F6 (it folds into the new F4).
Touch the per-language config modules that currently bind F6 for formatting.
Acceptance: F6 has no remaining format-or-run bindings in any module; =C-; f=
prefix triggers the right formatter per major mode.
Depends on: none (start here -- clears F6 before F4/F6 work lands).
*** TODO [#B] Project-type detection helper :feature:
Single helper that returns a project-type symbol (=compiled=, =interpreted=,
=unknown=) from the current buffer's project. Uses
=projectile-project-compilation-cmd= when set, then heuristic fallbacks:
=go.mod=, =Makefile=, =Eask=, =package.json=, =pyproject.toml=,
=docker-compose.yml=. Lives near the F4 dispatcher.
Acceptance: ERT tests cover each heuristic in isolation plus a precedence
case where projectile's cached cmd wins over the file heuristics.
Depends on: none.
*** TODO [#B] F4 compile+run dispatcher :feature:
Build the F4 binding per spec: plain F4 opens a completing-read whose
candidates depend on project-type (Compile / Run / Compile + Run [default] /
Clean + Rebuild for compiled; Run only for interpreted). C-F4 fast-paths to
Compile; M-F4 fast-paths to Clean + Rebuild. Both fast paths show a "not a
compiled language" message and no-op on interpreted projects. Reads
projectile's per-project compile/run commands; no Docker-specific logic.
Acceptance: each candidate dispatches to the right projectile command; fast
paths no-op cleanly on interpreted projects; F4 bindings live in one module.
Depends on: project-type detection helper.
*** TODO [#B] Per-language test discovery :feature:tests:
Provide a single =cj/--tests-in-buffer= function returning a list of test
names for the current buffer's language. Tree-sitter queries for Python,
Go, TS/JS (treesit-auto already configured); built-in sexp scan for elisp
(=ert-deftest= forms). Parsing unopened test files uses with-temp-buffer +
insert-file-contents + -ts-mode + treesit-query-capture. Queries are
spelled out in the spec above.
Acceptance: ERT tests feed each language a fixture file and assert the
expected test-name list comes back; missing grammar surfaces a clear error.
Depends on: none (parallel-safe with F4 work).
*** TODO [#B] F6 test dispatcher :feature:tests:
Build the F6 binding per spec: plain F6 opens completing-read with "All
tests", "Current file's tests", "Run a test..."; C-F6 fast-paths to current
file's tests; M-F6 fast-paths to "Run a test...". "Current file's tests"
runs the buffer directly if it's a test file, otherwise finds matching test
files via language conventions (elisp =tests/test-*.el=, python
=tests/test_.py=, etc.) and runs them aggregated. "Run a test..."
pre-selects =cj/--last-test-run= (buffer-local) and errors with "No tests
found for " when discovery returns nothing -- no silent fallthrough.
Acceptance: each entry point dispatches to the right runner; buffer-local
last-test memory persists per source file; no-match error fires correctly.
Depends on: per-language test discovery.
*** TODO [#B] F7 hand-off to dev-fkeys story :feature:
Once the coverage track ships ([[id:7d7f4486-fad7-4f0a-bd9a-775bd4cd8f7e][docs/specs/coverage-spec-implemented.org]]),
confirm F7 binds =cj/coverage-report= and lives alongside F4/F6 in the same
dev-fkeys module so the three keys read as one unit. No new coverage logic
here -- only the binding placement and a short comment block in the module
pointing at the coverage design doc.
Acceptance: F7 invokes coverage-report; F4/F6/F7 are visibly grouped in one
module; coverage track is shipped before this lands.
Depends on: the coverage-config track shipping; F4 and F6 sub-tasks above.
*** 2026-05-15 Fri @ 19:16:08 -0500 Specification
Consolidate the developer F-key block into a coherent sequence. F5 reserved for debug (separate ticket). Format bindings move off F6 to C-; f.
Menu mechanism: =completing-read= everywhere (consistent with F7 coverage scope prompt and with the vertico/consult workflow in the rest of the config). No transient definitions.
**F4 — compile + run**
- F4 (no modifier): completing-read with candidates filtered by project type. Detection via projectile-project-compilation-cmd and heuristic fallbacks (go.mod, Makefile, Eask, package.json, pyproject.toml, docker-compose.yml).
- Compiled project candidates: "Compile", "Run", "Compile + Run" (default), "Clean + Rebuild"
- Interpreted project candidates: "Run" only
- C-F4: fast path = Compile only. On interpreted projects, shows "not a compiled language" and no-ops.
- M-F4: fast path = Clean + Rebuild. Same "not applicable" behavior on interpreted projects.
The dispatcher reads projectile's per-project compile/run/test commands. No Docker-specific logic in the command itself. Container workflows are configured via projectile's prompt-and-cache (or .dir-locals.el from the dev-project-setup helper).
**F6 — run tests**
- F6 (no modifier): completing-read top-level:
- "All tests"
- "Current file's tests"
- "Run a test..." (nested completing-read with individual tests)
- C-F6: fast path = "Current file's tests"
- M-F6: fast path = "Run a test..."
"Current file's tests": if current buffer is a test file, run it directly. If source file, find matching test file(s) via language conventions (elisp: tests/test-*.el; python: tests/test_.py; etc.) and run them aggregated.
"Run a test...": build a candidate list of individual tests, pre-select the last-chosen test for this buffer (buffer-local cj/--last-test-run), present via completing-read. Pressing RET re-runs last. Memory is buffer-local so different source files remember their own last-test.
Candidate set for "Run a test...":
- If buffer is a test file: parse the file, return its test definitions.
- If buffer is a source file: find matching test file(s) and aggregate their test definitions.
- No matches: error out with "No tests found for ". Don't silently fall through.
Per-language test discovery:
- Python, Go, TypeScript/JavaScript: tree-sitter queries (treesit-auto already configured, grammars auto-install)
- Python: (function_definition name: (identifier) @name (:match "^test_" @name))
- Go: (function_declaration name: (identifier) @name (:match "^Test" @name))
- TS/JS: (call_expression function: (identifier) @fn arguments: (arguments (string) @name) (:match "^\\(test\\|it\\)$" @fn))
- Parsing unopened test files: use with-temp-buffer + insert-file-contents + python-ts-mode (etc.) + treesit-query-capture
- Elisp: built-in sexp navigation; scan for (ert-deftest ...) forms. No tree-sitter needed.
*F7 — coverage* (already designed in docs/specs/coverage-spec-implemented.org)
**Required moves:**
- Move blacken-buffer (python), shfmt-buffer (sh), clang-format-buffer (c) off F6 to C-; f prefix (already the format-buffer prefix).
- Move projectile-run-project off F6 (folds into the new F4 completing-read).
**Ordering:**
Do this after the coverage-config work ships. No churn mid-flight.
** DONE [#D] Evaluate and integrate Buttercup for behavior-driven integration tests :tests:
CLOSED: [2026-05-28 Thu]
Evaluation landed at [[file:docs/design/buttercup-evaluation.org][docs/design/buttercup-evaluation.org]]. Verdict: not yet — ERT is enough for every project Craig owns today. Adopt Buttercup the moment a project crosses the threshold "the test reader is no longer the test author at write-time" (concrete trigger events listed in the doc). Re-read the doc when any such event fires.
** DONE [#A] f9 should toggle the entire ai-vterm split, not just the buffer
CLOSED: [2026-06-02 Tue]
F9 toggle-off now collapses the agent split (delete-window) instead of quit-restore-window, which went stale across multi-agent slot reuse and surfaced a different agent. Toggle-on reopens the exact agent that was hidden (cj/--ai-vterm-last-hidden-buffer). Sole-window toggle-off returns to the most-recent non-agent buffer. Split width preserved across the toggle.
** DONE [#C] Descriptive completing-read prompts :feature:ux:
CLOSED: [2026-06-02 Tue]
:PROPERTIES:
:LAST_REVIEWED: 2026-06-02
:END:
Reworded 17 picker prompts across 8 modules so each names the operation (C-f8 "Project:" → "Show agenda for project:", "F6:" → "Run tests:", the dwim-shell sub-prompts, both contact pickers, dirvish ediff, org finalize, and the custom-comments length/box-style prompts). Audited ~124 completing-read / read-* sites; the rest already named their operation.
Audit every =completing-read= (and =read-*= picker) prompt in the config so the prompt names the operation about to happen, not just the kind of thing being chosen. The prompt is the only confirmation the user gets before committing to an action, so a generic one leaves a mis-keyed command ambiguous.
Concrete trigger: C-f8 (project-filtered agenda) prompts just "Project". If Craig meant C-f9 (AI-vterm project picker) and hit C-f8 by accident, the bare "Project" prompt gives no signal which operation he's about to run — both pick a project, for different ends.
Goal: each picker prompt makes the pending operation obvious, e.g. "Agenda for project: " vs "Open AI vterm for project: ". Sweep the call sites (grep =completing-read=, =read-directory-name=, =read-file-name=, =completing-read-multiple= across modules/), reword the ambiguous ones, keep the wording short.
Filed 2026-06-02 from a C-f8/C-f9 mix-up. Priority set [#C] (UX polish) — re-grade if it deserves higher.
** CANCELLED [#C] Finish terminal GPG pinentry configuration :feature:
CLOSED: [2026-06-02 Tue]
:PROPERTIES:
:LAST_REVIEWED: 2026-06-02
:END:
Superseded by "Terminal GPG pinentry Completion" below. That task's 2026-05-27 audit found the =terminal-pinentry= branch is gone (no local/remote ref, no reflog, no stash, no worktree), so the work restarts from main and is tracked there. Consolidated 2026-06-02.
Continue work on terminal-mode GPG passphrase prompts (loopback mode).
Branch: terminal-pinentry
Changes in progress (modules/auth-config.el):
- Use epa-pinentry-mode 'loopback in terminal
- Use external pinentry (pinentry-dmenu) in GUI
- Requires env-terminal-p from host-environment module
** DONE [#B] Emacs Manual Testing and Validation :verify:
CLOSED: [2026-06-06 Sat 13:59] SCHEDULED: <2026-05-29 Fri>
:PROPERTIES:
:LAST_REVIEWED: 2026-05-28
:END:
Hand-verify checklist Craig walks one item at a time after the relevant code lands. Each child names what is being verified, the exact steps to run, and the observable expected result. On pass, the child gets marked or deleted. On fail, the actual behavior gets logged under the step and the child is promoted to a top-level =TODO= bug per the verification.md handoff rule.
Walk started 2026-05-28 (tests 1 + 2 verified — surfaced two Signel bugs along the way, both fixed before continuing). Deferred to 2026-05-29: test 3 onward needs sending an actual Signal message, too late at night to be polite about it. 2026-06-11: Craig confirmed the send half (contact send + Note-to-Self delivery) — closed as a dated entry below. Still unwalked: input-survives-incoming, dashboard, stop-teardown, refresh, font-setup-post-TTY, and the non-Signel capture/calibredb/nov children.
*** Project-aware capture: C-c c t files into the project's Open Work
What we're verifying: inside a projectile project that has a root todo.org, C-c c t (Task) files the new entry under that project's " Open Work" heading.
- Open a file inside a projectile project whose root has a todo.org (e.g. this one, ~/.emacs.d).
- Press C-c c, then t.
- Type a short task, finish with C-c C-c.
Expected: the entry lands as a new level-2 TODO at the top of that project's "... Open Work" heading (e.g. "Emacs Open Work"), not in the global inbox.
*** Project-aware capture: C-c c b files a [#C] bug
What we're verifying: C-c c b (Bug) behaves like the Task capture but stamps the entry [#C].
- Inside the same project, press C-c c, then b.
- Type a short bug description, finish with C-c C-c.
Expected: a level-2 "TODO [#C]" entry lands at the top of the project's "... Open Work" heading.
*** Nov bookmark naming: "Author, Title" instead of the raw filename
What we're verifying: bookmarking your place in an EPUB names the bookmark "Author, Title" parsed from the filename (Calibre's " - .epub"), reordered with the colon restored — not the raw filename.
- Open an EPUB in nov (m is bound to bookmark-set there).
- Press m to set a bookmark.
- Look at the default name in the bookmark prompt.
Expected: the default is ", " (e.g. "Agatha Christie, The A.B.C. Murders"; a colon where the filename had "_ "), no extension, no underscores — not the raw filename.
*** Calibredb curated menu on ? and full dispatch on H
What we're verifying: in the calibredb buffer, ? opens the curated workflow menu and H opens calibredb's full dispatch.
- M-B to open calibredb.
- Press ?.
- Press a key for a workflow (e.g. o to open, f format filter), or q to quit the menu.
- Press H.
Expected: ? shows the curated transient (Library / Filter / Sort / Book columns with your workflows); the keys run the right calibredb commands; q quits. H shows calibredb's full menu.
*** Calibredb description docks to the bottom 30%
What we're verifying: viewing a book's description docks it to the bottom 30% and q dismisses it.
- M-B, move to a book.
- Press ? then d (or v).
- Read the description.
- Press q.
Expected: the *calibredb-entry* detail buffer opens docked across the bottom ~30% of the frame (not full-window); q closes it and returns to the list.
*** Project-aware capture: inbox fallback + warning
What we're verifying: outside a project (or in a project with no todo.org) the capture falls back to the global inbox; the no-todo.org case also warns.
- Open a scratch file not inside any projectile project, C-c c t, type a task, C-c C-c. Expect it under "Inbox" in the global inbox file.
- (If easy) open a file in a projectile project that has NO todo.org, C-c c t. Expect it in the global inbox AND an echo-area message naming the project.
*** 2026-05-28 Thu @ 02:13:55 -0500 Verified: connect starts the daemon (after fix)
=C-; M SPC= → "Signel connected." in echo area; =M-x list-processes= shows =signal-rpc= running (PID 1775279, command =/usr/bin/signal-cli -a +1510...=). Two bugs surfaced and fixed during the verify:
- The =with-eval-after-load 'keybindings= binding at =signal-config.el:280= didn't take effect on a fresh Emacs restart; a live-reload of =signal-config.el= activated the =C-; M= prefix. Logged as a separate top-level TODO for follow-up (load-order or use-package interaction).
- =cj/signel--ensure-started= referenced =signel--process-name= before signel had been autoloaded — the bare forward-declared =(defvar signel--process-name)= didn't actually bind the variable. Fix: added =(require 'signel)= at the top of the function (=signal-config.el:170=) so the package loads before any of its private variables are read. New ERT test =test-signal-config-ensure-started-requires-signel= captures the bug.
*** 2026-05-28 Thu @ 02:16:45 -0500 Verified: picker opens with contact names
=C-; M m= → minibuffer opened within ~1s, "Note to Self" pinned at the top, the 94 Signal contacts followed labeled "Name (+number)". Picker behavior matches spec. Surfaced a follow-up on the chat buffer that opens after a pick — placement + exit keys want refining; filed under L44 Signel.
*** 2026-06-11 Thu @ 09:30:11 -0500 Verified: send delivery (contact send + Note-to-Self)
Craig walked the send half by hand and confirmed it 2026-06-11: a picked contact's chat buffer sends through =signel--send-input= and the message arrives on the recipient's phone; Note-to-Self (=C-; M s= and the picker's pinned entry) resolves to =signel-account= and lands in the phone's *Note to Self* thread. Same session, the receive/RPC side was re-verified live in the daemon: =listContacts= round-trip returned 93 contacts, =*signel-stderr*= empty, =C-; M= prefix bound.
*** Signel: typed input survives an incoming message
What we're verifying: the clobber fix (fork commit 5ec56c0) preserves in-progress prompt input across =signel--insert-msg= when a message arrives mid-typing.
- =C-; M m=, pick a contact.
- Type a long unsent message at the prompt, do NOT press =RET=.
- From a second device or by asking someone, send yourself a Signal message that lands in this chat (or any active chat).
Expected: the incoming message renders above the prompt, the prompt redraws, and your typed text is still there at the prompt ready to send.
*** Signel: dashboard opens
What we're verifying: =signel-dashboard= (=C-; M d=) opens the active-chats dashboard.
- Press =C-; M d=.
Expected: a dashboard buffer opens listing active chats.
*** Signel: stop tears down the daemon
What we're verifying: =signel-stop= (=C-; M q=) deletes the process and clears the request-handler / buffer maps (the reconnect-invalidation contract from fork commit 4740d97).
- Press =C-; M q=.
- =M-x list-processes=.
Expected: echo area shows "Signel service stopped.", and =list-processes= no longer lists =signal-rpc=.
*** Signel: refresh forces a fresh contact fetch
What we're verifying: =cj/signel-refresh-contacts= clears the cache and re-fetches via the new callback contract.
- =C-; M SPC= to reconnect if you ran the stop test above.
- =M-x cj/signel-refresh-contacts=.
- Immediately =C-; M m=.
Expected: the picker still opens cleanly with the same contact list (the refresh is silent; the picker is the visible check). If you added a contact on the phone, it now appears.
*** Font setup reaches a GUI frame created after a TTY frame (daemon)
What we're verifying: emoji glyphs + fonts apply in a GUI frame even when the first daemon frame was a TTY.
- emacs --daemon
- emacsclient -t (TTY frame first)
- emacsclient -c (then a GUI frame)
- in the GUI frame, open a buffer with an emoji and check it renders, and M-S-f / fonts look right
Expected: emoji renders and fonts are applied in the GUI frame.
*** ghostel migration: Claude Code TUI in a GUI frame
What we're verifying: an agent runs in ghostel with good rendering (the reason for the engine swap).
- restart Emacs (the migration changes load order + a use-package :config block)
- in a GUI frame press F9, pick a project, let Claude stream a long response (big diff or file read)
Expected: colors look right (not washed out), no flicker/strobing during the stream, box-drawing and the cursor render correctly.
*** ghostel migration: Claude Code TUI in a TTY frame (replaces the old refuse test)
What we're verifying: D4 dropped the GUI-only guard, so F9 now launches in a terminal frame too.
- emacsclient -t (TTY frame, off the running daemon)
- in the TTY frame press F9 and pick a project
Expected: the agent launches and renders as text + color in the TTY (no echo-area refusal message); inline images are absent, which is expected.
*** ghostel migration: F9 / C-F9 / M-F9 dispatch
What we're verifying: the agent dispatch behaves as it did on vterm.
- F9 toggles the agent window off/on; C-F9 always opens the project picker; M-F9 closes (kills the tmux session) after confirm
- press F9 from inside an agent buffer (full-frame) — it should toggle, not get swallowed by the terminal
Expected: each chord does its job from both normal and agent buffers.
*** ghostel migration: tmux integration + C-; x menu
What we're verifying: the tmux machinery ported intact.
- launch an agent; M-x list it — runs in tmux session aiv-
- second F9 on the same project reattaches (no duplicate session)
- C-; x h captures the tmux pane history into an Emacs buffer; C-; x c enters tmux copy-mode
- C-; x l clears scrollback; C-; x n / p navigate prompts
Expected: all menu commands work against the ghostel buffer; history capture + copy-mode behave as before.
*** ghostel migration: copy-mode parity + mouse wheel
What we're verifying: copy/selection and wheel scrolling survived the engine swap.
- in a ghostel buffer enter copy-mode (C-; x c without tmux, or the tmux path with tmux); M-w copies and stays; q / C-g exit
- mouse-wheel scroll inside tmux, inside Claude Code, and inside lazygit
Expected: M-w copies without leaving; q/C-g exit; the wheel scrolls the program (this replaces the removed vterm wheel-forwarding — confirm ghostel's native SGR mouse covers it).
*** ghostel migration: other TUIs + ssh
What we're verifying: general terminal workloads render.
- run lazygit, htop/btop, a heavy-output build, and ssh to a remote host in a ghostel terminal (F12)
Expected: each renders and behaves correctly; ssh out works (if a remote lacks xterm-ghostty terminfo, note it — ghostel-ssh-install-terminfo / ghostel-term is the lever).
*** ghostel migration: F12 general terminal + dashboard launcher
What we're verifying: F12 manages non-agent terminals only, and the dashboard launcher uses ghostel.
- F12 opens/toggles a general terminal; confirm it does NOT grab an agent buffer; resize it, toggle off and on — geometry is preserved
- from the dashboard press t (Terminal) — opens a ghostel terminal (tooltip reads "Launch Terminal")
Expected: F12 excludes agent buffers and keeps saved geometry; the dashboard launches ghostel.
*** ghostel migration: crash recovery
What we're verifying: the aiv- tmux session survives an Emacs crash and reattaches.
- with a live agent, kill Emacs (not the tmux session); restart Emacs; F9 → project picker
Expected: the project shows "[detached]" and reattaches to the surviving tmux session.
** DONE [#B] Color-family grouping for hue-adjacent warm colors :feature:theme-studio:research:
CLOSED: [2026-06-10 Wed]
Resolved by two independent reviews of =~/color-sorting.org= (=~/color-sorting-codex.org=, =~/color-sorting-fable.org=, Fable's harness at =~/working/color-sorting-fable/=). Both converged on lightness-conditioned complete-linkage clustering + a floored neutral threshold; implemented in commit =04b82bbe= (replacing the hue anchors). Measured F1 0.63→0.96 on the real palette: gold and olive separate, red/blue ramps stay whole, intense-red isolates, all grays/steels consolidate, and the gray+1/gray+2/white neutral-leak bugs are fixed. The only residual (pale yellow+2 lands on the olive ramp) is geometrically irreducible from the hex — see the hint-override task below.
** DONE [#B] theme-studio comprehensive previews (org/magit/elfeed/ghostel/mu4e/dashboard) :feature:theme:theme-studio:
CLOSED: [2026-06-08 Mon]
Expanded the bespoke previews to near-complete face coverage and added three new ones. org now exercises 83/88 faces (document + agenda; the 5 skipped are non-visual: org-hide, org-indent, org-clock-overlay, org-default, org-date-selected). magit 97/98 (status buffer + blame/reflog/sequence/bisect/signature sampler rows). elfeed 13/13. New bespoke previews: ghostel 19/19 (mock terminal, 16 ANSI colors + default + fake cursor), mu4e 37/37 (curated face list, not in the generated inventory; headers list + message view + compose), dashboard 8/8. So clicking a face row flashes a real preview element for nearly every face. Originally filed as just the org preview.
** DONE [#A] theme-studio theme.json -> dupre-*.el converter :feature:theme:theme-studio:
CLOSED: [2026-06-08 Mon]
Built as scripts/theme-studio/build-theme.el (sibling to build-inventory.el), emitting a single self-contained themes/-theme.el deftheme (not the palette/faces/theme trio — a theme.json carries resolved per-face hex, not dupre's semantic layer). All four tiers convert: default from assignments.bg/.p, syntax categories -> font-lock/tree-sitter faces with bold/italic sets, UI passthrough, packages with :inherit/:height/weight/slant. 20 ERT tests in tests/test-build-theme.el (Normal/Boundary/Error + an end-to-end load + a WCAG-AA assertion on the round-tripped result). One mapping limitation documented: the dec (decorator) key has no independent Emacs face (Emacs renders decorators with font-lock-type-face, which ty owns), so dec is omitted and decorators follow the type color.
The last link in the pipeline: turn a theme.json exported by the theme-studio into a real loadable Emacs theme. Elisp (per Craig), TDD — this is the correctness-sensitive piece.
Inputs (all on disk; no chat history needed):
- theme.json contract: =scripts/theme-studio/README.md= (theme.json section) and =docs/specs/theme-studio-package-faces-spec-doing.org= (State and export policy, Relative height, Inheritance).
- Reference face layout: existing =themes/dupre-palette.el= + =themes/dupre-faces.el= + =themes/dupre-theme.el=, and =tests/test-dupre-theme.el= (WCAG-contrast helper to reuse).
- Conventions: =.claude/rules/elisp.md=, =.claude/rules/elisp-testing.md=.
Scope:
1. Read theme.json. Set =default= from =assignments.bg= / =assignments.p=.
2. Author the syntax category -> font-lock face map (~21 keys: kw->font-lock-keyword-face, str->font-lock-string-face, fnd->font-lock-function-name-face, fnc->font-lock-function-call-face, op->font-lock-operator-face, punc->font-lock-punctuation-face, etc. incl. the Emacs-29 tree-sitter additions). Apply =bold= / =italic= sets.
3. UI faces: the =ui= keys are already real face names (region, cursor, mode-line, ...) -> near 1:1 passthrough of fg/bg.
4. Package faces: =packages= -> each face spec, writing =:inherit PARENT= for inherited faces + only the overridden attrs, =:height= when != 1.0, weight/slant.
5. Emit a deftheme file (or palette+faces+theme trio mirroring dupre's layout).
TDD targets: old-JSON (no packages) loads; every category maps; round-trip of fg/bg/bold/italic/inherit/height into valid face specs; WCAG-contrast assertion on the result. Decide whether the converter lives under =scripts/theme-studio/= (emits to =themes/=) or =themes/=.
** DONE [#B] theme-studio tier-3 package faces :feature:theme:theme-studio:
CLOSED: [2026-06-08 Mon]
Package-specific face editing in the theme-studio: org/magit/elfeed bespoke (complete face tables + live previews) plus a generated all-package inventory so every installed package is themeable. Spec is Ready, all opens resolved: [[id:8f37a1fd-cfd3-4b25-92e5-772468092bdc][docs/specs/theme-studio-package-faces-spec-doing.org]]. Phases below run in dependency order; phases 1-5 deliver the three high-value apps, phase 6 opens the long tail, phase 7 documents. The =theme.json= -> =dupre-*.el= converter (Elisp) is a separate downstream task.
*** 2026-06-08 Mon @ 00:17:41 -0500 Phase 1 — package state + schema landed
Added =APPS= (org starter) and =PKGMAP= ({app:{face:{fg,bg,bold,italic,inherit,height,source}}}), pure helpers (=seedPkgmap= / =packagesForExport= / =mergePackagesInto=), and wired export/import for the =packages= key with old-JSON compat. The =height= float (relative size, read off the face not cascaded through inherit) and the fixed-pitch inherits are seeded in the org starter. No UI yet (Phase 3). Verified: node-check, plus a guarded =#selftest= harness (headless Chrome) confirming seed->export->import round-trip, old-JSON merge, and inherit/height/source survival — all PASS.
*** 2026-06-08 Mon @ 02:16:24 -0500 Phase 2 — curated app data (org/magit/elfeed) landed
Filled =APPS= with the complete own-defface sets built from embedded face-name lists + a curated seed-color map: org 88 (85 seeded, incl. org-agenda, heading heights, fixed-pitch inherits), magit 98 (64 seeded), elfeed 13 (all seeded). Long-tail faces seed to default fg. Verified: 199 faces total, no seed typos / no dupes, schema self-test PASS seeding all of them. Seeded-default aesthetics still go to Manual testing once the Phase 3 UI lands.
*** 2026-06-08 Mon @ 02:23:56 -0500 Phase 3 — package face table UI landed
Added the "package faces" section: app selector (org/magit/elfeed), per-app face table with fg/bg dropdowns, bold/italic toggles, inherit dropdown (base faces + the app's own faces), relative-height stepper, live contrast readout on the effective (inherit-resolved) color, per-face and per-app reset, and a text filter. Refactored the fg/bg dropdown into a shared =colorDropdown= helper the ui-faces table now also uses (no =uiSelect= fork). Palette edits propagate to package faces; import/export carry them. Right pane is the generic preview (face names in their own resolved colors) until the bespoke org/magit/elfeed previews land (phases 4-5). Verified: node, headless screenshot, schema self-test PASS.
*** 2026-06-08 Mon @ 02:27:51 -0500 Phase 4 — org preview landed
Added =renderOrgPreview()=: a mock org document painted live from the org package faces (title, headings with heights, TODO/DONE, tag, scheduled date, property drawer, inline code/verbatim, link, checkbox, quote, src block, header-row table). The preview pane dispatches on the app's preview key; org-mode gets this, others keep the generic list. Verified: node, headless screenshot, self-test PASS.
*** 2026-06-08 Mon @ 02:30:42 -0500 Phase 5 — magit + elfeed previews landed
Bespoke =renderMagitPreview()= (status buffer: head/branches, untracked, a diff hunk with context/added/removed, recent commits with hashes/authors/keyword/tag) and =renderElfeedPreview()= (search list: filter, dated entries with feed/unread-title/read-title/tags, log lines by level). The preview label now names the app and notes generic vs bespoke. Verified: node, headless screenshots, self-test PASS.
*** 2026-06-08 Mon @ 02:32:44 -0500 Phase 6 — generated all-package inventory landed
=build-inventory.el= (loaded into a running Emacs) groups every installed package's faces by the defining package and writes =package-inventory.json=. =generate.py= embeds it and merges each package into the dropdown as an editable generic app, leaving org/magit/elfeed bespoke. 40 apps now (3 bespoke + 37 inventory, 643 faces). Committed data artifact, refreshed by reloading the .el; never browser-side discovery. Verified: node, self-test PASS, app count + bespoke-preserved checks.
*** 2026-06-08 Mon @ 02:34:01 -0500 Phase 7 — docs landed
Rewrote =README.md= for the full tool: three face tiers + palette, the in-page picker (with the AA/AAA mask), package faces (bespoke vs generic previews), modeled inheritance + relative height (family stays in font-config.el), the packages schema with inherit/height/source, export-vs-save, and the inventory-refresh command (=build-inventory.el=) + its loaded-config dependency. Notes =theme-studio.html= is generated. Test-surface fixtures tracked separately below.
*** 2026-06-08 Mon @ 02:40:00 -0500 theme-studio tier 3 — test surface landed
Extended the guarded =#selftest= harness (headless Chrome) to assert the acceptance criteria against the real emitted code: old-JSON import (no =packages=), full round-trip (fg/bg/bold/italic/inherit/height/source), cleared-state export, unknown-package/face preservation, and inheritance-cycle termination — all PASS. The two DOM-coupled regressions are handled structurally: =updateColor= remaps =PKGMAP= on a palette-color edit, and =PKGMAP= stores hexes so a deleted palette color leaves package refs in the "(gone)" recoverable state. =generate.py= rebuilds =theme-studio.html= each run.
** DONE [#B] theme-studio perceptual color metrics :feature:theme:theme-studio:
CLOSED: [2026-06-08 Mon]
Spec (Ready, opens confirmed 2026-06-08): [[id:15db8ae3-fc14-49f3-9ed5-d5ff59790904][docs/specs/theme-studio-perceptual-color-metrics-spec-implemented.org]]. OKLCH model + perceptual-L/APCA readouts + pairwise ΔE, for building low-contrast themes by metric rather than by eye. All five phases shipped 2026-06-08 (commits 49342bf5, 78260018, 77c7f126, 163d3730, 22605426, 582d8a6a): colormath.js core inlined + WCAG/HSV helpers migrated; picker OKLCH/APCA readouts; palette ΔE warnings; OKLCH edit-model dials; C×L gamut plane. 17 Node tests (colormath 100/93.75/100), six browser hash gates green, inline-integrity guard. vNext deferrals (low-contrast preset, CIEDE2000) remain the two [#D] tasks below. Manual eyeballs tracked under Manual testing.
*** 2026-06-08 Mon @ 19:43:50 -0500 Color-math foundation + Node tests landed
Pure color core in =scripts/theme-studio/colormath.js= (OKLab/OKLCH, APCA-W3 0.1.9 exact constants, ΔE-OK, binary-search gamut clamp returning ={hex,clamped}=) shipped in 49342bf5; this phase finished the integration in 78260018. =generate.py= now inlines the colormath.js body into the page script (export-stripped, =COLORMATH_J= placeholder), and the page's lin/rl/contrast/rating/hsv2rgb/rgb2hsv/hex2rgb/rgb2hex copies moved into the module — =rl= reuses the canonical =lin= (0.04045 cutoff), byte-identical to the old 0.03928 form on every #rrggbb (no 8-bit channel falls between the cutoffs; verified over 200k pairs, zero contrast change). =test-colormath.mjs= gained Normal/Boundary/Error cases for the migrated helpers, a seeded hsv-rgb round-trip property test, and an inline-integrity check that the generated page carries the module body verbatim. Gate met: =node --test scripts/theme-studio/*.mjs= 15 pass, colormath.js 100% line / 93.75% branch / 100% func; =node --check= on the spliced script clean; =#selftest= + =#cursortest= PASS in headless Chrome. NOTE: =node --test = directory-globbing is broken on Node v26 (tries to load the dir as a module) — use the =*.mjs= glob form.
*** 2026-06-08 Mon @ 19:55:53 -0500 Picker OKLCH/APCA readouts landed
Phase 2 shipped in 77c7f126. Second readout row (=.pinfo2=) under the WCAG ratio: OKLCH L/C/H + signed APCA Lc against the ground color, always shown; sign convention in the APCA tooltip + README. Tables unchanged (APCA picker-only per Agreed-decision #3). =pkReadout= drives the spans from the inlined colormath functions. Gate met: =#readouttest= asserts the spans match the live computation AND the known dupre-blue OKLCH reference (L 0.591 / C 0.052 / H 252°, APCA Lc -34 on ground) with WCAG unchanged; =#selftest= + =#cursortest= still PASS; 15 Node tests green. Headless-rendered values verified against a node cross-check. Visual eyeball is the open "Perceptual readouts read well in the picker" item under Manual testing.
*** 2026-06-08 Mon @ 20:44:39 -0500 Palette ΔE warnings landed
Phase 3 shipped in 163d3730. =renderPalette= runs a pairwise OKLab ΔE over PALETTE via the pure =paletteDeltas()= (one pass → sub-threshold pairs + per-color nearest distance); warns on pairs below the named =DELTAE_MIN= (0.02), sorted closest-first, capped at 5 with "and N more"; each chip's tooltip gains its nearest-neighbor ΔE. Names go through =esc= before the warning markup. Gate met: =#deltatest= PASS (near pair fires + names itself; spread palette quiet; 7-color cluster caps at 5 ascending + overflow suffix). #readouttest/#selftest/#cursortest + 15 Node tests still green. Screenshot-verified the warning render (terracotta "too-similar colors" header + "blue / blue2 — ΔE 0.007, hard to distinguish", placed between palette and add-color controls). Pushed below.
*** 2026-06-08 Mon @ 21:05:28 -0500 OKLCH sliders + color-model control landed
Phase 4a shipped in 22605426. Picker gains an edit-model toggle (HSV/OKLCH) in its own =pkModel= state, orthogonal to =pkMode= (AA/AAA mask) — separate handlers, distinct toggle colors (blue vs gold). OKLCH mode shows L/C/H as paired range+number inputs driving =oklch2hex= → hex/swatch/readouts/HSV-cursor; out-of-gamut chroma snaps the dials to the reachable color + shows "chroma clamped to sRGB". HSV stays default; SV square still edits HSV (C×L plane is 4b); SV drag in OKLCH mode refreshes the dials. =openPicker= re-asserts the model via =setPkModel= so the toggle highlight can't drift (caught on screenshot). Gate met: =#oklchtest= PASS (color preserved on model switch; mask toggle leaves pkModel; model switch leaves pkMode; dials drive color to a known OKLCH target; out-of-gamut C raises clamp status). All 5 browser gates + 15 Node tests green; screenshot-verified the dials + toggle highlight.
*** 2026-06-08 Mon @ 21:41:49 -0500 Chroma×Lightness plane landed
Phase 4b shipped in 582d8a6a. OKLCH mode renders the SV square as a C(x)×L(y) plane at the current hue; crosshair maps to (C,L), hue strip selects H. Out-of-gamut region greyed (#15120f), AA/AAA contrast mask overlays the reachable colors. Per-cell gamut test is forward-only (=oklch2oklab=→=oklab2lrgb=→=inGamut=), never the binary search (that stays in =oklch2hex= for committing). colormath.js exports =oklab2lrgb=/=inGamut=/=lrgb2hex= with direct Node tests (one pins inGamut to oklch2hex's clamped flag). Bitmap cached on (hue+dims+mask+bg) so C/L drags reuse it; hue drags ride browser pointermove-to-frame coalescing (synchronous render measured ~7ms math/5600 cells — no explicit rAF defer; flagged if jank appears). HSV path untouched. Gate met: =#planetest= (crosshair at C/L; OOG cell grey; in-gamut cell colored). Screenshot-verified the plane (gamut-boundary shape, crosshair at C=0 for grey). NOTE for Craig: OKLCH_CMAX=0.4 matches the C dial domain, so much of the plane is gamut-grey at low-chroma hues — a tighter max fills more area but desyncs the crosshair scale from the dial; your eyeball call.
*** 2026-06-08 Mon @ 21:41:49 -0500 Test surface green across the feature
Final state: 17 Node unit tests (colormath.js 100% line / 93.75% branch / 100% func), six browser hash gates (=#cursortest=/=#readouttest=/=#deltatest=/=#oklchtest=/=#planetest=/=#selftest=), inline-integrity check, =node --check= on the spliced page, README updated. All green. NOTE: =node --test = directory-globbing is broken on Node v26 — use =node --test scripts/theme-studio/*.mjs=.
** DONE [#B] theme-studio refactor — extract app from generate.py :feature:theme-studio:refactor:
CLOSED: [2026-06-09 Tue]
Examined 2026-06-09. generate.py is 1378 lines, ~1300 of them a single triple-quoted string holding the whole app (CSS + HTML + ~1000+ lines of JS). That string is the root of every refactor here: the app logic can't be unit-tested (only =colormath.js= is, because it is the one extracted module); backslash-doubling in the string caused real bugs this session (the multi-line export strip, the =#deltatest= regex); and there is no lint, highlight, or brace-check until Chrome runs it. The rest of the directory is healthy: =colormath.js= (pure, 100/96 tested) and =build-theme.el= (13 small functions) are the model.
Run the whole set in NO-APPROVALS mode: TDD per stage (characterization hash tests before each behavior-preserving move; node unit tests as extraction makes logic importable), commit + push at each green stage. Tooling committed at c7518d6f before starting. Order:
DONE (2026-06-09): Stages 1-5 + 7 landed and pushed (origin/main tip dd90eca9); Stage 6 deliberately skipped (optional, works today). generate.py went 1378→~500 lines; the app now lives in real files (styles.css, app.js, app-core.js) inlined at generate time. The escaping-bug class is gone (str.replace is literal), the dedup is done (unified dropdowns/sort/clear-unlocked, shared crHtml/mkStyleButtons/effFg helpers), and the pure app logic is unit-tested (app-core.js, 18 node tests). Three new permanent gates added along the way: =#locktest=, =#sorttest=, and the app-core integrity + node suite. =make theme-studio-test= = 13 python + 43 node + spliced-check + 8 hash gates, all green.
*** 2026-06-09 Tue @ 05:01:11 -0500 Stage 1 — #locktest net + extracted styles.css/app.js
Added the =#locktest= browser gate first (commit d04f44dd): it pins, across all three tiers, that mkLockCell disables a row's control (syntax swatch div via data-locked, UI select via .disabled) and that clear-unlocked wipes unlocked rows while skipping locked ones. Proved it goes red when a lock guard is removed.
Then extracted the =