Skip to content

docs: correct stale code comments in hooks, list, picker, and output - #4782

Merged
max-sixty merged 1 commit into
mainfrom
nightly/clean-43566069546-comments
Nov 14, 2026
Merged

max-sixty merged 1 commit into
mainfrom
nightly/clean-43566069546-comments

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

This PR fixes seven code comments that no longer match the code. It changes comments only, so there is no behavior change and no test.

  • work_items_for_worktree (list/collect/execution.rs): the comment says the function enforces a "missing llm_command" precondition. It only clones llm_command into the task context. The column plan decides whether SummaryGenerate runs, and test_required_tasks_for_render covers that, as the file's own test comment notes.
  • preview_cache module doc: it says the cache is the on-disk tier for "three of the modes". The same doc goes on to describe Comments as a fourth cached mode.
  • compute_worktree_path (worktree/resolve.rs): it says the default branch returns the repo root. expected_worktree_path does that only for a non-bare repo. In a bare repo every branch gets a templated path.
  • RemovalDisplayInfo::from_precomputed (output/handlers.rs): it says the caller refreshes the integration verdict after pre-remove hooks. Nothing does: the refresh helper added in fix: data-safety fixes across the worktree merge/remove/prune lifecycle #2870 was later removed. Its only caller passes the planning-time verdict, and the comment at that call site already says the deletion re-decides against fresh refs.
  • DirectivePassthrough::default(): it says background hooks use it. Background pipelines spawn through their own runner, and the only callers are tests.
  • execute_shell_command: the comment says "Flush stdout" above stderr().flush().
  • hooks.rs module spec: it says each hook runs and renders in its anchor. That doesn't hold for post-remove, whose anchor (the removed worktree) is only its plan key. spawn_hooks_after_remove runs and renders it in the removal destination.

Found by the nightly code survey.

- work_items_for_worktree no longer enforces a missing-llm_command
  precondition; the column plan decides whether SummaryGenerate runs.
- preview_cache backs four picker modes, counting Comments.
- compute_worktree_path returns the repo root for the default branch only
  in a non-bare repo.
- RemovalDisplayInfo::from_precomputed takes the planning-time verdict; no
  caller refreshes it after pre-remove.
- DirectivePassthrough::default() has no background-hook caller.
- The flush before running a command flushes stderr, not stdout.
- post-remove's anchor is only its plan key; it runs and renders in the
  removal destination.
@worktrunk-bot worktrunk-bot added the nightly-cleanup Issues found by nightly code quality sweep label Nov 14, 2026
@max-sixty
max-sixty merged commit e0ba547 into main Nov 14, 2026
36 of 45 checks passed
@max-sixty
max-sixty deleted the nightly/clean-43566069546-comments branch November 14, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nightly-cleanup Issues found by nightly code quality sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants