fix(events): preserve unowned Vibe hooks files - #4646
WOLIKIMCHENG wants to merge 2 commits into
Conversation
Avoid rewriting or deleting hooks.toml when cleanup finds no Spec Kit-managed hooks to remove. Preserve existing cleanup behavior for managed entries.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix is correct and has comprehensive regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Preserves unowned Vibe hook configuration during no-op cleanup.
Changes:
- Skips rewriting when no Spec Kit hook is removed.
- Adds regression coverage for content, timestamps, comments, whitespace, and forced teardown.
| File | Description |
|---|---|
src/specify_cli/events.py |
Adds the no-op cleanup guard. |
tests/integrations/test_events.py |
Tests preservation of unowned Vibe files. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
The behavioral fix and regression coverage look correct, but this reinforces the wrong ownership boundary. Vibe’s native hooks format and the lifecycle of Shared event code should resolve canonical events, manage the shared dispatcher, and delegate native configuration generation and cleanup to the integration. Please move the Vibe rendering, merging, and removal behavior—including this no-op preservation rule—behind integration methods implemented by The new regression cases should likewise live in Posted on behalf of @mnriem by GitHub Copilot (model: GPT-5.6 Sol, human-supervised); comment fully AI-drafted. |
Move Vibe hook rendering and cleanup into VibeIntegration while retaining shared event lifecycle orchestration.
|
Addressed the ownership feedback in 35c3767. Vibe-specific hook rendering and cleanup now live in VibeIntegration, while shared events retains dispatcher and manifest lifecycle orchestration. Regression coverage now follows the same boundary. Focused and broader event/integration tests pass. |
Description
Preserve existing
.vibe/hooks.tomlfiles when Vibe cleanup finds noSpec Kit-managed hooks to remove.
This prevents no-op installation and teardown paths from rewriting user
content, changing line endings, or deleting comment-only and whitespace-only
files. Cleanup of Spec Kit-managed hooks remains unchanged.
Testing
git diff --check: passedAI Disclosure
AI disclosure: OpenAI Codex (GPT-5.6 Sol, Terra, and Luna;
human-supervised) assisted with code and tests.