Repository navigation
Stop a test from standing in for the real program - #1322
Merged
Conversation
The proof gate checked ship claims, not whether the program that showed the failure was the program that showed the fix. Co-authored-by: Cursor <cursoragent@cursor.com> Change-Id: I161a67e5cce7fea332ca43c4eddfb5ba0ce308c8
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 7cde26fb-cce2-4071-a41a-92544739bcad) |
Owner
Author
|
This pull request is part of a Mergify stack:
|
3 tasks done
Owner
Author
|
@Mergifyio queue |
Contributor
Merge Queue Status
This pull request spent 1 hour 50 seconds in the queue, including 1 hour 31 seconds running CI. Required conditions to merge
|
6 tasks done
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.
Summary
A checker can stop a reply that uses a test as proof the real program works.
The written rule already said to rerun the check that failed. A later test could still stand in for the program a person runs.
The checker now reads the commands from the session. After that program has run and files have changed, the same program and action must run again.
Review Claim
A test cannot stand in for the real program that already showed the behavior.
Review Lane
behavior
Review Unit
engine-runtime
Safety Invariant
The gate blocks only when a product command already ran, a file was edited after it, and a test runner then ran without that same program and subcommand. An unreadable transcript does not block. A session that never ran a product command does not block.
Confirmed by the user on 2026-10-10.
Slice Rationale
This slice is the checker only. The written skill page that points at it stays out, so the review stays on one unit.
Non-goals
Does not install the checker into a running editor. Does not change the written skill page. Does not change the app people run.
Architecture
Before
graph TD A["reply ends"] --> B["ship claim check"] B --> C["allow or block that claim"]After
graph TD A["reply ends"] --> B["ship claim check"] B --> C["same command check"] C --> D["allow or block"]Measured
Command:
CATSTACK_HOOK_TEST_MODEL=gpt-5.6-sol python3 -m unittest discover -s engine/hooks/prove-it-ship-gate/tests -k TestSameRepro -qgit grep -c TestSameRepro origin/main -- engine/hooks/prove-it-ship-gate/tests/test_hooks.pyexited 1 and printed nothingRan 7 tests in 0.006sthenOK, exit 0Command: replay the session up to the test-runner turn, then
same_repro_gap['invoker-cli --help', 'invoker-cli --version', 'invoker-cli doctor', 'invoker-cli query']Test Plan
Test Plan
python3 scripts/ci/check_hook_test_coverage.py engine/hooks/prove-it-ship-gate—check_hook_test_coverage: OK (1 hook(s) checked)ruff check --select E9,F engine/hooks/prove-it-ship-gate/cursor_stop_check.py engine/hooks/prove-it-ship-gate/detect.py engine/hooks/prove-it-ship-gate/tests/test_hooks.py—All checks passed!CATSTACK_HOOK_TEST_MODEL=gpt-5.6-sol python3 -m unittest discover -s engine/hooks/prove-it-ship-gate/tests -q—Ran 38 tests in 0.504sthenOKRevert Plan
Revert Plan
git revert 3199d8af