feat(reports): classify git fetch as a git ref mutation (closes #297) #344

Merged
sysadmin merged 1 commits from feat/issue-297-fetch-ref-mutation into master 2026-07-07 04:07:12 -05:00
Owner

Closes #297

Summary

Reviewer reports treated git fetch prgs master as read-only diagnostics while claiming Git/worktree mutations: None. Fetch edits no files but updates remote-tracking refs — hiding it under diagnostics understates what the run mutated.

  • review_proofs.git_ref_mutating_commands(command_log) — classifies fetch, pull, push, merge, update-ref, remote update, branch -d/-D, and reset --hard as git ref mutations; accepts string or {command} dict entries.
  • review_proofs.assess_git_ref_mutation_report(report_text, command_log=...) — fails a report when ref-updating commands ran but the report lacks a non-none Git ref mutations entry, omits fetched <remote>/<branch> for a targeted fetch, still claims Git/worktree mutations: None, or lists the command under read-only diagnostics. Reports with no ref-updating commands (worktree creation, pure diagnostics, blocked handoffs) pass untouched.

Validation

  • TDD: 10 new tests in tests/test_git_ref_mutation_report.py watched failing first (AttributeError on the missing function), then green: 10 passed.
  • Full suite in the worktree: 1087 passed, 6 skipped, 1 failed — the failure is tests/test_agent_temp_artifacts.py::TestIssueLockArtifactWarning::test_lock_success_includes_artifact_warning, reproduced earlier today on clean master with changes stashed (pre-existing; independent of this change).

Risk

Low. Two new pure functions + module constants appended to review_proofs.py; no existing function modified. Report-validation wiring can adopt it incrementally (#293/#299/#313/#319/#320 cluster).

Worktree

Implementation done entirely in session-owned worktree /Users/jasonwalker/Development/Gitea-Tools/branches/feat-issue-297-fetch-ref-mutation (branch feat/issue-297-fetch-ref-mutation, head c41a698a08342366de4717ef6fea4184c262cd71, created fresh from prgs/master fd396df). Main checkout stayed on master, used only for claim/lock anchoring.

🤖 Generated with Claude Code

Closes #297 ## Summary Reviewer reports treated `git fetch prgs master` as read-only diagnostics while claiming `Git/worktree mutations: None`. Fetch edits no files but updates remote-tracking refs — hiding it under diagnostics understates what the run mutated. - `review_proofs.git_ref_mutating_commands(command_log)` — classifies `fetch`, `pull`, `push`, `merge`, `update-ref`, `remote update`, `branch -d/-D`, and `reset --hard` as git ref mutations; accepts string or `{command}` dict entries. - `review_proofs.assess_git_ref_mutation_report(report_text, command_log=...)` — fails a report when ref-updating commands ran but the report lacks a non-none `Git ref mutations` entry, omits `fetched <remote>/<branch>` for a targeted fetch, still claims `Git/worktree mutations: None`, or lists the command under read-only diagnostics. Reports with no ref-updating commands (worktree creation, pure diagnostics, blocked handoffs) pass untouched. ## Validation - TDD: 10 new tests in `tests/test_git_ref_mutation_report.py` watched failing first (`AttributeError` on the missing function), then green: **10 passed**. - Full suite in the worktree: **1087 passed, 6 skipped, 1 failed** — the failure is `tests/test_agent_temp_artifacts.py::TestIssueLockArtifactWarning::test_lock_success_includes_artifact_warning`, reproduced earlier today on clean master with changes stashed (pre-existing; independent of this change). ## Risk Low. Two new pure functions + module constants appended to `review_proofs.py`; no existing function modified. Report-validation wiring can adopt it incrementally (#293/#299/#313/#319/#320 cluster). ## Worktree Implementation done entirely in session-owned worktree `/Users/jasonwalker/Development/Gitea-Tools/branches/feat-issue-297-fetch-ref-mutation` (branch `feat/issue-297-fetch-ref-mutation`, head `c41a698a08342366de4717ef6fea4184c262cd71`, created fresh from `prgs/master` `fd396df`). Main checkout stayed on `master`, used only for claim/lock anchoring. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jcwalker3 added 1 commit 2026-07-07 03:29:58 -05:00
Reviewer reports treated 'git fetch prgs master' as read-only
diagnostics while claiming 'Git/worktree mutations: None'. Fetch edits
no files but updates remote-tracking refs, so hiding it under
diagnostics understates what the run mutated.

Add git_ref_mutating_commands() classifying fetch, pull, push, merge,
update-ref, remote update, branch -d/-D, and reset --hard as git ref
mutations, and assess_git_ref_mutation_report() which fails a report
when ref-updating commands ran but the report lacks a non-none 'Git ref
mutations' entry, omits 'fetched <remote>/<branch>' for a targeted
fetch, still claims 'Git/worktree mutations: None', or lists the
command under read-only diagnostics.

Tests cover fetch-only review, missing ledger entry, missing fetch
target, contradictory none-claim, read-only misclassification, worktree
creation (not a ref mutation), merge, cleanup branch deletion,
no-mutation blocked handoff, and dict command-log entries.

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

All tests pass successfully. Reviewed the implementation in review_proofs.py and tests/test_git_ref_mutation_report.py. It correctly classifies git ref updates like git fetch as git ref mutations, rejects Git/worktree mutations: None when fetch occurred, and prevents classifying fetch as a read-only diagnostic, completely matching the acceptance criteria of Issue #297. 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 tests/test_git_ref_mutation_report.py. It correctly classifies git ref updates like git fetch as git ref mutations, rejects Git/worktree mutations: None when fetch occurred, and prevents classifying fetch as a read-only diagnostic, completely matching the acceptance criteria of Issue #297. Tested inside the review worktree, and the single failing test is pre-existing on master.
sysadmin merged commit d7d2f92286 into master 2026-07-07 04:07:11 -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#344