Skip to content

fix(events): preserve unowned Vibe hooks files - #4646

Open
WOLIKIMCHENG wants to merge 2 commits into
github:mainfrom
WOLIKIMCHENG:fix/vibe-hooks-preserve
Open

WOLIKIMCHENG wants to merge 2 commits into
github:mainfrom
WOLIKIMCHENG:fix/vibe-hooks-preserve

Conversation

@WOLIKIMCHENG

Copy link
Copy Markdown
Contributor

Description

Preserve existing .vibe/hooks.toml files when Vibe cleanup finds no
Spec 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

  • Focused Vibe cleanup tests: 22 passed
  • Compile and import checks: passed
  • git diff --check: passed

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (fill in the disclosure below)

AI disclosure: OpenAI Codex (GPT-5.6 Sol, Terra, and Luna;
human-supervised) assisted with code and tests.

Avoid rewriting or deleting hooks.toml when cleanup finds no Spec Kit-managed hooks to remove. Preserve existing cleanup behavior for managed entries.
@mnriem mnriem added the triage-nice-to-have Verdict: evidence-backed fix or greenlit feature — land after review label Sep 20, 2026
@mnriem
mnriem requested a balanced review from Copilot September 21, 2026 19:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mnriem

mnriem commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

The behavioral fix and regression coverage look correct, but this reinforces the wrong ownership boundary. Vibe’s native hooks format and the lifecycle of .vibe/hooks.toml should be owned entirely by VibeIntegration, not implemented through Vibe-specific branches and helpers in the shared events.py module.

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 VibeIntegration.

The new regression cases should likewise live in tests/integrations/test_integration_vibe.py, alongside the existing TestVibeTomlMerging coverage, rather than expanding the shared event test module with Vibe-specific behavior.

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.
@WOLIKIMCHENG

Copy link
Copy Markdown
Contributor Author

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-nice-to-have Verdict: evidence-backed fix or greenlit feature — land after review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants