Skip to content

prove-it-ship-gate: the same-command rule reads only the current edit cycle - #1405

Draft
EdbertChan wants to merge 1 commit into
mainfrom
same-repro-window
Draft

EdbertChan wants to merge 1 commit into
mainfrom
same-repro-window

Conversation

@EdbertChan

Copy link
Copy Markdown
Owner

Summary

The ship gate has a rule: an edit checked only by a test runner must be followed by a rerun of the real product command.

The problem: the rule gathered every product command the session had ever run, so a long session got an unclearable demand for unrelated programs on every reply.

The fix: the rule now reads only the commands between the previous file edit and the last one. Subagent transcripts beside the session still count whole.

Review Claim

The same-command rule names only the repro of the current edit cycle, so a long session no longer accumulates every program it ever ran into one demand.

Review Lane

behavior

Review Unit

engine-runtime

Safety Invariant

The change only narrows which commands the rule asks for. The hook still never edits files or runs commands, the fail-open path on an unreadable transcript is untouched, and a new test fails before and passes after.

Slice Rationale

One rule in one hook. The earlier surface-key false positive (shell assignments read as programs) is a separate claim and stays in its own PR.

Non-goals

  • Does not change what counts as a product command or a test runner.
  • Does not change how subagent transcripts are found or read.
  • Does not touch the other rules of this hook.

Measured

Command: source scripts/test/hermetic_env.sh; python3 -m unittest discover -s engine/hooks/prove-it-ship-gate/tests -p "test_*.py" with this commit's tests, against the parent's detect.py (base) and this commit's (head).

  • base: Ran 41 tests, FAILED (failures=1) (the new test: the demand still named invoker-cli doctor from the earlier edit cycle)
  • head: Ran 41 tests, OK

On a real transcript where the old rule listed 12 unrelated programs on every reply, same_repro_gap() with the new rule returns [].

Test Plan

Test Plan
  • source scripts/test/hermetic_env.sh; python3 -m unittest discover -s engine/hooks/prove-it-ship-gate/tests -p "test_*.py" -> Ran 41 tests, OK
  • python3 scripts/ci/check_hook_test_coverage.py engine/hooks/prove-it-ship-gate -> check_hook_test_coverage: OK (1 hook(s) checked)
  • python3 engine/skills/make-pr/scripts/preflight.py --base origin/main --commit-only --dry-run -> ok preflight passed
  • New case: a product command before an earlier edit is not demanded after a later edit; the one run in the current cycle still is.

Revert Plan

Revert Plan
  • Safe to revert? Yes
  • Revert command: git revert <merge commit of this PR>
  • Post-revert steps: None
  • Data migration? No

🤖 Generated with Claude Code

… cycle

The rule collected every product command the session ever ran, so after an
edit followed by a test run it demanded reruns of programs from hours
earlier and never cleared. It now reads the commands between the previous
file edit and the last one (subagent transcripts stay whole), so the demand
names the repro of this edit only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant