Skip to content

friction: compact worktree snapshot filters match pytest parent paths #8176

Description

@ll7

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions