#!/usr/bin/env python3
"""Resume the same real-app driver, then capture all after harness rows."""
from pathlib import Path
import subprocess,sys
R=Path('/tmp/issue-lead-33252-r2/evidence-capture')
def run(*args,cwd=None):subprocess.run(list(map(str,args)),cwd=cwd,check=True)
def scenes(side,row):
 for width,theme in [(1440,'dark'),(1440,'light'),(390,'dark'),(390,'light')]:
  run(sys.executable,R/'capture.py','capture',side,width,theme,row)
run('bash',R/'session-state.sh','populated')
scenes('before','LP')
run('bash',R/'session-state.sh','empty')
server=Path((R/'after-location.txt').read_text().strip())
with (R/'after-pair-final.private.log').open('w') as f:
 subprocess.run(['node','apps/server/src/bin.ts','pair','--base-dir',str(server/'home')],cwd='/home/ubuntu/wt/issue-33252',stdout=f,stderr=f,check=True)
run(sys.executable,R/'capture.py','pair','after',R/'after-pair-final.private.log')
scenes('after','E')
run('bash',R/'session-state.sh','populated')
scenes('after','LP')
run(sys.executable,R/'harness-capture.py','after')
