Skip to content

fix(git): bind diff reviews to displayed content - #354

Merged
wzz6423 merged 1 commit into
mainfrom
fix/diff-review-snapshot
Dec 5, 2026
Merged

wzz6423 merged 1 commit into
mainfrom
fix/diff-review-snapshot

Conversation

@wzz6423

@wzz6423 wzz6423 commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

When another process writes or stages a file during a diff load, Mark Reviewed can currently record a newer patch that the diff never displayed. Bind the captured text and image bytes to the object IDs from the same raw/patch Git output that supplies the review fingerprint. Preserve Git clean filters, line endings, symlinks, SHA-1/SHA-256 repositories, rename/copy paths, and existing batched fingerprints.

Use in-process blob hashes for stored Git contents; only worktree conversion needs an additional Git command. Add deterministic concurrent-write regressions against the production loader and review store.

@coderabbitai summary

GitHub Project

  • Project: zshell Development
  • Start date: 2026-12-05
  • Target date: 2026-12-05

PR Type

  • Type: fix

Validation

  • Status: passed

  • Command: python3 -B mac/tests/test_diff_review_snapshot.py

  • Result: 338 checks passed, including concurrent index/worktree/untracked writes, restored-content and third-write races, images, symlinks, rename/copy status, binary data, size limits, modes, filters, CRLF, BOM, and both Git object formats.

  • Status: failed

  • Command: python3 -B mac/tests/test_diff_review_snapshot.py --source-ref b291210

  • Result: Expected regression reproduction: 28 of 265 checks failed on the previous implementation, including unseen text and image content receiving reviewed state. The current implementation passes the same assertions.

  • Status: passed

  • Command: python3 -B mac/tests/test_git_status_snapshot.py

  • Result: All 19 existing snapshot tests passed. The 600-file fixtures retained 10 Git commands for untracked files and 11 for tracked worktree/staged files.

  • Status: passed

  • Command: make format && git diff --check

  • Result: Formatted 1,195 Swift and 162 Rust files; no changes outside the four files in this PR and no whitespace errors.

  • Status: passed

  • Command: make run

  • Result: The coordinating reviewer independently completed the full Debug build and launched the app from this worktree. The reviewer also reran the snapshot regression and confirmed 338 checks with zero failures.

  • Status: passed

  • Command: codesign --verify --deep --strict <built-debug-app>; independent read-only review of 429e371..fd30650

  • Result: The built app signature passed. Independent correctness and simplification review found no blocking issue; 18 additional real-Git copy assertions verified that reviewing a destination cannot review its source or later unseen destination bytes.

  • Status: not run

  • Reason: CI completion is not awaited for this maintainer-authorized change.

Risk and Rollback

  • Risk: A file that changes during loading has no review action until the next reload displays matching bytes. Worktree clean filters run once more for content verification. Existing fingerprint payloads and Git panel batching remain compatible.
  • Rollback: Revert this pull request.

Related Issue

None

AI Attribution

Co-authored-by: Codex <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@wzz6423
wzz6423 marked this pull request as ready for review December 5, 2026 03:43
@wzz6423
wzz6423 merged commit 8dd2e26 into main Dec 5, 2026
29 checks passed
@wzz6423
wzz6423 deleted the fix/diff-review-snapshot branch December 5, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant