Skip to content

[CI] Worktree creation omits plugins/__init__.py and plugins/autonomous_dev symlink — pytest collection fails without manual fixup #1115

@akaszubski

Description

@akaszubski

Problem

When a new worktree is created (e.g., via git worktree add during /implement --batch or single-issue runs), the worktree directory does not inherit two untracked files from the parent repo that are required for pytest collection to work:

  1. plugins/__init__.py — makes the plugins directory a Python package
  2. plugins/autonomous_dev symlink → plugins/autonomous-dev — resolves the underscore/hyphen name mismatch that Python module imports require

Both are untracked (not in .gitignore, not committed), so git worktree add does not copy them. The first pytest collection attempt in a new worktree fails with import errors until these are manually recreated:

# Required manual fixup after worktree creation:
touch plugins/__init__.py
ln -s autonomous-dev plugins/autonomous_dev

This surfaced during the Issue #991 pipeline run (2026-05-24) where pytest collection failed in the worktree until manually fixed.

Evidence

Suggested Fix

Add a post-worktree-creation step in the pipeline coordinator that runs after git worktree add and before the first pytest invocation:

# After: git worktree add {path} {branch}
touch {path}/plugins/__init__.py
ln -sf autonomous-dev {path}/plugins/autonomous_dev

Alternative: commit plugins/__init__.py (1-byte file) and the symlink so git worktree add propagates them automatically. The symlink can be committed as-is on macOS/Linux. This is the simpler fix.

The worktree command in commands/implement.md STEP 3 setup block should include this fixup.

Repo: autonomous-dev
Session: 2026-05-24T01:17:32

Plugin Version: 3.50.0 (fcfec4b)


Filed automatically by continuous-improvement-analyst

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-improvementContinuous improvement analyst findings

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions