Conversation
…135) Closes #135. Bundles handoff-watchdog.js + handoff-inject.js under src/gradata/hooks/assets/claude_code/. Adds install_js_hooks() + JS_HOOK_REGISTRY at STANDARD profile, --include-watchdog CLI flag, package-data wiring. 7 new unit+integration tests pass; full suite 4118 passed, 1 known flake (now fixed in #157).
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughSummary
Closes WalkthroughThe changes bundle Claude Code JS hook assets (handoff-watchdog.js and handoff-inject.js) into the gradata package, extend the installer to copy these assets into a target project's Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant CLI as CLI (gradata hooks install)
participant Installer as _installer.py
participant FSys as File System
participant Settings as settings.json
participant CodeHook as Claude Code Hooks
User->>CLI: gradata hooks install --include-watchdog --project-dir /path/to/project
CLI->>Installer: install_hook(project_dir="/path/to/project", include_watchdog=True)
Installer->>Installer: generate_settings(project_dir="/path/to/project", include_watchdog=True)
Installer->>Installer: install_js_hooks(project_dir="/path/to/project")
Installer->>FSys: copy handoff-watchdog.js to .claude/hooks/user-prompt/
Installer->>FSys: copy handoff-inject.js to .claude/hooks/session-start/
Installer->>Settings: register JS hooks in ~/.claude/settings.json
Settings->>CodeHook: Claude Code loads hook entries (UserPromptSubmit, SessionStart)
CodeHook->>User: Watchdog monitors & injects handoff on context pressure
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 3/5 reviews remaining, refill in 19 minutes and 6 seconds. Comment |
Closes #135.
Bundles
handoff-watchdog.js+handoff-inject.jsundersrc/gradata/hooks/assets/claude_code/{user-prompt,session-start}/.Changes
install_js_hooks(project_dir)in_installer.py(idempotent, byte-compare diff before write, preserves +x bit)JS_HOOK_REGISTRY(js_asset variant) at STANDARD profile tiergradata hooks install --project-dir <path> --include-watchdogpyproject.tomlpackage-data + hatch artifacts entries so JS ships in the wheelTests
test_handoff_js_installer.py— all pass:Bonus
MagicMock/to.gitignore(pytest test-artifact pollution from string-cast MagicMock paths)