python-environment

A project rule that selects the correct Python executable for StepCOVNet on Windows. It separates a Windows virtual environment for tests and CPU work from a WSL Linux environment for CUDA-based training and other GPU tasks.

In plain words
What is it for?
Use it when running pytest, linting, CPU scripts, training, CUDA decoding, or MERT extraction. It documents the relevant executable paths and the WSL_VENV, STEPCOVNET_WSL_PYTHON, and STEPCOVNET_NO_WSL overrides.
Why use it?
It prevents scripts from using the wrong environment or hardcoded user-specific paths. It also explains how GPU scripts dispatch to WSL and how to intentionally disable that behavior for CPU-only debugging.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/cpuguy96/stepcovnet/python-environment
Clone the repo
git clone --depth 1 https://github.com/cpuguy96/StepCOVNet

Made for: Cursor.

Per session 605 This file is loaded in full into every session.
When invoked 605 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00605 $0.00605
Opus 5 $0.00302 $0.00302
Sonnet 5 $0.00121 $0.00121
Haiku 4.5 $0.00060 $0.00060

Measured yesterday against content hash 1c0ef1e42b1c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-environment scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/python-environment.mdc · 48 lines

How it starts

The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python environment

Windows development model

StepCOVNet on Windows uses two environments:

Layer Where Purpose
Windows venv venv\ beside the clone pytest, lint, CPU scripts — any clone path
WSL Linux venv default $HOME/stepcovnet-venv-wsl in WSL TensorFlow/PyTorch CUDA — not tied to a Windows username path

GPU scripts that call wsl_gpu.maybe_dispatch_for_training re-exec in WSL and translate the current clone path automatically. Do not hardcode /mnt/c/Users/... or C:\Users\....

Override WSL venv location: WSL_VENV or STEPCOVNET_WSL_PYTHON. Opt out of WSL dispatch: STEPCOVNET_NO_WSL=1.

STEPCOVNET_NO_WSL=1 silently forces Windows CPU — it does not fall back to GPU. Never set it for training, decode, or MERT extraction (measured ~3.5× slower on an AR decode); reserve it for CPU-only debugging where you intend to skip CUDA.

Decision

Workload Where Executable
pytest, lint, edits, CPU scripts Native Windows venv\Scripts\python.exe (from repo root)
Training, MERT --device=cuda, any CUDA on Windows WSL "${STEPCOVNET_WSL_PYTHON:-$HOME/stepcovnet-venv-wsl/bin/python}"

Do not use bare python, pytest, or pip from PATH.

Windows venv (CPU)

Run from repository root:

venv\Scripts\python.exe -m pytest ...
venv\Scripts\python.exe -m pip ...

WSL GPU (summary)

Full command templates: wsl-gpu-stepcovnet skill.

Shared shell vars: scripts/wsl_common.sh. Bootstrap: scripts/wsl_ensure_env.sh. Always source scripts/wsl_gpu_env.sh before TensorFlow import. Set STEPCOVNET_IN_WSL=1. If already inside WSL, do not nest another wsl call.

Read the full file on GitHub · 48 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 48 lines · 605 tokens per session scan A 1c0ef1e42b1c

Subscribe to this mod's changes

python-environment is a cursor rule published in the GitHub repository cpuguy96/StepCOVNet (21 stars, last pushed 7d ago), licensed Apache-2.0. It adds 605 tokens to every session, about $0.0030 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.