# VCN #45 Bench - get a Windows machine ready to write an eval for a coding agent. # Doctor first, then scaffold. Idempotent and safe: it never deletes anything, # never touches global config, and never installs a system package for you (it # prints the one line to run instead). # # Run: irm https://vcn-45-bench.vercel.app/wire.ps1 | iex # Doctor only, changes nothing: # & ([scriptblock]::Create((irm https://vcn-45-bench.vercel.app/wire.ps1))) -Check # # There are NO credentials in this file. It never prints your key. ASCII only. # Uninstall: delete the directory it created. Nothing else was touched. param( [switch]$Check, [string]$Dir = "bench", [switch]$Yes ) $ErrorActionPreference = "Continue" $BASE = "https://vcn-45-bench.vercel.app" $script:Failed = 0 function Ok ($m) { Write-Host " OK $m" } function Warn ($m) { Write-Host " WARN $m" } function Bad ($m) { Write-Host " FAIL $m"; $script:Failed = 1 } function Have ($c) { return [bool](Get-Command $c -ErrorAction SilentlyContinue) } Write-Host "" Write-Host "VCN #45 Bench - machine doctor" Write-Host "-----------------------------------------------------------" Ok "platform: Windows PowerShell $($PSVersionTable.PSVersion)" if ($PSVersionTable.PSVersion.Major -lt 6) { Warn "PowerShell 5.x: '&&' does not chain here. Use ';' or 'a; if (`$?) { b }'" } # --- node ----------------------------------------------------------------- if (Have node) { $nv = (node -v) -replace '^v','' $maj = 0; [void][int]::TryParse(($nv -split '\.')[0], [ref]$maj) if ($maj -ge 18) { Ok "node v$nv (>= 18)" } else { Bad "node v$nv is too old, need 18+"; Write-Host " installer: https://nodejs.org" } } else { Bad "node not found, need 18+" Write-Host " installer: https://nodejs.org" } if (Have npm) { Ok "npm $(npm -v)" } else { Bad "npm not found (ships with node)" } # --- claude code ---------------------------------------------------------- if (Have claude) { Ok "claude code on PATH" } else { Warn "claude code not found" Write-Host " npm install -g @anthropic-ai/claude-code" Write-Host " if it installs but is still not found, add 'npm bin -g' to PATH" } # --- python + pytest (the oracle runtime) -------------------------------- $py = $null foreach ($c in @("python","python3","py")) { if (Have $c) { $py = $c; break } } if ($py) { Ok "$py $(& $py -c 'import sys;print(""%d.%d""%sys.version_info[:2])' 2>$null)" & $py -c "import pytest" 2>$null if ($?) { Ok "pytest importable (oracles can run)" } else { Warn "pytest not installed: your oracle needs SOME test runner" Write-Host " $py -m pip install pytest" } } else { Warn "no python found. Fine if your oracle is not python, but the example is." } if (Have git) { Ok "git $((git --version) -split ' ' | Select-Object -Last 1)" } else { Bad "git not found: lab 1 uses git worktree" } # --- bash availability (for .sh oracles) --------------------------------- if (Have bash) { Ok "bash on PATH (Git Bash): .sh oracles will run" } else { Warn "no bash: a .sh oracle will NOT run natively on Windows" Write-Host " either install Git for Windows, or write oracle.ps1 instead" Write-Host " (the deck's Windows tab shows the PowerShell oracle)" } # --- gateway reachability (no key needed, no key sent) ------------------- $gw = "https://immersivecommons13.tail5da903.ts.net/" try { $r = Invoke-WebRequest -Uri $gw -Method Head -TimeoutSec 12 -UseBasicParsing Ok "workshop gateway answers (HTTP $($r.StatusCode))" } catch { $code = $null if ($null -ne $_.Exception.Response) { $code = [int]$_.Exception.Response.StatusCode } if ($null -ne $code) { Ok "workshop gateway answers (HTTP $code; 404 on / is expected)" } else { Bad "workshop gateway unreachable (network/DNS/TLS). Tell the facilitator." } } # --- env vars ------------------------------------------------------------- if ($env:ANTHROPIC_AUTH_TOKEN) { Ok "ANTHROPIC_AUTH_TOKEN is set (value not shown)" if ($env:ANTHROPIC_BASE_URL) { Ok "ANTHROPIC_BASE_URL is set" } else { Warn "ANTHROPIC_BASE_URL not set: claude will talk to the wrong host" } } else { Warn "ANTHROPIC_AUTH_TOKEN not set yet" Write-Host " request a key: https://immersivecommons.com/zai-keys" Write-Host " then in THIS window:" Write-Host ' $env:ANTHROPIC_BASE_URL = "https://immersivecommons13.tail5da903.ts.net"' Write-Host ' $env:ANTHROPIC_AUTH_TOKEN = "agt_your_key_here"' Write-Host ' $env:ANTHROPIC_MODEL = "glm-4.6"' Write-Host ' $env:ANTHROPIC_SMALL_FAST_MODEL = "glm-4.5-air"' Write-Host " full setup: $BASE/setup.txt" } Write-Host "-----------------------------------------------------------" if ($script:Failed -ne 0) { Write-Host "Some hard requirements are missing. Fix those first." Write-Host "Full setup: $BASE/setup.txt" if ($Check) { exit 1 } } if ($Check) { Write-Host "Doctor only, nothing changed."; exit 0 } # --- scaffold ------------------------------------------------------------- Write-Host "" if (Test-Path $Dir) { Write-Host "$Dir already exists, leaving it exactly as it is." } else { if (-not $Yes) { $ans = Read-Host "Create the bench skeleton in .\$Dir ? [y/N]" if ($ans -notmatch '^(y|yes)$') { Write-Host "Skipped."; exit 0 } } New-Item -ItemType Directory -Force -Path "$Dir\tasks\001-example", "$Dir\results" | Out-Null # NOTE: written with UTF8 and LF-friendly content. If you later hand a .sh to # bash, keep it LF or bash reports: bad interpreter: bash^M Set-Content -Encoding utf8 "$Dir\tasks\001-example\prompt.md" @' Replace this with one real task from your own repo. A good first task is a bug you have ALREADY fixed, so you know the answer: 1. find the fix commit in your history 2. check out its parent into this task's repo\ directory 3. write one sentence here describing what to fix '@ Set-Content -Encoding utf8 "$Dir\tasks\001-example\oracle.ps1" @' # The oracle: exit 0 is pass, anything else is fail. No opinions, no LLM. $ErrorActionPreference = "Stop" Set-Location "$PSScriptRoot\repo" # Point this at the ONE test that decides this task: pytest tests/test_example.py -q exit $LASTEXITCODE '@ Set-Content -Encoding utf8 "$Dir\probe_oracle.ps1" @' # Probe an oracle for determinism BEFORE trusting it. # Two runs on unchanged code must give the SAME exit code. param([Parameter(Mandatory=$true)][string]$Oracle) powershell -NoProfile -File $Oracle *> $null; $a = $LASTEXITCODE powershell -NoProfile -File $Oracle *> $null; $b = $LASTEXITCODE Write-Host "run1=$a run2=$b" if ($a -eq $b) { Write-Host "DETERMINISTIC (verdict $a). Safe to trust this oracle." } else { Write-Host "FLAKY ORACLE. Fix this before blaming the agent:" Write-Host " every number you compute from it is noise." exit 1 } '@ Ok "scaffolded .\$Dir (tasks\001-example, probe_oracle.ps1, results\)" Write-Host "" Write-Host "You write runner.py during lab 3. The code is on the slides:" Write-Host " $BASE (slide 17, Windows tab)" Write-Host "Prose for your agent: $BASE/llms.txt" } Write-Host "" Write-Host "Doors 19:00, walkthrough 19:30, Frontier Tower Floor 10. See you there."