Skip to content

fix: preserve invalid Cursor hook configurations during install - #1059

Merged
DietrichGebert merged 2 commits into
DietrichGebert:mainfrom
ac1982:fix/cursor-config-shape
Oct 13, 2026
Merged

DietrichGebert merged 2 commits into
DietrichGebert:mainfrom
ac1982:fix/cursor-config-shape

Conversation

@ac1982

@ac1982 ac1982 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #1058.

The Cursor installer currently overwrites valid JSON with invalid hooks.json shapes: root/hooks arrays are discarded, and a string-valued event becomes an array of individual characters. Reject those shapes before merging, leaving the file unchanged and reporting the field to repair. Missing config files and missing hooks objects still initialize normally.

Three subprocess regressions fail before the fix and verify the original file remains byte-for-byte intact afterward. npm test passes all 130 root tests and 28 Pi tests. node scripts/check-rule-copies.js and node scripts/check-versions.js pass. Tests use isolated temporary homes; no real Cursor configuration was modified and no live Cursor/model session was run.

Checked existing Cursor configuration issues/PRs, including #1052 (hook ownership matching); this addresses invalid configuration shapes separately. No ruleset or prompt changes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cursor installer overwrites hooks.json with invalid object/array shapes

2 participants