diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-13 15:11:52 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-13 15:11:52 -0500 |
| commit | b76521ffff0ed53b05817878bf51e04db9f837c4 (patch) | |
| tree | f151206f0e53b94e37b4a1706d3b5b5b99a49eac | |
| parent | 90b1eeb938212121e9dc52170f21586bda4d30fc (diff) | |
| download | dotemacs-b76521ffff0ed53b05817878bf51e04db9f837c4.tar.gz dotemacs-b76521ffff0ed53b05817878bf51e04db9f837c4.zip | |
docs(claude): codify the make-test no-package-init testability gotcha
make test runs without package-initialize, so defuns nested in a use-package :config are unbound there even though the PostToolUse hook loads them. Extract such logic to top-level for unit tests; verify :config-bound keys live.
| -rw-r--r-- | CLAUDE.md | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -89,3 +89,5 @@ Prefer Write over cumulative Edits for nontrivial new code. Small functions (und - **Rulesets-owned changes propagate by edit-local + send-copy + explanatory note.** A bug or enhancement that belongs to a rulesets-owned synced file (a workflow under `.ai/workflows/`, a skill, a rule under `.claude/rules/`, a script under `.ai/scripts/`) is handled by editing the local copy so it's usable now, then sending rulesets a copy of the edited file plus an explanatory note — a local edit alone is overwritten on the next template sync, so the canonical update is what makes it durable. The note covers: how the problem was hit, what outcomes the change should alter, any implementation recommendations, and any follow-up instructions (e.g. send a note back with more info). Send notes with the inbox-send script (`inbox-send rulesets --file <path>`). Offer the change proactively when it would help. (`pattern` — 2026-06-12) - **Manual-verification handoff: VERIFY child, close the originating task.** When a task's code is complete and the only thing left is Craig's hands-on check, don't leave the whole task stuck in DOING. File the manual check as a `VERIFY` child under the "Manual testing and validation" parent task, then close the originating task itself (DONE for a top-level task, or the dated-log rewrite for a sub-task, per `todo-format.md`). The VERIFY child carries the residual human check and surfaces in the agenda until Craig confirms; the implementation task is no longer held open by it. Replaces the prior habit of leaving the fixed task DOING with a `*** TODO` manual-test note under the parent. (`pattern` — 2026-06-13) + +- **`make test` runs with no `package-initialize` — defuns inside a `use-package :config` are void there.** The Makefile's `EMACS_TEST` is `emacs --batch --no-site-file --no-site-lisp` with no `package-initialize`, so elpa packages never load and a `use-package` block whose package isn't found never runs its `:config`. Any `defun` nested inside that `:config` is unbound under `make test` / `make test-file`. The per-edit PostToolUse hook *does* initialize packages, so such defuns load there — a test can pass on save under the hook yet fail `make test`. To unit-test logic that lives in a `:config` block, extract it into a top-level defun outside `use-package` (the `cj/dwim-shell--empty-dirs-command` / `cj/dwim-shell--dated-backup-command` pattern) and test that; keybindings or mode-wiring that must stay in `:config` get live-daemon verification instead. (`gotcha` — 2026-06-13) |
