Add Cursor beforeSubmitPrompt gate for Decision Declaration drafts#4
Merged
devops-adeel merged 1 commit intoJul 16, 2026
Merged
Conversation
Cursor can't block a native file edit before it happens (no beforeFileEdit event; afterFileEdit is observation-only) -- confirmed against two independent sources. beforeSubmitPrompt is the earliest point Cursor can genuinely deny anything: this gate blocks the *next* prompt once a domain has uncommitted changes with no matching row in decision-declaration/.draft.md (gitignored scratch file, existence-only bar -- full citation strength stays at self-review/CI). Reuses check_decision_linkage.py's domain map and row parsing directly rather than duplicating it. Also names the concrete draft-file path in model-integration and self-review's SKILL.md, closing a gap where the prose only said "a draft" with no location.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an earlier-stage, Cursor-native complement to the existing PR-time CI check.
Why
Decision Declaration currently only has one enforced gate: the
decision-linkageCI check at PR time. The planning-stage (
model-integration) and review-stage(
self-review) touchpoints are cooperative (prose-guided), not enforced. This addsa real, harness-level gate for contributors working in Cursor.
What Cursor can and can't do here
Cursor cannot block a native file edit before it happens -- no
beforeFileEditevent exists, and
afterFileEditis documented as observation-only. The only hookthat can genuinely deny anything relevant is
beforeSubmitPrompt, which fires onceper turn, not once per edit. So this gate blocks continuing to the next prompt
once a domain has uncommitted changes with no matching row in
decision-declaration/.draft.md(gitignored, existence-only bar -- a tentativeguess is fine here, full citation-strength verification stays at self-review/CI).
Domain detection
Diffs against the branch's own upstream tracking ref (not a hardcoded
main) --this branch is itself layered on
decision-declaration-demo, which is alreadyahead of
main, so a hardcodedmainreference would misattribute all that prior,already-merged history as newly touched. Caught by testing against this real repo
before committing, not assumed.
Known limitations (see tech-screen/GAPS_AND_BLOCKERS.md for full detail)
failClosed) -- a deliberate live-demo-safety tradeoff, notan oversight.
beforeSubmitPromptblocking is reported flaky on Cursor's own community forum.agent -p) cannot validate this at all -- confirmedempirically that
--printmode doesn't run this hook. Manual Cursor GUIverification is still required before relying on this live.
No files under
src/diffusers/are touched, sodecision-linkageshould passtrivially (
Domains touched: (none)).