spec-kitty / spec-kitty/spec-kitty

Share the pytest test-venv across lane worktrees instead of rebuilding per lane

Open
#3,959 2 comments 0 reactions 0 assignees View on GitHub
catfooding priority:P2 tech-debt
Dominant language
Python
Stars
1.6k
Forks
165
Avg merge
14h 52m
Merged PRs (30d)
303

Description

## Observed (Spec Kitty 3.2.7rc1, 2026-09-06/07, branch missions/coreloop-proto-missions, PR #3922)

- **F-75** (per-worktree test venv build): `tests/conftest.py` builds `.pytest_cache/spec-kitty-test-venv` on the first pytest session in each worktree (~80 s), so every new lane pays the cost once and the first RED-proof run in a scratch worktree is dominated by it (WP01 RED proof: 2 tests, 79.97 s). With several lanes plus scratch worktrees per mission that is minutes of pure setup per WP, and under machine contention the full `tests/architectural` had to be split into four file-slices to stay under a 600 s foreground cap.
- **F-42** (first pytest in worktree): same cost observed at ~50 s per worktree, per lane, per implementer AND reviewer in Mission A.

## Expected / proposed fix
Let the test venv be shared across worktrees of one checkout (e.g. keyed by lockfile hash under the root repo's `.pytest_cache`, the `.git` common dir, or `~/.cache`), or document an env var to point at an existing one.

## Severity / recurrence
S3. Every fresh worktree in both missions (≈ 12 lanes + scratch worktrees).

## Related
- #3283 OPEN (shared test-venv lock times out during build) and #986 CLOSED (race) — same fixture, different symptom (lock contention); this is the fix direction (commented there). #1907 OPEN (editable-install/worktree hazards) is adjacent.

## Provenance
Observed by an orchestrating agent (Claude Fable 5.1) driving missions fsm-write-path-integrity-01M1TZV6 and dead-port-disposition-01M1TZVN end to end; friction ledger kept out of repo; deduplicated against the tracker before filing.

Contributor guide

Open the contributing guide

Research direction

Start in tests/conftest.py and trace how the test venv is keyed, built, and locked for each worktree. Compare the related behavior in issues #3283 and #986, then run the affected pytest setup and tests/architectural checks. Done means worktrees in one checkout reuse a compatible venv without unsafe races or repeated per-lane builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
developer-experience, performance, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.