Metriche repository
- Star
- (48.085 star)
- Metriche merge PR
- (Merge medio 11g 1h) (45 PR mergiate in 30 g)
Descrizione
Summary
rtk init -g --gemini stores an RTK-owned integrity hash next to the Gemini hook, but rtk init -g --gemini --uninstall does not remove that hash file.
This is a small uninstall hygiene issue, not an accusation of malware. It leaves an RTK-owned metadata file after uninstall.
Version / tag / commit
- Tag:
v0.39.0 - Commit:
2fbc7514f6964acabcfac65501b8bb6b525e3aa8
Evidence
Gemini install writes the hook and stores an integrity hash:
src/hooks/init.rs:2466-2472creates~/.gemini/hooks/rtk-hook-gemini.sh.src/hooks/init.rs:2480-2482callsintegrity::store_hash(&hook_path).src/hooks/integrity.rs:48-54derives the hash path as a.rtk-hook.sha256file in the hook's parent directory.src/hooks/integrity.rs:67-85writes the hash file.
Gemini uninstall removes the hook, GEMINI.md, and settings entry, but not the hash:
src/hooks/init.rs:2608-2614removes~/.gemini/hooks/rtk-hook-gemini.sh.src/hooks/init.rs:2616-2622removes~/.gemini/GEMINI.md.src/hooks/init.rs:2624-2643removes RTK hook entries from~/.gemini/settings.json.- No call to
integrity::remove_hash(&hook_path)appears inuninstall_gemini.
Contrast: Claude uninstall removes the integrity hash:
src/hooks/init.rs:591-601removes the legacy Claude hook and then callsintegrity::remove_hash(&hook_path).src/hooks/integrity.rs:98-116already provides the removal helper.
Duplicate search performed:
gh issue list -R rtk-ai/rtk --search "Gemini uninstall .rtk-hook.sha256"gh issue list -R rtk-ai/rtk --search "uninstall_gemini integrity hash"gh issue list -R rtk-ai/rtk --search "orphaned hash Gemini hook"gh issue list -R rtk-ai/rtk --search "rtk-hook.sha256 uninstall"
No focused duplicate was found.
Impact
After uninstall, ~/.gemini/hooks/.rtk-hook.sha256 can remain even though the Gemini hook was removed. This is not sensitive and does not execute, but it makes uninstall incomplete and can confuse later hook integrity checks or manual audits of RTK-owned files.
Verification steps
- Inspect
src/hooks/init.rs:2453-2494for Gemini install. - Inspect
src/hooks/integrity.rs:48-85for the hash file location and write. - Inspect
src/hooks/init.rs:2601-2643for Gemini uninstall. - Confirm there is no
integrity::remove_hash(&hook_path)inuninstall_gemini.
Suggested mitigation
In uninstall_gemini, call integrity::remove_hash(&hook_path) for the Gemini hook path, mirroring the Claude uninstall cleanup. Add an idempotent regression test that installs/removes Gemini artifacts and verifies both rtk-hook-gemini.sh and .rtk-hook.sha256 are removed while user settings content is preserved.