Skip to content

Add Cursor beforeSubmitPrompt gate for Decision Declaration drafts#4

Merged
devops-adeel merged 1 commit into
decision-declaration-demofrom
decision-declaration-cursor-gate
Jul 16, 2026
Merged

Add Cursor beforeSubmitPrompt gate for Decision Declaration drafts#4
devops-adeel merged 1 commit into
decision-declaration-demofrom
decision-declaration-cursor-gate

Conversation

@devops-adeel

Copy link
Copy Markdown
Owner

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-linkage
CI check at PR time. The planning-stage (model-integration) and review-stage
(self-review) touchpoints are cooperative (prose-guided), not enforced. This adds
a 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 beforeFileEdit
event exists, and afterFileEdit is documented as observation-only. The only hook
that can genuinely deny anything relevant is beforeSubmitPrompt, which fires once
per 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 tentative
guess 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 already
ahead of main, so a hardcoded main reference 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)

  • Ships fail-open (no failClosed) -- a deliberate live-demo-safety tradeoff, not
    an oversight.
  • beforeSubmitPrompt blocking is reported flaky on Cursor's own community forum.
  • Headless CLI testing (agent -p) cannot validate this at all -- confirmed
    empirically that --print mode doesn't run this hook. Manual Cursor GUI
    verification is still required before relying on this live.

No files under src/diffusers/ are touched, so decision-linkage should pass
trivially (Domains touched: (none)).

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.
@devops-adeel
devops-adeel merged commit c991a8a into decision-declaration-demo Jul 16, 2026
4 of 6 checks passed
@devops-adeel
devops-adeel deleted the decision-declaration-cursor-gate branch July 16, 2026 22:14
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.

1 participant