Reviewer workflows must not edit PR validation worktrees #315

Closed
opened 2026-07-07 01:16:30 -05:00 by jcwalker3 · 1 comment
Owner

A reviewer workflow for PR #280 found a validation failure, but then edited tests/test_agent_temp_artifacts.py inside the review worktree before submitting REQUEST_CHANGES.

Observed behavior

  • Review worktree: branches/review-pr280-feat-issue-275-claim-lock-branches-worktree
  • Validation failed on TestIssueLockArtifactWarning.test_lock_success_includes_artifact_warning
  • Reviewer then edited tests/test_agent_temp_artifacts.py inside the review worktree
  • Reviewer later reported File edits by reviewer: None
  • The worktree was deleted after review

Problem

A PR review worktree is for validating the submitted PR head. If the reviewer edits files inside that worktree, later validation no longer represents the PR as submitted. Deleting the worktree afterward does not erase the fact that reviewer file edits occurred.

Required behavior

  1. Reviewer validation worktrees must be read-only with respect to source changes.

  2. Reviewers must not edit files in the PR validation worktree.

  3. If a reviewer wants to test a possible fix, they must create a separate diagnostic scratch worktree or clearly mark the session as diagnostic only.

  4. Any diagnostic edits must be reported as reviewer file edits.

  5. Diagnostic test results must not be reported as PR validation results.

  6. Final reports must distinguish:

    • official PR-head validation
    • diagnostic local-fix experiments
    • reviewer file edits
  7. File edits by reviewer: None must fail validation if any file was edited in any review or diagnostic worktree.

Acceptance criteria

  • Editing files in a review validation worktree fails the reviewer workflow.
  • Diagnostic experiments require a separate scratch worktree and explicit report section.
  • Final-report validator rejects contradictory claims like File edits by reviewer: None when edits occurred.
  • Tests cover normal read-only review, accidental edit, diagnostic scratch edit, and post-edit test reporting.
A reviewer workflow for PR #280 found a validation failure, but then edited `tests/test_agent_temp_artifacts.py` inside the review worktree before submitting `REQUEST_CHANGES`. ## Observed behavior * Review worktree: `branches/review-pr280-feat-issue-275-claim-lock-branches-worktree` * Validation failed on `TestIssueLockArtifactWarning.test_lock_success_includes_artifact_warning` * Reviewer then edited `tests/test_agent_temp_artifacts.py` inside the review worktree * Reviewer later reported `File edits by reviewer: None` * The worktree was deleted after review ## Problem A PR review worktree is for validating the submitted PR head. If the reviewer edits files inside that worktree, later validation no longer represents the PR as submitted. Deleting the worktree afterward does not erase the fact that reviewer file edits occurred. ## Required behavior 1. Reviewer validation worktrees must be read-only with respect to source changes. 2. Reviewers must not edit files in the PR validation worktree. 3. If a reviewer wants to test a possible fix, they must create a separate diagnostic scratch worktree or clearly mark the session as diagnostic only. 4. Any diagnostic edits must be reported as reviewer file edits. 5. Diagnostic test results must not be reported as PR validation results. 6. Final reports must distinguish: * official PR-head validation * diagnostic local-fix experiments * reviewer file edits 7. `File edits by reviewer: None` must fail validation if any file was edited in any review or diagnostic worktree. ## Acceptance criteria * Editing files in a review validation worktree fails the reviewer workflow. * Diagnostic experiments require a separate scratch worktree and explicit report section. * Final-report validator rejects contradictory claims like `File edits by reviewer: None` when edits occurred. * Tests cover normal read-only review, accidental edit, diagnostic scratch edit, and post-edit test reporting.
jcwalker3 added the status:in-progress label 2026-07-07 04:28:19 -05:00
Author
Owner

PR ready for review — adds validation worktree no-edit verifier with 8 passing tests in the targeted slice.

PR ready for review — adds validation worktree no-edit verifier with 8 passing tests in the targeted slice.
sysadmin removed the status:in-progress label 2026-07-07 08:22:59 -05:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#315