Skip to content

feat: let a project keep its own review notes - #16

Merged
fiddur merged 1 commit into
developfrom
project-data-dir
Aug 21, 2026
Merged

feat: let a project keep its own review notes#16
fiddur merged 1 commit into
developfrom
project-data-dir

Conversation

@fiddur

@fiddur fiddur commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Review notes lived only in ~/.diffity/<repo-hash>, which is wrong for two of your cases: several
worktrees of one repository each want their own notes, and notes belonging to a project should be
able to travel with the project rather than the machine.

DIFFITY_DATA_DIR, or dataDir in a committed .diffity.json, now chooses the directory. Relative
paths resolve against the repository root, the environment wins over the file, and a directory
chosen for one project is used as given — the hashed subdirectory only exists to keep
repositories apart inside the shared default, and there is nothing to disambiguate in a project's
own directory.

Point it outside the working tree, or ignore it: otherwise the notes appear as untracked files in
the diff being reviewed, since a bare-ref diff includes untracked files. diffity now warns at
startup when that is the case.

Also closes audit P2-4: the database quotes the code under review through anchor_content, so
it, its WAL and the directory are created readable only by the owner. They were 0664/0775 under the
ambient umask.

Verified by moving a live review's notes to ~/nc/SendgridIdempotency/.diffity — beside the
worktree, not inside it — with DIFFITY_DATA_DIR=../.diffity; the worktree stayed clean and the
notes were served from the new location. Worth recording for anyone migrating: copying reviews.db
alone loses everything, because WAL mode keeps recent writes in reviews.db-wal until a checkpoint.

Stacked on #15.

🤖 Generated with Claude Code

https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs

Review notes lived only in ~/.diffity/<repo-hash>, which is wrong for two cases: several
worktrees of one repository each want their own notes, and notes that belong to a project
should be able to travel with it rather than with the machine.

DIFFITY_DATA_DIR, or dataDir in a committed .diffity.json, now chooses the directory.
Relative paths resolve against the repository root and the environment wins over the file.
A directory chosen for one project is used as given - the hashed subdirectory only exists
to keep repositories apart inside the shared default.

diffity warns at startup when the data directory sits inside the working tree without being
ignored, since the notes would otherwise appear as untracked files in the diff being
reviewed.

The database quotes the code under review through anchor_content, so it and its WAL are
created readable only by the owner, and so is the directory.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
@fiddur
fiddur changed the base branch from batched-review to develop August 21, 2026 13:35
@fiddur
fiddur marked this pull request as ready for review August 21, 2026 13:35
@fiddur
fiddur merged commit b11e35f into develop Aug 21, 2026
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