Skip to content

fix(store): prune a CLI row once its binary is uninstalled - #199

Merged
RealZST merged 1 commit into
mainfrom
fix/prune-uninstalled-cli
Nov 29, 2026
Merged

RealZST merged 1 commit into
mainfrom
fix/prune-uninstalled-cli

Conversation

@RealZST

@RealZST RealZST commented Nov 29, 2026

Copy link
Copy Markdown
Owner

Problem

After a CLI was uninstalled outside HarnessKit (for example with npm uninstall -g), its row stayed in the list for good, and Overview kept showing it under recently installed.

Every CLI row carries install metadata after its first scan, and CLI rows with install metadata were exempt from stale cleanup.

Change

The exemption is removed. A CLI row now follows the rule other file-backed rows already use: it is kept while its recorded binary is still on disk and pruned once the binary is gone.

A CLI that a scan misses while it is still installed (a desktop app's PATH lacks the entries a shell profile adds) is kept, because its binary still exists.

Testing

  • cargo test -p hk-core: the existing prune tests now assert the new behaviour.
  • With a stand-in lark-cli binary in an isolated home: scan, delete the binary, scan again. Before this change the row stays; after it the row is gone.
  • Not run on Windows beyond CI.

🤖 Generated with Claude Code

A CLI row was never pruned: every CLI row carries install metadata after its first scan, and such rows were exempt from stale cleanup. The row now follows the rule other file-backed rows use: kept while its recorded binary is still on disk, pruned once it is gone.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@RealZST
RealZST merged commit bbb9822 into main Nov 29, 2026
4 checks passed
@RealZST
RealZST deleted the fix/prune-uninstalled-cli branch November 29, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant