Repository navigation
Require single-handler legacy Claude hook entries - #72
Conversation
|
Warning Review limit reachedNext included review available in 46 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoEnforce single-handler shape for legacy Claude hook upgrades
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper |
Legacy Claude upgrade preparation accepted an expected Tree Ring handler inside a user-expanded hooks array. Require the original single-handler entry shape and reject mixed arrays without changing the caller's JSON. The regression covers an unrelated custom sibling and verifies that the whole settings object is preserved on rejection.
Public activation behavior remains unchanged: create-only publication already prevents replacing an existing bridge file. This is source hardening after the v0.15.13 tag, with no version bump or replacement release.
Validation: the mixed-handler regression failed before the guard and passed after it; all 597 workspace tests passed with
cargo +stable test --workspace --locked; formatting and diff checks passed. The activation DOX contract now explicitly names the single-handler shape; parent contracts remain accurate.High-level PR Summary
This PR adds stricter validation for legacy Claude handler entries during upgrade preparation. The changes ensure that only single-handler hook arrays in the exact original format are accepted for replacement, preventing mixed arrays that contain both the expected Tree Ring handler and unrelated custom handlers. The validation now explicitly checks that hook arrays contain exactly one handler, and a new regression test case verifies that mixed-handler scenarios are properly rejected while preserving the user's original settings.
⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
crates/tree-ring-memory-cli/src/activation/AGENTS.mdcrates/tree-ring-memory-cli/src/activation/bridge.rs