Bug Description
The decision-event compatibility matrix (cupcake-core/src/validator/decision_event_matrix.rs) only contains Claude Code events. For any Cursor-native event (beforeShellExecution, afterFileEdit, beforeReadFile, …), compatible_verbs() returns an empty list, so is_compatible() returns false for every decision verb. As a result cupcake validate reports each verb on those events as incompatible with an empty Supported: list.
This makes the Cursor builtins that cupcake init generates fail validation out of the box. Swapping the verb (e.g. halt → deny) does not help, because no verb is registered for those events — the matrix simply has no entry for the event at all.
Steps to Reproduce
cupcake init --global --harness claude (this also scaffolds the cursor/builtins/*.rego policies)
cupcake validate --policy-dir ~/.config/cupcake/policies
- Observe errors on the Cursor builtins, e.g.:
✗ .../policies/cursor/builtins/system_protection.rego
ERROR (line 15): Policy routes to 'beforeShellExecution' events but uses incompatible 'halt' decision verb. 'halt' decisions are not supported for beforeShellExecution events. Supported:
ERROR (line 15): Policy routes to 'afterFileEdit' events but uses incompatible 'halt' decision verb. 'halt' decisions are not supported for afterFileEdit events. Supported:
(The empty string after Supported: is the tell — the matrix has no entry for the event.)
Expected Behavior
Decision verbs that are valid for a harness's events should validate cleanly, and the validator should not flag events it has no spec for.
Actual Behavior
Every decision verb used on a Cursor-native event is reported as incompatible with an empty Supported: list, so cupcake validate fails on the generated Cursor builtins.
Harness
Cursor (note: validate applies the Claude-Code matrix regardless of which harness is active)
Cupcake Version
0.5.2
Operating System
Linux
OS Version
CachyOS (Arch-based)
Additional Context
Root cause: DecisionEventMatrix::new() only inserts Claude Code events; compatible_verbs() falls back to unwrap_or_default() (empty) for unknown events, and the compatibility rule in validator/rules.rs flags every verb against that empty set.
Proposed fix (PR incoming): add Cursor's actionable before/stop events to the matrix with verb sets derived from the Cursor response handlers (beforeShellExecution/beforeMCPExecution: halt/deny/block/ask; beforeReadFile and beforeSubmitPrompt: halt/deny/block; stop: halt/block); add a knows_event() helper; and have the rule skip events the matrix doesn't know — covering Cursor's fire-and-forget after* events and other harnesses' events — while still validating known-but-empty events like SessionEnd. Regression tests included.
Bug Description
The decision-event compatibility matrix (
cupcake-core/src/validator/decision_event_matrix.rs) only contains Claude Code events. For any Cursor-native event (beforeShellExecution,afterFileEdit,beforeReadFile, …),compatible_verbs()returns an empty list, sois_compatible()returnsfalsefor every decision verb. As a resultcupcake validatereports each verb on those events as incompatible with an emptySupported:list.This makes the Cursor builtins that
cupcake initgenerates fail validation out of the box. Swapping the verb (e.g.halt→deny) does not help, because no verb is registered for those events — the matrix simply has no entry for the event at all.Steps to Reproduce
cupcake init --global --harness claude(this also scaffolds thecursor/builtins/*.regopolicies)cupcake validate --policy-dir ~/.config/cupcake/policies(The empty string after
Supported:is the tell — the matrix has no entry for the event.)Expected Behavior
Decision verbs that are valid for a harness's events should validate cleanly, and the validator should not flag events it has no spec for.
Actual Behavior
Every decision verb used on a Cursor-native event is reported as incompatible with an empty
Supported:list, socupcake validatefails on the generated Cursor builtins.Harness
Cursor (note:
validateapplies the Claude-Code matrix regardless of which harness is active)Cupcake Version
0.5.2
Operating System
Linux
OS Version
CachyOS (Arch-based)
Additional Context
Root cause:
DecisionEventMatrix::new()only inserts Claude Code events;compatible_verbs()falls back tounwrap_or_default()(empty) for unknown events, and the compatibility rule invalidator/rules.rsflags every verb against that empty set.Proposed fix (PR incoming): add Cursor's actionable before/stop events to the matrix with verb sets derived from the Cursor response handlers (
beforeShellExecution/beforeMCPExecution: halt/deny/block/ask;beforeReadFileandbeforeSubmitPrompt: halt/deny/block;stop: halt/block); add aknows_event()helper; and have the rule skip events the matrix doesn't know — covering Cursor's fire-and-forgetafter*events and other harnesses' events — while still validating known-but-empty events likeSessionEnd. Regression tests included.