from pathlib import Path
import shutil,tarfile,io
HERE=Path(__file__).resolve().parent;RUN=Path('/tmp/cdx-ai-final-weight-read-20261011')
with tarfile.open('/tmp/cdx-final-weight-file-lease.tar','w',format=tarfile.USTAR_FORMAT) as t:
 for p in (HERE/'tools').glob('*.php'):
  shutil.copyfile(p,RUN/p.name);raw=p.read_bytes();i=tarfile.TarInfo(p.name);i.size=len(raw);i.mode=0o600;t.addfile(i,io.BytesIO(raw))
