# Watch-rig: pod B runs UNDER cdb with the torso write-watch script. $repo = 'C:\git\bt411' $content = Join-Path $repo 'content' $scratch = 'C:\Users\EPILECTRIK\AppData\Local\Temp\claude\C--git-bt411\89ab96e9-6cf0-4555-939d-05bf3708745a\scratchpad' $exe = Join-Path $repo 'build\Release\btl4.exe' $cdb = 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\cdb.exe' if (-not (Test-Path $cdb)) { $cdb = 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe' } $relaylog = Join-Path $scratch 'watch_relay.log' $pidfile = Join-Path $scratch 'watch_pids.txt' if (@(Get-NetTCPConnection -State Listen -LocalPort 1520 -ErrorAction SilentlyContinue).Count -gt 0) { "ABORT: port 1520 in use"; exit 1 } Remove-Item $relaylog, (Join-Path $scratch 'cdb_torso.log') -ErrorAction SilentlyContinue $pids = @() $relay = Start-Process -FilePath 'python' ` -ArgumentList '-u', (Join-Path $repo 'tools\btconsole.py'), '--relay', '1520', (Join-Path $content '_TWIST.EGG'), '--bind', '127.0.0.1', '--manual-launch' ` -WorkingDirectory $content -PassThru ` -RedirectStandardOutput $relaylog -RedirectStandardError (Join-Path $scratch 'watch.err') $pids += $relay.Id Start-Sleep -Seconds 3 $env:BT_START_INSIDE = '1' $env:BT_DEV_GAUGES = '1' $env:BT_RELAY = '127.0.0.1:1520' $env:BT_MATCHLOG = '0' $env:BT_LOG_APPEND = '1' $env:BT_TORSO_LOG = '1' # pod A: normal (the master we ignore) $env:BT_LOG = 'w_a.log'; $env:BT_SELF = '127.0.0.1:1502' $a = Start-Process -FilePath $exe -ArgumentList '-egg','_TWIST.EGG','-net','1502' ` -WorkingDirectory $content -PassThru $pids += $a.Id Start-Sleep -Seconds 2 # pod B: UNDER CDB with the write-watch (its replicant torso is the victim) $env:BT_LOG = 'w_b.log'; $env:BT_SELF = '127.0.0.1:1602' $b = Start-Process -FilePath $cdb ` -ArgumentList '-logo', (Join-Path $scratch 'cdb_torso.log'), '-cf', (Join-Path $scratch 'torso_watch.cdb'), '-o', $exe, '-egg', '_TWIST.EGG', '-net', '1602' ` -WorkingDirectory $content -PassThru $pids += $b.Id Set-Content -Path $pidfile -Value $pids "relay=$($relay.Id) podA=$($a.Id) cdb=$($b.Id)"