import pathlib, subprocess, sys
scratch=pathlib.Path(__file__).parent
for side in ['base','head']:
 root=pathlib.Path.home()/'wt'/('factory-issue-41056-evidence-3'+('-base' if side=='base' else ''))
 for i in range(1,8):
  p=scratch/side/('demo-'+str(i)); p.mkdir(parents=True,exist_ok=True)
  (p/'README.md').write_text('Synthetic timing demonstration\n')
  for args in [['git','init','-q','-b','main'],['git','add','.'],['git','-c','user.name=Demo','-c','user.email=demo@example.invalid','commit','-qm','Initial']]:
   subprocess.run(args,cwd=p,check=True,stdout=subprocess.DEVNULL)
  subprocess.run(['node','apps/server/src/bin.ts','project','add',str(p),'--title','Demo '+str(i),'--base-dir',str(root/'.t3')],cwd=root,check=True,stdout=subprocess.DEVNULL)
print('Created seven synthetic projects per side.')
