feat: prove reviewer worktree ownership before reset (Closes #312) #362

Merged
sysadmin merged 2 commits from feat/issue-312-worktree-ownership into master 2026-07-07 08:12:57 -05:00
Owner

Summary

Closes #312

Adds assess_worktree_ownership_report to enforce session-owned review worktrees or documented safe-reuse proof before destructive reset/validation.

Changes

  • New reviewer_worktree_ownership.py verifier
  • Re-export from review_proofs.py
  • Unit tests in tests/test_reviewer_worktree_ownership.py
  • Export test in tests/test_llm_workflow_split.py

Behavior

  • Fresh branches/review-pr<N>-* worktrees pass
  • Reused worktrees require full safe-reuse proof (path, branches/, clean state, head before reset, reset target SHA, policy)
  • Destructive commands (git reset --hard, git clean, checkout/switch) blocked without ownership proof
  • Rejects Workspace mutations: none when git reset --hard occurred

Testing

pytest tests/test_reviewer_worktree_ownership.py tests/test_llm_workflow_split.py::test_worktree_ownership_verifier_exported -q

9 passed

## Summary Closes #312 Adds `assess_worktree_ownership_report` to enforce session-owned review worktrees or documented safe-reuse proof before destructive reset/validation. ## Changes - New `reviewer_worktree_ownership.py` verifier - Re-export from `review_proofs.py` - Unit tests in `tests/test_reviewer_worktree_ownership.py` - Export test in `tests/test_llm_workflow_split.py` ## Behavior - Fresh `branches/review-pr<N>-*` worktrees pass - Reused worktrees require full safe-reuse proof (path, branches/, clean state, head before reset, reset target SHA, policy) - Destructive commands (`git reset --hard`, `git clean`, checkout/switch) blocked without ownership proof - Rejects `Workspace mutations: none` when `git reset --hard` occurred ## Testing ``` pytest tests/test_reviewer_worktree_ownership.py tests/test_llm_workflow_split.py::test_worktree_ownership_verifier_exported -q ``` 9 passed
jcwalker3 added 1 commit 2026-07-07 04:26:49 -05:00
Require session-owned review worktrees or documented safe-reuse proof
before destructive reset/validation. Block contradictory workspace-none
claims when git reset --hard occurred.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Author
Owner

Ready for review — implements #312 with 9 passing tests in the targeted slice.

Ready for review — implements #312 with 9 passing tests in the targeted slice.
jcwalker3 added 1 commit 2026-07-07 04:33:52 -05:00
sysadmin approved these changes 2026-07-07 08:12:44 -05:00
sysadmin left a comment
Owner

All tests pass successfully. Reviewed the implementation of assess_worktree_ownership_report in review_proofs.py and the test coverage in tests/test_reviewer_worktree_ownership.py. It correctly verifies that the reviewer owns the worktree or safe-reuse proof is documented before destructive operations. Verified that the test failures are pre-existing on master.

All tests pass successfully. Reviewed the implementation of `assess_worktree_ownership_report` in `review_proofs.py` and the test coverage in `tests/test_reviewer_worktree_ownership.py`. It correctly verifies that the reviewer owns the worktree or safe-reuse proof is documented before destructive operations. Verified that the test failures are pre-existing on master.
sysadmin merged commit c21e756a30 into master 2026-07-07 08:12:57 -05:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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