Skip to content

capture scenario where git hooks are overwritten during a running agent prompt#791

Merged
Soph merged 2 commits intomainfrom
soph/add-hook-overwrite-test
Apr 8, 2026
Merged

capture scenario where git hooks are overwritten during a running agent prompt#791
Soph merged 2 commits intomainfrom
soph/add-hook-overwrite-test

Conversation

@Soph
Copy link
Copy Markdown
Collaborator

@Soph Soph commented Mar 27, 2026

This is in context of: #784

It validates the assumption around hooks being overwritten but not the exact scenario described there. In the issue the next prompt fails too but this test shows our restore git hook logic works and recovers for the next prompt.


Note

Low Risk
Low risk: adds an integration test only, but it touches git hook state on disk and could be flaky if the test harness or hook detection changes.

Overview
Adds a new integration test (hook_overwrite_test.go) that reproduces the issue-784 scenario where third-party tools overwrite managed git hooks mid prompt, causing an intermediate commit to miss the checkpoint trailer.

The test then starts a second prompt to assert EnsureSetup reinstalls hooks (including creating .pre-entire backups for chaining) and that subsequent commits again include a checkpoint trailer with a new checkpoint ID.

Written by Cursor Bugbot for commit 5b4aa6d. Configure here.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an integration test to exercise recovery when Entire-managed git hooks are overwritten mid-turn, validating that a subsequent prompt’s setup re-installs hooks so later commits regain the Entire-Checkpoint trailer.

Changes:

  • Added a new integration test that simulates hooks being overwritten mid-turn and verifies trailer presence/absence across commits.
  • Verifies EnsureSetup re-installs hooks and creates .pre-entire backups when third-party hook content is detected.

gtrrz-victor
gtrrz-victor previously approved these changes Mar 27, 2026
Entire-Checkpoint: 68b40bd9d2c6
@Soph Soph merged commit ea05651 into main Apr 8, 2026
3 checks passed
@Soph Soph deleted the soph/add-hook-overwrite-test branch April 8, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants