Skip to content

fix(config): one data directory across git worktrees - #559

Merged
dan-petty merged 1 commit into
release/v0.2.23from
fix/553-shared-data-dir
Sep 24, 2026
Merged

dan-petty merged 1 commit into
release/v0.2.23from
fix/553-shared-data-dir

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Closes #553.

Problem

A relative data directory (.data) resolved against the current git worktree. Each worktree kept its own reviews, benchmarks, corpora, sample validations, caches and hallucinations catalog, and removing the worktree deleted them. The first full sample validation (#505) was lost this way. The spend ledger was worse: it resolved against whatever directory the command ran in.

Changes

  • main_worktree_root (core/repo.py) finds the main worktree from any worktree. It follows a linked worktree's .git file to its git directory, then that directory's commondir. A submodule-style .git file without commondir isn't followed.
  • resolve_data_path keeps absolute paths and puts relative ones under the main worktree. It is used for every data output:
    • reviews, benchmarks and samples;
    • the analysis and response caches;
    • the hallucinations catalog and the RAG index;
    • the audit log and the feedback dataset;
    • the spend ledger.
  • Input datasets checked into the repository still resolve in the current worktree.

This is the groundwork for the evaluation run store (#554): every benchmark and evaluation now lands in one data directory, whichever worktree runs it.

Test plan

  • tests/test_data_dir_worktrees.py (5 tests, against a real repository with a linked worktree):
    • the main worktree is found from each place;
    • relative paths are shared and absolute ones kept;
    • submodule-style and plain directories keep their own root;
    • reviews from a worktree go to the main worktree;
    • the spend ledger resolves there from a subdirectory.
  • uv run devops ci --force: all 13 gates pass

A relative data directory resolved against the current git worktree. Each worktree
kept its own reviews, benchmarks, corpora, sample validations, caches and
hallucinations catalog, and removing a worktree deleted them. The first full sample
validation (#505) was lost that way. The spend ledger resolved against whatever
directory the command ran in.

Relative data paths now resolve against the main worktree, found through a linked
worktree's commondir; absolute paths are kept as given. Every data output uses one
resolver, the spend ledger included. Input datasets checked into the repository still
resolve in the current worktree.

Closes #553
@dan-petty dan-petty added this to the v0.2.23 milestone Sep 24, 2026
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/config Settings, OS Keyring, environment variables, and defaults priority/p1-high Priority P1: high-impact work for the next planned milestone labels Sep 24, 2026
@dan-petty
dan-petty merged commit fec44d6 into release/v0.2.23 Sep 24, 2026
7 checks passed
@dan-petty
dan-petty deleted the fix/553-shared-data-dir branch September 24, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/p1-high Priority P1: high-impact work for the next planned milestone scope/config Settings, OS Keyring, environment variables, and defaults type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant