Catch a hand-edited status even when the primitives also moved - #379
Open
Chessing234 wants to merge 1 commit into
Open
Catch a hand-edited status even when the primitives also moved#379Chessing234 wants to merge 1 commit into
Chessing234 wants to merge 1 commit into
Conversation
The derived-status guard only fired when `status` moved and both `informal_status` and `formal_status` stayed put. A PR that edits a primitive and also hand-edits `status` to a value that disagrees with the derived one therefore passed validation with a notice, and regeneration then silently threw the hand-edit away - exactly the outcome the check exists to prevent. By the time we reach this branch `status` already disagrees with the derived value, so the only question left is whether this PR touched `status`. If it did, the edit is a hand-edit; if it did not, `status` is merely stale on the branch, which stays a notice.
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.
scripts/validate.pyexplains that a stalestatuson a branch is harmless, but a contributor editingstatusdirectly is not, because regeneration silently reverts it. The check only fired whenstatusmoved and bothinformal_statusandformal_statusstayed put, so it misses the case where a PR edits a primitive and hand-editsstatusin the same change.That is the likely shape of the mistake in practice: someone updates
informal_statusand helpfully "fixes up"statusto match what they think it should be. If their value disagrees with the derived one, it passes validation and is thrown away on merge.Reproduced against a one-problem base file (
informal_status: open,status: open):statushand-edited, primitives untouchedinformal_status→disproved,statushand-edited toprovedinformal_status→disproved,statusleft staleinformal_status→disproved,statuscorrectly updatedCase B is the gap; C and D confirm the stale-but-untouched path and the correct path are unchanged, so this does not start rejecting ordinary edits.
By the time control reaches this branch
statusalready disagrees with the derived value, so the only remaining question is whether the PR touchedstatusat all. Dropping the two primitive-equality conditions is what expresses that.Also checked for false positives on the real file:
validate.py --baseover the currentdata/problems.yaml(1217 problems) againstmain~5and againstmainitself both report✅ Validation OK.