dffy is a terminal diff viewer and review tool for git, written in Rust, that stays fast on repositories the size of the Linux kernel.
Read docs/design.md before changing behavior. It has the rules a change follows. docs/architecture.md maps the modules.
crates/dffy-core: the model. Diffs, rows, positions, navigation, search, blocks, annotation placement. No terminal code, no code-host knowledge.crates/dffy/src/review: the comments file, its threads and the review session. No viewer types.crates/dffy/src/encode.rs: the one JSON form of the model, for--json, MCP and the control API.crates/dffy/src/{print.rs,pager,json.rs,mcp.rs,control}: frontends, thin over the model and the review layer.crates/dffy/src/tui: the viewer. How things look and how keys map to actions.crates/dffy/src/plugin: running plugins, and their protocols on dffy's side.plugins/*: plugins, each a program of its own. Code-host logic lives only here.crates/xtask: the perf gate and the comparison with other tools.
task fmt:checktask lint: clippy on every crate and target with all features. Warnings are errors.- Targeted tests for what changed:
cargo nextest run -p <crate> <filter>.task testruns everything. task docs:check. After changing a config key, an action, a default key or a remembered setting, runtask docsfirst.task typos- Anything on startup, scrolling, drawing or another hot path:
task perf -- --rev main --only <groups>withDFFY_BENCH_REPOset (docs/benchmarks.md), and report before and after. The gate that counts runs on the reference Linux machine.
- Failing test first when behavior changes.
- Stub programs in tests are files under
tests/fixtures/stubs/, never shell inline in a test. - Docs state the current contract. History and measurements go in commits and pull requests.