Objective
tests/dev/test_compact_worktree_snapshot.py::test_detect_worktrees_filters_by_issue_slug_and_reports_total can fail under the parallel readiness lane when pytest creates a temporary parent path containing the issue number. The compact snapshot helper matches filters against the entire absolute path, so an unrelated path component is treated as a worktree match.
Scope
Constrain compact worktree snapshot filtering to stable branch and worktree-name fields, while preserving intentional full-path filtering when a path separator is supplied. Add a regression test for a decoy parent path.
Inputs
scripts/dev/compact_worktree_snapshot.py
tests/dev/test_compact_worktree_snapshot.py
- the existing
--filter command-line contract
Reproduction
Run the targeted test under xdist repeatedly, or run the full core readiness lane. A temporary path such as .../proc-2715690/... makes the filter 2715 match the main and other-work rows even though only the issue branch should match.
Expected behavior
An issue-number or branch/slug filter should match the worktree branch or worktree directory name, not arbitrary parent directories used by the test runner.
Acceptance criteria
- issue-number, branch, and slug filters match the branch or worktree directory name, not arbitrary parent directories;
- path substrings remain available when the filter includes a path separator;
- the regression test passes under xdist;
- the repository readiness gate passes.
Verification
Run the focused test under xdist, Ruff, formatting, and BASE_REF=origin/main scripts/dev/pr_ready_check.sh. The change is successful only when all required checks pass.
This is a workflow/tooling reliability fix; it makes no research, benchmark, or simulator claim.
Objective
tests/dev/test_compact_worktree_snapshot.py::test_detect_worktrees_filters_by_issue_slug_and_reports_totalcan fail under the parallel readiness lane when pytest creates a temporary parent path containing the issue number. The compact snapshot helper matches filters against the entire absolute path, so an unrelated path component is treated as a worktree match.Scope
Constrain compact worktree snapshot filtering to stable branch and worktree-name fields, while preserving intentional full-path filtering when a path separator is supplied. Add a regression test for a decoy parent path.
Inputs
scripts/dev/compact_worktree_snapshot.pytests/dev/test_compact_worktree_snapshot.py--filtercommand-line contractReproduction
Run the targeted test under xdist repeatedly, or run the full core readiness lane. A temporary path such as
.../proc-2715690/...makes the filter2715match themainandother-workrows even though only the issue branch should match.Expected behavior
An issue-number or branch/slug filter should match the worktree branch or worktree directory name, not arbitrary parent directories used by the test runner.
Acceptance criteria
Verification
Run the focused test under xdist, Ruff, formatting, and
BASE_REF=origin/main scripts/dev/pr_ready_check.sh. The change is successful only when all required checks pass.This is a workflow/tooling reliability fix; it makes no research, benchmark, or simulator claim.