Skip to main content

Crate diffler_core

Crate diffler_core 

Source
Expand description

Core review engine for diffler: diff computation, sessions, comments, viewed marks.

This crate holds all logic with no terminal dependency, so it can be tested headless and reused by the TUI, the MCP server, and future frontends.

Modules§

diff
Intra-line diff: byte ranges of changed regions between a paired old/new line, used for char-level emphasis on top of line diffs.
feedback
Markdown export of review feedback: comments with diff context, ready to paste into any agent prompt.
git
git2 backend for the Vcs trait: the only module that may touch git2 (test fixtures aside).
highlight
Whole-file syntax highlighting sliced into per-line styled ranges. Highlighting whole files (not hunks) keeps stateful constructs like multi-line strings correct across hunk boundaries.
model
Diff model: what changed, organized as files -> hunks -> lines.
pairing
Pair deleted/added line runs inside a hunk and attach intra-line emphasis. Lines pair positionally within a run, gated by similarity, mirroring delta’s homologous-line model.
repo
Repository discovery.
review
Facade tying the VCS backend, session, and store together: the one entry point the TUI and MCP layers consume.
session
Review session: comments and per-file viewed marks, reconciled against fresh diff models. Persistence lives in store.
source
What a review is of: the working tree, a single commit, or a contiguous commit range. A source has a deterministic, filesystem-safe persistence key and a human-facing label, so review state can be tracked per source and the agent can be told exactly what the human reviewed.
store
Session persistence: one file per review source under .diffler/reviews/, atomically written, self-gitignored. The legacy single-session file .diffler/session.json is read once and migrated to reviews/working.json.
vcs
Backend-agnostic VCS interface. Everything above this trait consumes dyn Vcs; only the git module (and test fixtures) may import git2.