#!/usr/bin/env python3
"""Retake both sides with identical pointer modality before each recording."""
from pathlib import Path
import subprocess,sys,os
R=Path('/tmp/issue-lead-33252-r2/evidence-capture')
for side in ['after','before']:
 server=Path((R/(side+'-location.txt')).read_text().strip())
 private=R/(side+'-pair-interactions.private.log')
 with private.open('w') as f:
  subprocess.run(['node','apps/server/src/bin.ts','pair','--base-dir',str(server/'home')],cwd='/home/ubuntu/wt/issue-33252'+('-before' if side=='before' else ''),stdout=f,stderr=f,check=True)
 subprocess.run([sys.executable,R/'capture.py','pair',side,private],check=True)
 for width,theme in [(1440,'dark'),(1440,'light'),(390,'dark'),(390,'light')]:
  subprocess.run([sys.executable,R/'capture.py','capture',side,str(width),theme,'LP'],check=True)
 subprocess.run([sys.executable,R/'harness-capture.py',side,'M','F','C','G','A','D','I','O','W'],env={**os.environ,'EVIDENCE_W_EMPTY':'1'},check=True)
