Skip to content

Implement truthful change classification and diff review #9

Description

@codeacme17

Tracks #1.

Summary

Implement truthful Changed File classification and on-demand diff review for the selected Worktree.

Scope

  • Parse git status --porcelain=v2 -z --branch --untracked-files=all into Conflicts, Staged Changes, Changes, and Untracked groups.
  • Allow the same path to appear in Staged Changes and Changes with independent baselines.
  • Produce opaque FileId values bound to one Worktree generation, revision, path, and baseline.
  • Implement on-demand Staged (HEAD → Index), Changes (Index → Working Tree), Untracked (empty → file), and truthful conflict views.
  • Show renames with old/new paths and keep deletions reviewable.
  • Default to side-by-side with a Unified toggle and Previous/Next N of M navigation.
  • Detect binary, undecodable, over-2-MiB, or over-20,000-line content before rendering a fake text diff; return metadata and safe open actions.
  • Disable external diff/textconv execution and bound process output.

Acceptance criteria

  • A staged-and-unstaged path appears twice with the correct distinct content.
  • Rename, deletion, untracked, binary, oversized, undecodable, and conflict fixtures all produce truthful results.
  • Empty groups are hidden and non-empty groups remain ordered Conflicts, Staged Changes, Changes, Untracked.
  • Unusual path bytes cannot address another Worktree or escape the Repository.
  • Large/binary fixtures cannot freeze or crash the page.
  • Navigation remains scoped to the selected Worktree and current group/filter.

Out of scope

  • Hunk/line staging, three-way conflict editing, syntax-highlighting guarantees, or file mutation.

Dependencies

PRD coverage

  • FR3; AC-05 and AC-06.

Verification

  • Real Git parser/diff integration tests, binary/encoding/size fixtures, path fuzzing, and UI diff navigation tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Core reachable product behavior required for the MVPenhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions