Skip to content

chore(clawpatch): point two stale entrypoint symbols at the live code - #3765

Merged
max-sixty merged 2 commits into
mainfrom
nightly/clean-31154760609-clawpatch
Aug 7, 2026
Merged

max-sixty merged 2 commits into
mainfrom
nightly/clean-31154760609-clawpatch

Conversation

@worktrunk-bot

@worktrunk-bot worktrunk-bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Collaborator

Nightly sweep finding: two .config/clawpatch/features/*.json entrypoints name symbols that no longer exist.

feat_custom_template_expansion.json. expand_command_template was deleted by #3635 ("derive the hook preview from the execution path"), which folded the preview render into render_template_preview in src/commands/command_executor.rs and left expand_template in src/config/expansion.rs as the single runtime render. The feature file kept pointing at the old name, so the one thing it exists to do — send a reader to the code that renders a project-supplied template before the approval gate sees it — lands nowhere.

  • Entrypoint → src/config/expansion.rs::expand_template. The module doc calls it "a single generic function" for template rendering, and it's what the feature's own summary is about ("expansion happens before the approval gate sees the final string").
  • ownedFiles reordered and re-reasoned. expansion.rs moves first and its reason now names the render functions. command_executor.rs is added — that's where refactor(hooks): derive the hook preview from the execution path #3635 put render_template_preview and the foreground step pipeline, so the file the code moved into was missing from a file list that still described where it came from. hook_commands.rs stays, with its reason updated to what it actually holds now (run_hook, the hook show --expanded rows).

feat_custom_switch_resolve.json. Entrypoint handle_switch → handle_switch_command. The function was renamed when #3049 moved switch/remove orchestration out of main.rs; the definition today is pub fn handle_switch_command at src/commands/worktree/switch.rs.

This second one is why the sweep's original audit reported only one stale symbol: it grepped each entrypoints[].symbol as a plain substring, and handle_switch matches inside handle_switch_command (and handle_switch_output, handle_switch_created_output, …), so a renamed symbol whose new name merely extends the old one reads as present. Re-run anchored on a definition — \b(fn|struct|enum|trait|type|const|static|mod)\s+<symbol>\b inside the declared path — all 14 features now resolve, and no other entrypoint has this shape.

Following the convention of the last edit to this directory (3554f49, which fixed interrupt_exit_code → interrupt_signal in the signal-handling feature), symbol names are corrected in place and updatedAt is left alone.

No test accompanies this — nothing in the suite reads .config/clawpatch/, which is why both references went stale silently. A sync test is conceivable, but it would be a new check on a hand-authored threat-model index whose schema this repo doesn't own; I'd rather flag the idea than build it unasked. If one is ever added, it should anchor on the definition, not a substring grep, for the reason above.

@worktrunk-bot worktrunk-bot added the nightly-cleanup Issues found by nightly code quality sweep label Aug 7, 2026
`feat_custom_switch_resolve.json` declared `handle_switch`, which has
never existed — `src/commands/worktree/switch.rs` has always named it
`handle_switch_command` ("Entry point for the `wt switch` command").

A substring grep hides this: `handle_switch` matches inside
`handle_switch_command`, `handle_switch_output`, and friends, so the
stale name looks resolved. Matching on the definition site
(`fn <symbol>`) instead is what surfaces it, and across all 14 feature
files it is the only remaining entrypoint symbol with no definition.
@worktrunk-bot worktrunk-bot changed the title chore(clawpatch): point the template-expansion entrypoint at the live render chore(clawpatch): point two stale entrypoint symbols at the live code Aug 7, 2026

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed as a self-authored PR, so this is a COMMENT rather than an approval.

Both symbol corrections check out against the merged tree: expand_command_template greps nowhere in src/ or tests/, pub fn expand_template is at src/config/expansion.rs, pub fn render_template_preview at src/commands/command_executor.rs, pub fn run_hook at src/commands/hook_commands.rs, and pub fn handle_switch_command at src/commands/worktree/switch.rs (no fn handle_switch exists — the nearby matches are handle_switch_output and friends in src/output/handlers.rs).

One thing worth recording, since it's the reason this PR needed a second commit: the sweep's original audit grepped each entrypoints[].symbol as a bare substring, and handle_switch matches inside handle_switch_command. A rename that only extends the old name is invisible to that check, so the first pass reported one stale symbol when there were two. I re-ran the audit anchored on a definition inside the declared path (\b(fn|struct|enum|trait|type|const|static|mod)\s+<symbol>\b) across all 14 features — all resolve, no other entrypoint has this shape, and every ownedFiles/contextFiles/tests path exists. The PR description now carries that caveat, so a future sync test doesn't inherit the same blind spot.

No data-safety surface here — the diff only touches the switch-resolve and template-expansion feature entries; the removal feature's file is untouched.

Verification
# every entrypoint symbol, checked as a definition in its declared path
OK   feat_custom_approval_gate.json        src/commands/command_executor.rs::handle_command_error
OK   feat_custom_approvals_storage.json    src/config/approvals.rs::Approvals
OK   feat_custom_config_deprecation.json   src/config/deprecation.rs::check_and_migrate
OK   feat_custom_hook_logs.json            src/commands/process.rs::HookLog
OK   feat_custom_merge_safety.json         src/commands/merge.rs::handle_merge
OK   feat_custom_network_boundary.json     src/git/repository/config.rs::default_branch
OK   feat_custom_performance.json          src/commands/list/collect/mod.rs::collect
OK   feat_custom_prune.json                src/commands/step/prune.rs::step_prune
OK   feat_custom_remove.json               src/commands/picker/mod.rs::do_removal
OK   feat_custom_repo_cache.json           src/git/repository/mod.rs::Repository
OK   feat_custom_shell_integration.json    src/commands/configure_shell.rs::handle_configure_shell
OK   feat_custom_signal_handling.json      src/commands/command_executor.rs::handle_command_error
OK   feat_custom_switch_resolve.json       src/commands/worktree/switch.rs::handle_switch_command
OK   feat_custom_template_expansion.json   src/config/expansion.rs::expand_template

Rename provenance: handle_switch → handle_switch_command landed in 3a6db54 ("refactor(commands): move switch/remove orchestration out of main.rs", #3049).

@max-sixty
max-sixty merged commit 05a3012 into main Aug 7, 2026
40 checks passed
@max-sixty
max-sixty deleted the nightly/clean-31154760609-clawpatch branch August 7, 2026 23:11
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