import pathlib, subprocess, sys
root=pathlib.Path(sys.argv[1]); root.mkdir(parents=True,exist_ok=True)
workspace=root/'copy-demo';workspace.mkdir(exist_ok=True)
external=root/'reference';external.mkdir(exist_ok=True)
(external/'numbered.ts').write_text(''.join(f'// numbered source line {i:03d}\n' for i in range(1,302)))
(workspace/'README.md').write_text('# Read-only source copy\n\nOpen [numbered.ts]('+str(external/'numbered.ts')+') outside this workspace.\n')
(workspace/'paste.txt').write_text('Paste destination\n')
for args in [['init','--quiet','--initial-branch=main'],['add','.'],['-c','user.name=Scenario','-c','user.email=scenario@example.invalid','commit','--quiet','-m','Synthetic copy fixture']]:
 subprocess.run(['git',*args],cwd=workspace,check=True)
print(workspace)
