# Per-Ticket Reproduction Policy

## Proven Reproduction Steps
1. Inspect the upstream fix to confirm scope: `curl -sL https://github.com/pytorch/pytorch/commit/954dc5183ee9205cbe79876ad05dd2d9ae752139.patch | head -n 40` (or `head -n 300` for full context).
2. Ensure pip is current: `python -m pip install --upgrade pip`.
3. Install a vulnerable PyTorch build (CPU wheels):  
   - `python -m pip install "torch==2.9.1"`  
   - If needed for confirmation across versions: `python3 -m pip install --user --no-cache-dir "torch==2.3.0" --index-url https://download.pytorch.org/whl/cpu`
4. Run the provided reproduction script (this is the confirmed trigger):  
   - `chmod +x repro/reproduction_steps.sh && bash repro/reproduction_steps.sh`
5. Verify the vulnerable code path in the installed package if needed:  
   - `pip show torch | grep Location`  
   - `grep -n "SETITEM\|setitem" $SITE_PACKAGES/torch/_weights_only_unpickler.py | head -30`  
   - `sed -n '460,490p' $SITE_PACKAGES/torch/_weights_only_unpickler.py`
6. (Optional) Cross-check a fixed version: `pip install torch==2.10.0 --quiet` and re-run `bash repro/reproduction_steps.sh`.

## Patterns from Similar Vulnerabilities
- Use `git tag --list | sort -V | tail -n 20` to identify version boundaries before/after a fix.
- Locate the exact file/function with ripgrep or grep, then inspect with `nl -ba ... | sed -n 'start,endp'`.

## Approaches to Avoid
- Do NOT waste time on unrelated greps like `grep -R "owner" -n packages/cli/src`; it provided no signal in prior runs.