Round 2 candidate 7a585aa9606863a0d44a26094b585160914e3d8fd5f13436b56470cd69e6d867,
packet manifest 4292da90162c801a9c56716a0539f8fa072e67e93e4f4d9a0f1e107b84b652ea,
base 02ee7f640. Filbert approved round 2 in comment 28707. Committed by Sage
for Rocko, who has no git access; secrets grep clean, no binaries (one empty file).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
16 lines
1.3 KiB
Python
16 lines
1.3 KiB
Python
#!/usr/bin/env python3
|
|
import hashlib,pathlib,subprocess
|
|
root=pathlib.Path('/mnt/storage/src/mosaic-stack-rocko-147-r1');out=pathlib.Path(__file__).resolve().parent
|
|
tracked=subprocess.check_output(['git','diff','--name-only'],cwd=root,text=True).splitlines()
|
|
new=subprocess.check_output(['git','ls-files','--others','--exclude-standard','--','packages/project','packages/cli/src/project.mjs','packages/cli/tests/project.test.mjs','packages/business/tests/project-repo.test.mjs'],cwd=root,text=True).splitlines()
|
|
paths=sorted(set(tracked+new))
|
|
assert all(p.startswith(('packages/project/','packages/cli/','packages/business/','scripts/','docs/')) for p in paths)
|
|
patch=subprocess.check_output(['git','diff','--binary','--no-ext-diff'],cwd=root)
|
|
for path in sorted(new):
|
|
p=subprocess.run(['git','diff','--no-index','--binary','--','/dev/null',path],cwd=root,stdout=subprocess.PIPE)
|
|
assert p.returncode==1;patch+=p.stdout
|
|
(out/'build.patch').write_bytes(patch)
|
|
(out/'base.txt').write_bytes(subprocess.check_output(['git','rev-parse','HEAD'],cwd=root))
|
|
(out/'candidate-manifest.sha256').write_text(''.join(hashlib.sha256((root/p).read_bytes()).hexdigest()+' '+p+'\n' for p in paths))
|
|
print('candidate files',len(paths));print('candidate SHA',hashlib.sha256((out/'candidate-manifest.sha256').read_bytes()).hexdigest())
|