Repository navigation
chore(clawpatch): point two stale entrypoint symbols at the live code - #3765
Conversation
`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
left a comment
There was a problem hiding this comment.
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).
Nightly sweep finding: two
.config/clawpatch/features/*.jsonentrypoints name symbols that no longer exist.feat_custom_template_expansion.json.expand_command_templatewas deleted by #3635 ("derive the hook preview from the execution path"), which folded the preview render intorender_template_previewinsrc/commands/command_executor.rsand leftexpand_templateinsrc/config/expansion.rsas 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.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").ownedFilesreordered and re-reasoned.expansion.rsmoves first and its reason now names the render functions.command_executor.rsis added — that's where refactor(hooks): derive the hook preview from the execution path #3635 putrender_template_previewand 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.rsstays, with its reason updated to what it actually holds now (run_hook, thehook show --expandedrows).feat_custom_switch_resolve.json. Entrypointhandle_switch→handle_switch_command. The function was renamed when #3049 moved switch/remove orchestration out ofmain.rs; the definition today ispub fn handle_switch_commandatsrc/commands/worktree/switch.rs.This second one is why the sweep's original audit reported only one stale symbol: it grepped each
entrypoints[].symbolas a plain substring, andhandle_switchmatches insidehandle_switch_command(andhandle_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>\binside the declaredpath— 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_signalin the signal-handling feature), symbol names are corrected in place andupdatedAtis 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.