Repository navigation
Reject staged input changes after registered research replays - #3637
Open
roger-sato wants to merge 1 commit into
Open
roger-sato wants to merge 1 commit into
roger-sato wants to merge 1 commit into
Conversation
roger-sato
marked this pull request as ready for review
October 18, 2026 11:57
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
The registered research replay's final “Committed inputs remain unchanged” gate runs only
git diff --exit-code, which compares the working tree with the index. If a replay stages a changed input, a deletion, or a newly added file, the gate currently exits successfully despite the checkout differing from the committed inputs.Keep that worktree comparison and also run
git diff --cached --exit-codeagainst the commit. Both comparisons matter: replacing the existing command withgit diff HEADwould accept a staged edit whose working bytes were subsequently restored to HEAD. Ordinary untracked replay outputs remain allowed.The regression tests read the actual named workflow run step and execute it with fail-fast Bash in tiny real Git repositories. They cover clean and untracked-output controls, unstaged edits/deletions, staged edits/deletions/additions, and an index-only difference hidden by a restored working file. They run in the existing
test_research_*.pyonboarding suite.Test plan
python3.12 -B -m unittest discover -s tests -p 'test_research_ci_drift.py' -v— 8 passed.python3.12 -B -m unittest discover -s tests -p 'test_research_matrix_batches.py' -v— 5 passed, including actual planner CLI coverage and unchanged matrix boundaries.git diff --checkpasses. A full-checkout search found neither changed path in registeredSOURCES.jsonorVERIFY.jsondeclarations.The existing planner deliberately selects all 1,629 registered packages when this shared workflow changes; this PR retains that routing and does not bypass or filter it. The bounded local checks above exercised planning and the Git gate only. No all-package mathematical replay, selected cold replay, or hosted CI success is claimed. This is an end-of-replay cleanliness check, not a sandbox or proof that inputs were never temporarily modified during execution.
Scope and attribution
Based on canonical main
20ecf2891d80b5acf18d980b2164fb44ea7faa90. The reusable workflow was introduced by ywz65 in PR #2505, heada357942c5ee5ce88948c120a0a174bb7dd0c2d2a, and retained in Douglas R. Colkitt's integration commite182f1a175b3e7635b1c7a66fdf6f1c4a40cf3bd. This change closes the staged-file gap in its existing drift contract. PR #2602 separately checks publication bytes, and PR #3142 validates sparse planning manifests; neither supplies this post-replay CI gate.Exact-topic overlap was checked against a fresh snapshot of 344 open PRs, 2,964 closed PRs and 2,453 Discussion records, including the current handoff hub. No equivalent fix was found; text search does not prove exclusivity. Only this reusable workflow and its new behavioral tests change. Frozen sources, replay commands, scientific artifacts and the selected result remain unchanged.
Prepared by roger-sato with substantial OpenAI Codex assistance in implementation and independent agent review. Apache-2.0.