Repository navigation
test(install-hooks+watcher): 20 structural tests for deprecated-hook auto-uninstall (#1083/#1085) and watcher PID file (#1065) - #1161
Conversation
VasiliyRad
left a comment
There was a problem hiding this comment.
Mostly good structural tests. Three issues before approving:
-
Non-test changes in a test PR.
src/health-check.pyhas a production code change (+14/-2) andbuild_log.mdadds 114 lines of unrelated operational notes (LinkedIn posts, WWDC threads, outreach signals). The PR title says "test" but ships a feature and a build-log dump. Split the health-check change into its own PR or at minimum update the PR title/description to reflect it.build_log.mdshould not be committed here. -
Redundant condition in test #9.
"length > 0" in hooks or "length > 0" in hooks— both sides are identical. One branch is likely a typo (maybe"length == 0"or"select(length"was intended as the alternate pattern). -
Minor:
health-check-bridge-multi-pid.test.pyis undocumented in the PR body. The PR describes 20 tests across two scripts but ships a third test file (5 additional tests for the health-check change) without mentioning it in the description.
Tests themselves are reasonable structural greps. No correctness bugs in the assertions I checked.
|
Status update (2026-05-26): The The health-check change ships cleanly in PR #1157 (already APPROVED by @VasiliyRad). The build_log.md chore commits should never have been pushed and will be dropped. A rebase onto upstream main (dropping build_log.md, letting health-check land via #1157) is ready — pending owner go-ahead to force-push. The actual test content here is unchanged and passes against current main. |
|
T9 fixed (commit Regarding the other two issues (non-test changes + |
…auto-uninstall (sonichi#1085/sonichi#1083) and watcher PID file (sonichi#1065) sonichi#1085/sonichi#1083: DEPRECATED_HOOKS array, Stop|watch-tasks-stream.pid entry, not in active HOOKS=(), Phase 2 removal loop, contains() substring match, atomic jq→tmp→mv, idempotent skip, empty-group cleanup, removed= summary. sonichi#1065: PID_FILE at state/watch-tasks-stream.pid, SUTANDO_WORKSPACE resolution, ~/.sutando/workspace/state fallback, $$ PID written, trap EXIT cleanup, mkdir -p before write, workspace-default TASKS_DIR. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
T9 checked `"length > 0" in hooks or "length > 0"` — both sides
identical (tautology). Now checks `"select(" in hooks and "length > 0"
in hooks`, matching the actual jq pattern in install-claude-hooks.sh.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4b801e0 to
7e19948
Compare
|
Branch rebased onto origin/main — bundled junk (build_log.md, health-check.py, health-check-bridge-multi-pid.test.py) stripped. Diff is now clean: only the intended test file(s). |
What
Structural tests covering two merged PRs:
install-claude-hooks.shdeprecated hook auto-uninstallwatch-tasks-stream.shPID file + Stop-hook cleanupBackground
PR #1083 / #1085 — auto-uninstall deprecated hooks
The
Stop|watch-tasks-stream.pidhook was removed fromHOOKS=()in #1083 because Turn-end firing killed the live Monitor watcher every turn. But existing installs still had the deprecated entry in theirsettings.json. PR #1085 addedDEPRECATED_HOOKS+ Phase 2 removal so the old entry is automatically removed on re-run — no manual jq needed.PR #1065 — PID file
Adds
<workspace>/state/watch-tasks-stream.pidso the Stop hook can kill the exact fswatch PID on session end.trap ... EXITremoves the file on graceful shutdown; dirty exits (SIGKILL) are covered by the Stop hook + startup reaper.Tests (20 assertions)
install-claude-hooks.sh (11)
DEPRECATED_HOOKSarray definedwatch-tasks-stream.pidappears inDEPRECATED_HOOKSStop|watch-tasks-stream.pidformatHOOKS=()forloop overDEPRECATED_HOOKSexistscontains()substring match (no exact-string fragility)continue) when no deprecated match (idempotent)removed=NADDEDandSKIPPEDstill tracked (Phase 1 preserved)watch-tasks-stream.sh (9)
PID_FILEdefined →watch-tasks-stream.pidstate/dirSUTANDO_WORKSPACEenv var~/.sutando/workspace/state$$(current PID) written toPID_FILEtrap 'rm -f "$PID_FILE"' EXITcleanupmkdir -pbefore writing PID fileTASKS_DIRTASKS_DIRdefaults to~/.sutando/workspace/tasksRun
🤖 Generated with Claude Code