Commit 79ec176
fix(integrity): adapt verify_hook + rtk verify for native rtk hook claude
- verify_hook() now checks ~/.claude/settings.json for "rtk hook claude"
instead of looking for the rtk-rewrite.sh file + SHA-256 hash
- Verified = rtk hook claude present in PreToolUse hooks
- NoBaseline = legacy rtk-rewrite.sh detected (still works, needs migration)
- NotInstalled = neither hook registered
- run_verify() output updated to reflect settings.json check
- runtime_check() simplified (all settings.json states are non-blocking)
- show_claude_config() (rtk init --show) now reports hook presence from
settings.json instead of the old file-based integrity check
- verify_hook_at() + read_stored_hash() gated #[cfg(test)] (legacy SHA-256
logic only needed by existing hash-based tests)
- 7 new tests for verify_hook_in_settings() covering: native hook, legacy
hook, missing file, empty object, no hooks key, no PreToolUse, unrelated cmd
Fixes: rtk verify reporting "SKIP RTK hook not installed" even when
rtk hook claude is registered; rtk init --show showing stale hook file status
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>1 parent 9f9c022 commit 79ec176
2 files changed
+209
-157
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1788 | 1788 | | |
1789 | 1789 | | |
1790 | 1790 | | |
1791 | | - | |
1792 | | - | |
1793 | | - | |
1794 | | - | |
1795 | | - | |
1796 | | - | |
1797 | | - | |
1798 | | - | |
1799 | | - | |
1800 | | - | |
1801 | | - | |
1802 | | - | |
1803 | | - | |
1804 | | - | |
1805 | | - | |
1806 | | - | |
1807 | | - | |
1808 | | - | |
1809 | | - | |
1810 | | - | |
1811 | | - | |
1812 | | - | |
1813 | | - | |
1814 | | - | |
1815 | | - | |
1816 | | - | |
1817 | | - | |
1818 | | - | |
1819 | | - | |
1820 | | - | |
1821 | | - | |
1822 | | - | |
1823 | | - | |
1824 | | - | |
1825 | | - | |
1826 | | - | |
1827 | | - | |
1828 | | - | |
1829 | | - | |
1830 | | - | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
1831 | 1795 | | |
1832 | | - | |
1833 | | - | |
1834 | | - | |
1835 | | - | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
1836 | 1808 | | |
1837 | | - | |
1838 | | - | |
1839 | 1809 | | |
1840 | 1810 | | |
1841 | 1811 | | |
| |||
1845 | 1815 | | |
1846 | 1816 | | |
1847 | 1817 | | |
1848 | | - | |
1849 | | - | |
1850 | | - | |
1851 | | - | |
1852 | | - | |
1853 | | - | |
1854 | | - | |
1855 | | - | |
1856 | | - | |
1857 | | - | |
1858 | | - | |
1859 | | - | |
1860 | | - | |
1861 | | - | |
1862 | | - | |
1863 | | - | |
1864 | | - | |
1865 | | - | |
1866 | | - | |
1867 | | - | |
1868 | 1818 | | |
1869 | 1819 | | |
1870 | 1820 | | |
| |||
0 commit comments