Skip to content

COR-5907 Type install-config JSON with structs instead of map[string…#14

Open
ashwin-corridor wants to merge 1 commit into
mainfrom
cursor/type-install-config-c71c
Open

COR-5907 Type install-config JSON with structs instead of map[string…#14
ashwin-corridor wants to merge 1 commit into
mainfrom
cursor/type-install-config-c71c

Conversation

@ashwin-corridor

Copy link
Copy Markdown
Contributor

…]any

  • Replace map[string]any literals in all five installX functions with strongly-typed structs: claudeHooksConfig (shared by Claude, Droid, Codex), cursorConfig, and cascadeConfig.
  • Add writeClaudeStyleConfig helper for read-merge-write pattern that preserves unrelated top-level keys (permissions, mcpServers, etc.).
  • Add writeJSONFile helper to eliminate marshal/mkdir/write boilerplate.
  • Collapse Codex tool matcher into codexToolMatcher constant shared by PreToolUse and PostToolUse.
  • Add golden-file tests pinning each install function's output.

…]any

- Replace map[string]any literals in all five installX functions with
  strongly-typed structs: claudeHooksConfig (shared by Claude, Droid, Codex),
  cursorConfig, and cascadeConfig.
- Add writeClaudeStyleConfig helper for read-merge-write pattern that
  preserves unrelated top-level keys (permissions, mcpServers, etc.).
- Add writeJSONFile helper to eliminate marshal/mkdir/write boilerplate.
- Collapse Codex tool matcher into codexToolMatcher constant shared by
  PreToolUse and PostToolUse.
- Add golden-file tests pinning each install function's output.
@ashwin-corridor ashwin-corridor changed the title COR-5907: Type install-config JSON with structs instead of map[string… COR-5907 Type install-config JSON with structs instead of map[string… May 19, 2026

@corridor-security corridor-security Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary: This PR refactors hook installation config generation into typed structs and shared JSON-writing helpers, with tests for generated Claude/Cursor/Droid/Codex/Cascade configs. No exploitable security vulnerabilities were identified.

Risk: Low risk. The changes affect local CLI configuration file generation and do not introduce network endpoints, authentication boundaries, or new execution of untrusted command strings.

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.

2 participants