Skip to content

fix(config): shared data resolves under the main worktree for every reader, writer and cleanup (#616) - #618

Merged
dan-petty merged 1 commit into
release/v0.2.23from
fix/616-shared-data-resolver
Sep 25, 2026
Merged

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

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

#553 made shared data (reviews, benchmarks, caches, the hallucination catalogue and the rest) resolve under the main worktree, so every worktree shares one data directory. Several sites still bypassed that resolver. From a linked worktree created outside the checkout they read and wrote the worktree's own .data, so data split across worktrees and was lost when one was removed.

This builds on #614's resolver and leaves it unchanged.

Changes

  • Every data site now uses resolve_data_path:

    • devops workspace clean, which also ignored data.dir and DEVOPS_CLI_DATA_DIR;
    • the hallucination catalogue's relative DEVOPS_CLI_DATA_DIR;
    • the devops benchmark --suite and devops ai prompt-eval datasets (the benchmark silently fell back to baseline cases);
    • model bundles and workspace discovery;
    • the analysis cache and the library drift report;
    • the dashboard's data providers, the controller, and the sandbox logs and registry.

    prompt-eval still verifies sources in the worktree it runs in. A relative --dataset or --output-dir is under the main worktree, as the help now says.

  • CI result cache: it lives in the shared cache directory, one file per worktree, named after the worktree's root. A gate never trusts another worktree's result, and parallel worktrees don't evict each other.

  • devops workspace clean prunes where data is written, and nothing else. It refuses:

    • system and top-level directories;
    • the home directory and its parents;
    • repositories and git directories, including bare ones;
    • worktrees and their parents;
    • directories that hold tracked files or another repository;
    • another workspace's data directory, including through a symlink.

    Child directories configured on their own, such as data.reviews_dir, are left alone.

  • Known limit: a checkout or worktree below another repository resolves shared data to the outer directory, as it has since before fix(cli): gate checks the worktree it runs in, not the main checkout (#582) #585. Strict xfail tests record it, and Checkouts and Worktrees Below Another Repository Resolve to Their Own Repository #617 tracks it on the v0.2.25 roadmap.

  • Roadmap and task file: the One data directory across git worktrees #553 entry gains a completion note, and this fix is recorded as delivered. The task file is included.

Verification

  • Real-git tests run every data site from a worktree outside the checkout and check that it resolves to the main worktree's data. They also check each site from the main checkout.
  • Cleanup is tested from every worktree layout, including a clone under repos/ and a submodule, and against each unsafe directory it must refuse. Its dry run names and checks what it would prune.
  • The change went through six review rounds, including a dedicated deletion-safety review after each change to cleanup. Each finding was checked by an independent skeptic before it was fixed.
  • The full devops ci gate passed on push.

Closes #616

…eader, writer and cleanup (#616)

#553 made shared data resolve under the main worktree, but several sites
still anchored it at the top-most root or the current directory. From a
linked worktree outside the checkout they read and wrote the worktree's
own .data, so data split across worktrees and was lost with them:
workspace clean (which also ignored data.dir and DEVOPS_CLI_DATA_DIR),
the hallucination catalogue's relative DEVOPS_CLI_DATA_DIR, the benchmark
and prompt-eval datasets (the benchmark silently fell back to baseline
cases), model bundles, workspace discovery, the analysis and CI result
caches, the library drift report, the dashboard, the controller and the
sandbox logs and registry.

Every one now resolves through resolve_data_path; prompt-eval verifies
sources in the worktree it runs in. The CI result cache lives in the
shared cache directory, one file per worktree, so a gate never trusts
another worktree's result.

workspace clean prunes the configured data directory, where data is
written, and refuses anything that is not a dedicated data directory:
system and top-level directories, the home directory and its parents,
repositories and git directories, worktrees and their parents,
directories holding tracked files or another repository, and another
workspace's data, also through a symlink.

A checkout or worktree below another repository still resolves shared
data to the outer directory, as since before #585; strict xfail tests
record it and #617 tracks it.

Closes #616
@dan-petty dan-petty added this to the v0.2.23 milestone Sep 25, 2026
@dan-petty
dan-petty merged commit ef0be97 into release/v0.2.23 Sep 25, 2026
8 checks passed
@dan-petty
dan-petty deleted the fix/616-shared-data-resolver branch September 25, 2026 22:50
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