fix(hermes): make Mac runtime signing reproducible across hosts

Specify 16 KiB code-signing pages for the normalized Python library. The 4 KiB default reproduces the exact rejected cloud hash; 16 KiB reproduces the existing reviewed bytes. Keep closure pins and dependency locks unchanged.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-08 12:28:13 -05:00
1 parent a60b6badb8
commit 6788c30cf2
2 files changed
+14 -1

No files matched your search

@@ -1172,3 +1172,14 @@ Cloud diagnostics now retain the candidate file manifest before rejected setup
removes its temporary distribution. The original materializer and closure pin
checks remain unchanged. Exact differing files must be identified and explained
before changing any reviewed runtime pin.
The diagnostic manifest establishes that only `python/lib/libpython3.12.dylib`
differs; the other 19,248 files are identical. Explicitly re-signing a task-owned
copy with 4 KiB pages reproduces the rejected cloud hash
`c592b475f247692c43a3c9de87d999c888adf89456d6986722d781425a402486` and size
18,075,920 bytes. Signing with 16 KiB pages reproduces the reviewed hash
`076cd19d748b2409ba5d82b530b68506f07c8edb4d920ac2cfaa8c34e3311d97` and size
17,970,928 bytes. Both signatures verify; the original runtime is untouched.
The materializer now specifies 16 KiB signing pages explicitly. No runtime pin,
dependency, native code, or credential boundary changes. Fresh cold cloud
provisioning remains required to establish that the correction passes.
@@ -41,7 +41,9 @@ if sys.platform == "darwin":
if not shutil.which("install_name_tool") or not shutil.which("codesign"):
raise ValueError("Hermes provisioning requires macOS Command Line Tools (install_name_tool and codesign)")
subprocess.run(["install_name_tool", "-id", "@rpath/libpython3.12.dylib", str(library)], check=True)
subprocess.run(["codesign", "--force", "--sign", "-", "--identifier", "paperclip.hermes.libpython3.12", "--timestamp=none", str(library)], check=True)
# macOS 15 and 26 default to different code-signing page granularities.
# Keep the reviewed library's 16 KiB hash slots on every provisioning host.
subprocess.run(["codesign", "--force", "--sign", "-", "--identifier", "paperclip.hermes.libpython3.12", "--timestamp=none", "--pagesize", "16384", str(library)], check=True)
site = destination / "python/lib/python3.12/site-packages"
site.mkdir(parents=True, exist_ok=True)
# Do not retain editable-install locators, virtualenv hooks, or provenance files