# Implementation: Rewrite VRAM Detection as Python Script ## Summary Replaced `scripts/vram_detect.sh` with `scripts/vram_detect.py`, a testable Python implementation that produces the same JSON output and fixes several bugs. ## Files Changed - `scripts/vram_detect.py` (new) - `scripts/vram_detect.sh` (deleted) - `scripts/install.sh` — updated to run Python script and parse JSON with Python - `README.md` — updated references - `prompts/onboarding.md` — updated references and invocation - `prompts/decompose.md` — updated references - `prompts/orchestrate.md` — updated references ## Bugs Fixed - Undefined `$headroom_pct` in manual mode. - Hardcoded `"headroom": 0.25` in JSON output. - Code-block values in `config.md` being parsed as live config. - GPU-counting/output ordering bug. - 10KB file-read limit now enforced for API config files. ## Verification - `python scripts/vram_detect.py` runs and emits valid JSON. - `python scripts/vram_detect.py gpt-4o` detects 128k context. - `python scripts/vram_detect.py --model claude-3-5-sonnet` detects 200k context. - `rg "vram_detect\.sh" README.md scripts/install.sh prompts/` returns no matches.