feat: reject workspace-none claims after worktree mutations (Closes #313) #354

Merged
sysadmin merged 1 commits from feat/issue-313-worktree-mutation-consistency into master 2026-07-07 04:23:54 -05:00
Owner

Summary

Implements #313: final reports must not say Workspace mutations: none when worktree mutations occurred.

Adds assess_workspace_mutation_consistency(report_text, observed_commands=None) to review_proofs.py:

  • Contradiction gate — fails when the report claims Workspace mutations: none while worktree mutations occurred, detected either from the observed workflow command log (git reset --hard, checkout, switch, restore, clean, stash, merge, rebase, cherry-pick, worktree add/remove/prune) or from the report's own non-none Worktree mutations field (internal contradiction, the exact #313 observed behavior).
  • Unreported-mutation gate — observed worktree mutations must appear under Worktree mutations, and observed fetch/pull must appear under Git ref mutations; missing or none values fail.
  • Precise-category pass — reports pass when they state File edits by reviewer: none alongside a non-none Worktree mutations entry; fetch-only runs may still say Workspace mutations: none provided the ref mutation is reported.

Fails closed; returns {complete, downgraded, reasons} matching sibling verifiers.

Tests

  • New tests/test_workspace_mutation_consistency.py: 12 tests covering reset, checkout, worktree add, clean, self-reported contradiction, fetch-only (pass and fail), unreported mutations, and no-op cases (acceptance criteria of #313).
  • TDD: tests written first and verified failing (ImportError) before implementation; all 12 pass after.
  • Full suite in the branch worktree: 1122 passed, 6 skipped, 20 subtests passed, 1 failed — the single failure tests/test_agent_temp_artifacts.py::TestIssueLockArtifactWarning::test_lock_success_includes_artifact_warning also fails on clean master (f92d1a2) baseline; pre-existing, not introduced by this branch (stale mock missing the newer base-equivalence lock-gate fields).

Closes #313

🤖 Generated with Claude Code

## Summary Implements #313: final reports must not say `Workspace mutations: none` when worktree mutations occurred. Adds `assess_workspace_mutation_consistency(report_text, observed_commands=None)` to `review_proofs.py`: - **Contradiction gate** — fails when the report claims `Workspace mutations: none` while worktree mutations occurred, detected either from the observed workflow command log (`git reset --hard`, `checkout`, `switch`, `restore`, `clean`, `stash`, `merge`, `rebase`, `cherry-pick`, `worktree add/remove/prune`) or from the report's own non-none `Worktree mutations` field (internal contradiction, the exact #313 observed behavior). - **Unreported-mutation gate** — observed worktree mutations must appear under `Worktree mutations`, and observed `fetch`/`pull` must appear under `Git ref mutations`; missing or `none` values fail. - **Precise-category pass** — reports pass when they state `File edits by reviewer: none` alongside a non-none `Worktree mutations` entry; fetch-only runs may still say `Workspace mutations: none` provided the ref mutation is reported. Fails closed; returns `{complete, downgraded, reasons}` matching sibling verifiers. ## Tests - New `tests/test_workspace_mutation_consistency.py`: 12 tests covering reset, checkout, worktree add, clean, self-reported contradiction, fetch-only (pass and fail), unreported mutations, and no-op cases (acceptance criteria of #313). - TDD: tests written first and verified failing (ImportError) before implementation; all 12 pass after. - Full suite in the branch worktree: `1122 passed, 6 skipped, 20 subtests passed, 1 failed` — the single failure `tests/test_agent_temp_artifacts.py::TestIssueLockArtifactWarning::test_lock_success_includes_artifact_warning` also fails on clean `master` (f92d1a2) baseline; pre-existing, not introduced by this branch (stale mock missing the newer base-equivalence lock-gate fields). Closes #313 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jcwalker3 added 1 commit 2026-07-07 04:11:54 -05:00
Add assess_workspace_mutation_consistency to review_proofs: final
reports fail validation when they claim "Workspace mutations: none"
while worktree mutations (reset --hard, checkout, clean, worktree
add/remove, stash, merge, rebase, ...) occurred — either observed in
the workflow command log or self-reported in the report's own
"Worktree mutations" field. Observed worktree and git ref mutations
must be reported under their precise category fields; reports pass
when they say "File edits by reviewer: none" alongside a non-none
"Worktree mutations" entry. Tests cover reset, checkout, worktree add,
clean, fetch-only, and no-op cases.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
sysadmin approved these changes 2026-07-07 04:23:38 -05:00
sysadmin left a comment
Owner

All tests pass successfully. Reviewed the implementation in review_proofs.py and test coverage in tests/test_workspace_mutation_consistency.py. It correctly enforces that final reports must not say Workspace mutations: none when worktree mutations occurred, and must report observed worktree/ref mutations under precise category fields, matching the acceptance criteria of Issue #313. Tested inside the review worktree, and the single failing test is pre-existing on master.

All tests pass successfully. Reviewed the implementation in review_proofs.py and test coverage in tests/test_workspace_mutation_consistency.py. It correctly enforces that final reports must not say Workspace mutations: none when worktree mutations occurred, and must report observed worktree/ref mutations under precise category fields, matching the acceptance criteria of Issue #313. Tested inside the review worktree, and the single failing test is pre-existing on master.
sysadmin merged commit 1666e55e60 into master 2026-07-07 04:23:54 -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#354