hook: a script handed to the user is a claim that it runs - #506
Conversation
|
This pull request is part of a Mergify stack:
|
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: serverGenReqId_95c70e5c-dc3b-44a8-b7a3-468708f4af11) |
…ody checker on PR #506's live body after the rewrite. Goal: Prove the body passes as published. Motivation: A PATCH that returned 200 is not proof the live body passes. Safety invariant: Read-only; a failed fetch fails the task instead of passing. Verify: exit code 0 and output PR body validation passed. Effectiveness measurement: The same checker the required GitHub check runs passes on the live body, so the PR is no longer blocked on its text. Exit code: 0
A reply ended with `! bash <path>` for a login script whose remote half had collapsed into a single line. The wrapper passed `bash -n`; the wrapper was never what executed. Eight existing Stop hooks read that reply and allowed it. The hook fires when a reply hands over a script this session never ran through an interpreter, and stays silent when the reply names why the run cannot happen here, which is the honest case for an interactive sign-in. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KU2pPKob4MJ1NqjsfTNyYJ Change-Id: I2f495bfe35ba16304833cb3868c8c30537189b8b
…ody checker on PR #506's live body after the rewrite. Goal: Prove the body passes as published. Motivation: A PATCH that returned 200 is not proof the live body passes. Safety invariant: Read-only; a failed fetch fails the task instead of passing. Verify: exit code 0 and output PR body validation passed. Effectiveness measurement: The same checker the required GitHub check runs passes on the live body, so the PR is no longer blocked on its text. Exit code: 0
a0fe18d to
6697642
Compare
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: serverGenReqId_09a815de-be54-426c-8d06-b473be2cb447) |
Revision history
|
preflight.py kept its own hand-copied version of drafter.config.json's path rules, and the copy drifted: it counted every file outside engine/, scripts/, .github/ and the skill folders as neutral. PR #506 mixed a hook with a root README.md row; preflight passed it while validate-pr-body.mjs rejected it as engine-runtime mixed with docs. preflight now reads drafter.config.json and matches its path globs in Python, so it stays one standalone file that the pre-push hook can run as a temp copy. With no config beside the script it reads origin/main's copy. A test compares its answer with drafter-core's for every tracked path. Rules that cannot be read exit 3 as unchecked, never a pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014uqkMWYjsKGenUSA1CqBVv Change-Id: I4dc0ae8c981e7025ee6cbe37fca579ec9dee7b6d
|
Mergify repair stopped: required check failed: validate. The retry cap was reached for current head 6697642. |
|
Invoker Mergify babysitting is paused: this is the current bottom PR in the stack, but it is missing the |
1 similar comment
|
Invoker Mergify babysitting is paused: this is the current bottom PR in the stack, but it is missing the |
Summary
This safety check stops people from receiving scripts that the current session did not run.
The problem: a reply could hand over a script after checking only its wrapper, while its remote part was broken.
The cause: existing checks did not compare handed-over scripts with commands run during the session.
The fix adds a fail-open check, honest exceptions for interactive work, installation wiring, a guide, and proof.
Review Claim
Approve a safety check that blocks untested scripts from being handed to users while allowing honest explanations when the work needs them.
Review Lane
behavior
Review Unit
engine-runtime
Safety Invariant
Only the new safety check, its installation and documentation wiring, and its tests change. Existing checks fail open when they cannot inspect a session.
Slice Rationale
This slice keeps the handoff check, its wiring, and its proof together so the behavior can be reviewed and installed as one unit.
Non-goals
Test Plan
Test Plan
python3 -m unittest discover -s engine/hooks/handoff-needs-smoke-test/tests -vpython3 -m unittest tests.test_install -vRevert Plan
Revert Plan
git revert <merge-commit-sha>Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01KU2pPKob4MJ1NqjsfTNyYJ