The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
ci(release): stop building macOS Intel and Termux in stable releases by default
Teknium5f9b77cce078
diff --git a/.github/workflows/stable-release.yml b/.github/workflows/stable-release.ymlindex 319abf4c169..1b0d104fd3d 100644--- a/.github/workflows/stable-release.yml+++ b/.github/workflows/stable-release.yml@@ -47,6 +47,10 @@ jobs:release-epoch: ${{ steps.admit.outputs.release-epoch }}skip-bundles: ${{ steps.admit.outputs.skip-bundles }}skip-tests: ${{ steps.admit.outputs.skip-tests }}+ # Opt-in platforms, off unless the claim was cut with --include-macos-intel+ # / --include-termux. A claim without the keys reads them as false.+ include-macos-intel: ${{ steps.admit.outputs.include-macos-intel }}+ include-termux: ${{ steps.admit.outputs.include-termux }}steps:- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7.0.1with:@@ -112,7 +116,7 @@ jobs:termux-checks:needs: admit- if: needs.admit.outputs.skip-tests != 'true'+ if: needs.admit.outputs.skip-tests != 'true' && needs.admit.outputs.include-termux == 'true'permissions:contents: readactions: read@@ -167,8 +171,11 @@ jobs:name: Build signed release candidates (darwin-x64)needs: admit# Starts with the gates; the acceptance join is what requires CI.+ # macOS Intel is opt-in (--include-macos-intel): unsupported on main, and+ # its macos-15-intel runner adds over an hour to the release.if: >-!cancelled() && needs.admit.result == 'success' && needs.admit.outputs.skip-bundles != 'true'+ && needs.admit.outputs.include-macos-intel == 'true'permissions:contents: writeactions: read@@ -253,8 +260,10 @@ jobs:name: Build signed release candidates (termux)needs: admit# Starts with the gates; the acceptance join is what requires CI.+ # Termux is opt-in (--include-termux).if: >-!cancelled() && needs.admit.result == 'success' && needs.admit.outputs.skip-bundles != 'true'+ && needs.admit.outputs.include-termux == 'true'permissions:contents: writeactions: read@@ -308,7 +317,7 @@ jobs:transitions-darwin-x64:name: Pin actual OLD and NEW signed packages (darwin-x64)needs: [admit, candidates-darwin-x64]- if: needs.admit.outputs.skip-tests != 'true'+ if: needs.admit.outputs.skip-tests != 'true' && needs.admit.outputs.include-macos-intel == 'true'runs-on: ubuntu-24.04environment: release-signingoutputs:@@ -522,6 +531,8 @@ jobs:RELEASE_NEEDS: ${{ toJSON(needs) }}SKIP_BUNDLES: ${{ needs.admit.outputs.skip-bundles }}SKIP_TESTS: ${{ needs.admit.outputs.skip-tests }}+ INCLUDE_MACOS_INTEL: ${{ needs.admit.outputs.include-macos-intel }}+ INCLUDE_TERMUX: ${{ needs.admit.outputs.include-termux }}publish-docker:name: Publish tested Docker image@@ -575,6 +586,8 @@ jobs:RELEASE_NEEDS: ${{ toJSON(needs) }}SKIP_BUNDLES: ${{ needs.admit.outputs.skip-bundles }}SKIP_TESTS: ${{ needs.admit.outputs.skip-tests }}+ INCLUDE_MACOS_INTEL: ${{ needs.admit.outputs.include-macos-intel }}+ INCLUDE_TERMUX: ${{ needs.admit.outputs.include-termux }}complete:name: Stable release is green@@ -604,6 +617,8 @@ jobs:RELEASE_NEEDS: ${{ toJSON(needs) }}SKIP_BUNDLES: ${{ needs.admit.outputs.skip-bundles }}SKIP_TESTS: ${{ needs.admit.outputs.skip-tests }}+ INCLUDE_MACOS_INTEL: ${{ needs.admit.outputs.include-macos-intel }}+ INCLUDE_TERMUX: ${{ needs.admit.outputs.include-termux }}- name: Validate the accepted candidate archiveif: needs.admit.outputs.skip-bundles != 'true'run: python -m scripts.releases.stable completediff --git a/apps/desktop/README.md b/apps/desktop/README.mdindex 9e45f41214b..2b0463e66fa 100644--- a/apps/desktop/README.md+++ b/apps/desktop/README.md@@ -11,9 +11,9 @@> **Intel Macs:** the `Hermes-Setup.dmg` bootstrap installer is built for> Apple Silicon (arm64) only, so on an Intel Mac it reports "not supported on-> this Mac". The desktop release pipeline also builds a native `darwin-x64`-> bundle (signed, notarized, with its own update feed); use that build, or-> install the [CLI](../../README.md) and run `hermes desktop`. See+> this Mac". Stable releases build the native `darwin-x64` bundle only when+> cut with `--include-macos-intel`; otherwise install the+> [CLI](../../README.md) and run `hermes desktop`. See> [Platform Support](../../website/docs/getting-started/platform-support.md#build-targets-and-support-priority).<table>diff --git a/scripts/bundles/channel_artifacts.py b/scripts/bundles/channel_artifacts.pyindex 55b73d83665..7858ad92cf4 100644--- a/scripts/bundles/channel_artifacts.py+++ b/scripts/bundles/channel_artifacts.py@@ -10,11 +10,21 @@ from hermes_cli.release_channels import ChannelError, build_prefix, canonical_jsfrom scripts.bundles.release_artifacts import single, validate_windows_bundle, write_appinstaller-def assemble(request: dict, native: dict, root: Path, *, artifact_prefix: str) -> tuple[dict, list[Path]]:+ALL_TARGETS = tuple((platform, arch) for platform in ("macos", "windows") for arch in ("arm64", "x64"))+++def assemble(request: dict, native: dict, root: Path, *, artifact_prefix: str,+ targets=ALL_TARGETS) -> tuple[dict, list[Path]]:+ """``targets`` defaults to every native target. A stable release that did not+ opt into macOS Intel passes the three it built; arm64 macOS and both Windows+ arches are always required."""files = native["files"]rows = native["packages"]- if sorted((row["platform"], row["arch"]) for row in rows) != [- (platform, arch) for platform in ("macos", "windows") for arch in ("arm64", "x64")]:+ targets = sorted(targets)+ if not {("macos", "arm64"), ("windows", "arm64"), ("windows", "x64")} <= set(targets) \+ or not set(targets) <= set(ALL_TARGETS):+ raise ChannelError("Native targets must include macOS arm64 and both Windows architectures")+ if sorted((row["platform"], row["arch"]) for row in rows) != targets:raise ChannelError("Native metadata must cover both platforms and architectures")prefix = build_prefix(request["buildId"])base = request["publicBase"]diff --git a/scripts/bundles/release_artifacts.py b/scripts/bundles/release_artifacts.pyindex 3ef9287fd2f..26f8dfef9fb 100644--- a/scripts/bundles/release_artifacts.py+++ b/scripts/bundles/release_artifacts.py@@ -159,17 +159,29 @@ def validate_windows_bundle(bundle: Path, windows: list[dict]) -> None:raise ValueError("Universal bundle must cover both architectures")+ALL_HANDOFFS = ("win32-x64", "win32-arm64", "darwin-x64", "darwin-arm64", "termux", "windows-universal")+# The opt-in handoffs and the manifest target each one produces.+OPTIONAL_HANDOFFS = {"darwin-x64": "macos/x64", "termux": "termux/aarch64"}++def assemble(root: Path, tag: str, commit: str, public_base: str, out: Path,- *, smoke_results: dict, release_epoch: int, archive: str) -> dict:+ *, smoke_results: dict, release_epoch: int, archive: str,+ handoffs: tuple[str, ...] = ALL_HANDOFFS) -> dict:"""Bind the native metadata to files already staged by their build jobs.`tag` stays the plain payload identity; `archive` is the attempt ref the- manifest and every artifact URL are keyed under."""+ manifest and every artifact URL are keyed under. `handoffs` names the+ groups this release built: the opt-in darwin-x64 and termux groups may be+ left out, and then their targets must be absent from the manifest."""from scripts.releases.handoff import receipt_name, validate_receiptfrom scripts.releases.r2 import put, staging_key_for- smoke_results = accepted_smoke_results(smoke_results)- expected = ("win32-x64", "win32-arm64", "darwin-x64", "darwin-arm64", "termux", "windows-universal")+ expected = tuple(handoffs)+ if (len(set(expected)) != len(expected) or not set(expected) <= set(ALL_HANDOFFS)+ or not set(ALL_HANDOFFS) - set(OPTIONAL_HANDOFFS) <= set(expected)):+ raise ValueError(f"Invalid candidate handoff set: {', '.join(expected)}")+ absent = frozenset(target for name, target in OPTIONAL_HANDOFFS.items() if name not in expected)+ smoke_results = accepted_smoke_results(smoke_results, absent=absent)by_name = {}for name in expected:file = root / receipt_name(name)@@ -210,8 +222,10 @@ def assemble(root: Path, tag: str, commit: str, public_base: str, out: Path,"archive": archive,"packages": packages, "files": files, "smoke_results": smoke_results}validate_candidates(result, tag, commit, public_base, release_epoch, archive=archive)- if not any(row["platform"] == "termux" for row in packages):- raise ValueError("Missing Termux candidate")+ present = {f"{row['platform']}/{row['arch']}" for row in packages}+ for name, target in OPTIONAL_HANDOFFS.items():+ if (target in present) != (name in expected):+ raise ValueError(f"Candidate {target} row differs from the built handoffs")out.write_text(json.dumps(result, indent=2) + "\n", encoding="utf-8")put(tag=archive, key="release-candidates.json", file=out, immutable=True)return result@@ -320,11 +334,19 @@ def promote(manifest: dict, root: Path, public_base: str) -> None:apt = root / "apt"indexes = sorted(p for p in apt.rglob("*") if p.is_file() and not p.relative_to(apt).as_posix().startswith("pool/") and "/by-hash/" not in p.relative_to(apt).as_posix())indexes.sort(key=lambda p: p.name == "InRelease")- if not any(p.name == "InRelease" for p in indexes):+ # Termux is opt-in: a release that did not build it leaves the APT channel+ # on the previous Termux release, and ships no indexes to publish.+ termux = any(row["platform"] == "termux" for row in manifest["packages"])+ if termux and not any(p.name == "InRelease" for p in indexes):raise ValueError("Missing signed APT index")+ if not termux and indexes:+ raise ValueError("APT indexes staged for a release without a Termux candidate")# Every package and index must exist before the first channel write.# The merged feed points at the attempt archive; the version stays plain.- finalize(tag=manifest["tag"], dir=root, archive=manifest["archive"])+ # macOS Intel is opt-in: without it the feed carries the arm64 leg alone.+ arches = tuple(arch for arch in ("arm64", "x64")+ if any(row["platform"] == "macos" and row["arch"] == arch for row in manifest["packages"]))+ finalize(tag=manifest["tag"], dir=root, archive=manifest["archive"], arches=arches)def publish_pointer(key, file):put(tag=manifest["tag"], key=key, file=file, key_is_full=True)digest = hashlib.sha256()diff --git a/scripts/release.py b/scripts/release.pyindex 006003679c1..453691816b4 100755--- a/scripts/release.py+++ b/scripts/release.py@@ -660,6 +660,13 @@ def main():help="Emergency release: skip CI, Nix, PM bundle, install/update E2E, ""Termux, Windows, native smoke and upgrade acceptance jobs. ""Artifacts still build and publish.")+ release_cmd.add_argument("--include-macos-intel", action="store_true",+ help="Also build, test and publish the macOS Intel (darwin-x64) desktop "+ "bundle. Off by default: Intel macOS is not supported on main and "+ "its runner adds over an hour to the release.")+ release_cmd.add_argument("--include-termux", action="store_true",+ help="Also build, test and publish the Termux (Android aarch64) APT "+ "package. Off by default.")# SUPPRESS keeps a --no-changelog given before the subcommand from being# reset by this parser's default.release_cmd.add_argument("--no-changelog", action="store_true", default=argparse.SUPPRESS,diff --git a/scripts/releases/channel_releases.py b/scripts/releases/channel_releases.pyindex 2f54ff1eada..17f3df07c16 100644--- a/scripts/releases/channel_releases.py+++ b/scripts/releases/channel_releases.py@@ -53,9 +53,34 @@ def product_identity(tag: str, run=subprocess.check_output) -> dict:return validate_identity(identity)-def read_native_receipts(root: Path, tag: str, commit: str) -> dict:+# Stable builds macOS Intel only when the claim opts in; the other legs are+# in every bundle release.+OPTIONAL_NATIVE_LEGS = {"darwin-x64": ("macos", "x64")}+++def native_legs(accepted: dict | None) -> tuple[str, ...]:+ """The native legs an accepted stable candidate built (every leg for canary)."""+ if accepted is None:+ return NATIVE_LEGS+ present = {(row.get("platform"), row.get("arch")) for row in accepted.get("packages", [])}+ return tuple(name for name in NATIVE_LEGS+ if name not in OPTIONAL_NATIVE_LEGS or OPTIONAL_NATIVE_LEGS[name] in present)+++def _leg_targets(legs: tuple[str, ...]) -> list[tuple[str, str]]:+ targets = []+ for name in legs:+ if name == "windows-universal":+ continue+ platform, arch = name.split("-")+ targets.append(("macos" if platform == "darwin" else "windows", arch))+ return targets+++def read_native_receipts(root: Path, tag: str, commit: str,+ legs: tuple[str, ...] = NATIVE_LEGS) -> dict:files = {}- for name in NATIVE_LEGS:+ for name in legs:receipt = json.loads((root / handoff.receipt_name(name)).read_text(encoding="utf-8-sig"))for row in handoff.validate_receipt(receipt, tag, commit, name):if row["path"] in files and files[row["path"]] != row:@@ -66,22 +91,26 @@ def read_native_receipts(root: Path, tag: str, commit: str) -> dict:raise ChannelError("Native artifact differs from its receipt")files[row["path"]] = rowrows = []- for platform in ("macos", "windows"):- for arch in ("arm64", "x64"):- name = f"metadata-{platform}-{arch}.json"- if name not in files or not (root / name).is_file():- raise ChannelError(f"Missing receipt-bound native metadata: {name}")- row = json.loads((root / name).read_text(encoding="utf-8-sig"))- if any(row.get(k) != v for k, v in {"platform": platform, "arch": arch, "tag": tag, "commit": commit}.items()):- raise ChannelError("Native metadata release identity mismatch")- rows.append(row)+ for platform, arch in sorted(_leg_targets(legs)):+ name = f"metadata-{platform}-{arch}.json"+ if name not in files or not (root / name).is_file():+ raise ChannelError(f"Missing receipt-bound native metadata: {name}")+ row = json.loads((root / name).read_text(encoding="utf-8-sig"))+ if any(row.get(k) != v for k, v in {"platform": platform, "arch": arch, "tag": tag, "commit": commit}.items()):+ raise ChannelError("Native metadata release identity mismatch")+ rows.append(row)return {"packages": rows, "files": files}def match_accepted_packages(manifest: dict, accepted: dict) -> None:by_target = {(row["platform"], row["arch"]): row for row in accepted["packages"]}- if {(row["platform"], row["arch"]) for row in manifest["packages"]} != {- (platform, arch) for platform in ("darwin", "win32") for arch in ("arm64", "x64")}:+ # Every desktop package the release accepted, and no other: macOS Intel+ # is there only when the claim opted into it.+ accepted_targets = {("darwin" if platform == "macos" else "win32", arch)+ for platform, arch in by_target if platform in ("macos", "windows")}+ required = {("darwin", "arm64"), ("win32", "arm64"), ("win32", "x64")}+ if (not required <= accepted_targets+ or {(row["platform"], row["arch"]) for row in manifest["packages"]} != accepted_targets):raise ChannelError("Protected manifest must include every native target")for package in manifest["packages"]:platform = "macos" if package["platform"] == "darwin" else "windows"@@ -356,9 +385,10 @@ def publish_release(policy: str, env: dict, root: Path) -> dict:if final_claim is not None else None# Native handoffs were staged under the attempt ref for stable attempts# (identical for canary, where tag == payload_tag).- handoff.fetch(tag, commit, list(NATIVE_LEGS), root,+ legs = native_legs(accepted)+ handoff.fetch(tag, commit, list(legs), root,["metadata-*.json", "*.zip", "*.dmg", "*.blockmap", "*.msixbundle"], public_base=publisher.public_base)- native = read_native_receipts(root, tag, commit)+ native = read_native_receipts(root, tag, commit, legs)windows = next(row for row in native["packages"] if row["platform"] == "windows")if policy == "canary-release":expected_windows = canary_windows_version(tag)@@ -385,7 +415,8 @@ def publish_release(policy: str, env: dict, root: Path) -> dict:version=payload_tag[1:], windows_version=windows["version"],identity=identity, policy=policy, release_gate=release_gate,archive_ref=tag if parsed else None)- manifest, feeds = assemble(request, native, root, artifact_prefix=f"releases/tag/{tag}/")+ manifest, feeds = assemble(request, native, root, artifact_prefix=f"releases/tag/{tag}/",+ targets=_leg_targets(legs))if accepted is not None:match_accepted_packages(manifest, accepted)prefix = build_prefix(request["buildId"])@@ -398,8 +429,8 @@ def publish_release(policy: str, env: dict, root: Path) -> dict:def qualified(pinned: dict, actual: dict) -> bool:# Rehash local receipt-bound bytes rather than trusting caller-supplied claims.- expected, _ = assemble(pinned, read_native_receipts(root, tag, commit), root,- artifact_prefix=f"releases/tag/{tag}/")+ expected, _ = assemble(pinned, read_native_receipts(root, tag, commit, legs), root,+ artifact_prefix=f"releases/tag/{tag}/", targets=_leg_targets(legs))if accepted is not None:match_accepted_packages(expected, accepted)diff --git a/scripts/releases/darwin.py b/scripts/releases/darwin.pyindex 81f639689ba..375eccc77e0 100644--- a/scripts/releases/darwin.py+++ b/scripts/releases/darwin.py@@ -78,28 +78,35 @@ def mac_feed_references(text: str) -> list[str]:def merge_mac_feeds(legs: dict[str, str], tag: str, light: bool = False,- archive: str | None = None) -> dict[str, Any]:+ archive: str | None = None, arches: tuple[str, ...] | None = None) -> dict[str, Any]:"""Validate both native legs, merge them, and rewrite artifact URLs intothe immutable per-release tag namespace. `archive` keys that namespace- (the attempt ref for stable attempts); `tag` stays the version identity."""+ (the attempt ref for stable attempts); `tag` stays the version identity.+ `arches` defaults to both; a stable release that did not opt into macOS+ Intel passes ("arm64",) and the feed then carries the arm64 leg alone."""+ arches = ARCHES if arches is None else tuple(arches)+ if "arm64" not in arches or not set(arches) <= set(ARCHES) or len(set(arches)) != len(arches):+ raise ValueError("macOS feeds need the arm64 leg and only known architectures")+ arches = tuple(arch for arch in ARCHES if arch in arches)import hermes_yaml as yaml # lazyversion = tag[1:] if isinstance(tag, str) and tag.startswith("v") else ""if not is_release_version(version):raise ValueError("Invalid macOS release tag")selection = _darwin_feed("canary" if is_canary_tag(tag) else "stable", light)- expected = [f"{arch}-{selection['fileName']}" for arch in ARCHES]+ expected = [f"{arch}-{selection['fileName']}" for arch in arches]if sorted(legs.keys()) != sorted(expected):- raise ValueError("Expected exactly one ARM64 and one x64 macOS feed")+ raise ValueError("Expected exactly one ARM64 and one x64 macOS feed" if len(arches) == 2+ else "Expected exactly one ARM64 macOS feed")files: dict[str, dict[str, Any]] = {}first: dict[str, Any] | None = Nonefor index, name in enumerate(expected):leg = parse_mac_feed(legs[name])if str(leg.get("version")) != version:raise ValueError(f"Feed version does not match {tag}")- prefix = f"{'HermesLight' if light else 'HermesBundled'}-{version}-mac-{ARCHES[index]}"+ prefix = f"{'HermesLight' if light else 'HermesBundled'}-{version}-mac-{arches[index]}"if not any(f.get("url") == f"{prefix}.zip" for f in leg["files"]):- raise ValueError(f"Missing native ZIP for {ARCHES[index]}")+ raise ValueError(f"Missing native ZIP for {arches[index]}")for file_entry in leg["files"]:if file_entry.get("url") not in (f"{prefix}.zip", f"{prefix}.dmg"):raise ValueError(f"Wrong variant or architecture: {file_entry.get('url')}")@@ -169,7 +176,8 @@ def publish_mac_feed(# finalize (real signed transport)# ----------------------------------------------------------------------------def finalize(tag: str, dir: str, variant: str | None = None, archive: str | None = None) -> None:+def finalize(tag: str, dir: str, variant: str | None = None, archive: str | None = None,+ arches: tuple[str, ...] | None = None) -> None:"""Validate both native legs, verify their streamed bytes, then replacethe feed pointer (conditional write, then readback)."""if variant and variant != "light":@@ -183,7 +191,7 @@ def finalize(tag: str, dir: str, variant: str | None = None, archive: str | Nonefor name in sorted(os.listdir(dir))if name.endswith("-mac.yml")}- plan = merge_mac_feeds(legs, tag, variant == "light", archive=archive)+ plan = merge_mac_feeds(legs, tag, variant == "light", archive=archive, arches=arches)def read(key: str) -> dict[str, str] | None:try:diff --git a/scripts/releases/entrypoint.py b/scripts/releases/entrypoint.pyindex 780c1e4f6c0..043b7f2bc80 100644--- a/scripts/releases/entrypoint.py+++ b/scripts/releases/entrypoint.py@@ -194,13 +194,16 @@ def _changelog(repo: Path, repository: str, *, commit: str, tag: str, version: sdef release(commit: str, *, bump: str, repo: Path, remote: str, repository: str,execute, autopublish: bool = False, no_changelog: bool = False,skip_bundles: bool = False, skip_tests: bool = False,+ include_macos_intel: bool = False, include_termux: bool = False,published: tuple[str, str | None] = (SEED, None),run_wait: float = 0, sleep=time.sleep) -> dict:"""Claim the next attempt of the derived version, cut its draft, and start the gate.``published`` is the stable channel's ``(version, commit)``; the commit is- None before the first publication. ``skip_bundles`` and ``skip_tests`` are- written into the claim, which is the one record every later job reads.+ None before the first publication. ``skip_bundles``, ``skip_tests``,+ ``include_macos_intel`` and ``include_termux`` are written into the claim,+ which is the one record every later job reads. macOS Intel and Termux are+ not built unless their include flag is set.``run_wait`` is how many seconds to keep looking for the dispatched run;GitHub lists it a moment after the dispatch returns."""@@ -246,6 +249,8 @@ def release(commit: str, *, bump: str, repo: Path, remote: str, repository: str,"autopublish": autopublish,"skipBundles": skip_bundles,"skipTests": skip_tests,+ "includeMacosIntel": include_macos_intel,+ "includeTermux": include_termux,"claimEpoch": claim_epoch,}, sort_keys=True, separators=(",", ":"))subprocess.check_output(@@ -299,7 +304,8 @@ def release(commit: str, *, bump: str, repo: Path, remote: str, repository: str,return {"version": version, "tag": tag, "commit": commit, "url": url, "repository": repository,"final_url": f"https://github.com/{repository}/releases/tag/v{version}","run_url": run_url, "autopublish": autopublish,- "skip_bundles": skip_bundles, "skip_tests": skip_tests}+ "skip_bundles": skip_bundles, "skip_tests": skip_tests,+ "include_macos_intel": include_macos_intel, "include_termux": include_termux}RUN_POLL_SECONDS = 2@@ -470,6 +476,14 @@ def next_steps(result: dict, *, bold: bool = False) -> str:if result["skip_bundles"]:lines.append("Bundles are skipped. Only the tag, the GitHub release and the Docker image ""ship; the desktop, Termux and Store channels stay on the previous release.")+ else:+ left_out = [(name, flag) for name, flag, on in (+ ("macOS Intel", "--include-macos-intel", result.get("include_macos_intel")),+ ("Termux", "--include-termux", result.get("include_termux"))) if not on]+ if left_out:+ lines.append(f"Not built: {' and '.join(name for name, _ in left_out)} (opt in with "+ f"{' / '.join(flag for _, flag in left_out)}). "+ "Those channels stay on their previous release.")if result["skip_tests"]:warning = "Tests are skipped, since you passed --skip-tests"lines.append(f"\033[1m{warning}\033[0m" if bold else warning)@@ -506,6 +520,7 @@ def cmd_release(args) -> None:commit, bump=args.bump, repo=repo, remote=remote, repository=repository,execute=execute, autopublish=args.autopublish, no_changelog=args.no_changelog,skip_bundles=args.skip_bundles, skip_tests=args.skip_tests,+ include_macos_intel=args.include_macos_intel, include_termux=args.include_termux,published=published_stable_identity(repository), run_wait=RUN_WAIT_SECONDS,)print(next_steps(result, bold=sys.stdout.isatty() and "NO_COLOR" not in os.environ))diff --git a/scripts/releases/r2.py b/scripts/releases/r2.pyindex 2962251b180..ba1d75c0016 100644--- a/scripts/releases/r2.py+++ b/scripts/releases/r2.py@@ -701,12 +701,13 @@ def put_object(print(f"OK r2: {key} ({size} bytes)")-def finalize(tag: str, dir: str, variant: str | None = None, archive: str | None = None) -> None:+def finalize(tag: str, dir: str, variant: str | None = None, archive: str | None = None,+ arches: tuple[str, ...] | None = None) -> None:"""Lazy re-export of the Darwin finalize so callers can treatscripts.releases.r2 as the single transport surface."""from . import darwin as darwin_module- darwin_module.finalize(tag=tag, dir=dir, variant=variant, archive=archive)+ darwin_module.finalize(tag=tag, dir=dir, variant=variant, archive=archive, arches=arches)def put(diff --git a/scripts/releases/sequencer.py b/scripts/releases/sequencer.pyindex 227693fd9c6..b7b499ef4a0 100644--- a/scripts/releases/sequencer.py+++ b/scripts/releases/sequencer.py@@ -238,7 +238,8 @@ def discover(repository: str, run=output) -> list[dict]:commit = claim_ref["commit"]claim = _tag_message(claim_tag, claim_ref["object"], run)try:- validate_claim(claim, version=version, attempt=attempt, commit=commit)+ # Normalized: a claim cut before the opt-in platform flags reads them as false.+ claim = validate_claim(claim, version=version, attempt=attempt, commit=commit)except ValueError as error:raise ValueError(f"{claim_tag} metadata is invalid") from errorclaim_epoch = claim["claimEpoch"]diff --git a/scripts/releases/stable.py b/scripts/releases/stable.pyindex feb71d77f7e..fcdf4033aa9 100644--- a/scripts/releases/stable.py+++ b/scripts/releases/stable.py@@ -21,12 +21,18 @@ from scripts.releases.versioning import tag_recordSHA = re.compile(r"[a-f0-9]{40}")DIGEST = re.compile(r"[a-f0-9]{64}")DESKTOP_TARGETS = ("windows/x64", "windows/arm64", "macos/x64", "macos/arm64")+# Built only when the claim opts in (includeMacosIntel / includeTermux). Every+# other desktop target is in every bundle release.+OPTIONAL_TARGETS = ("macos/x64", "termux/aarch64")+REQUIRED_DESKTOP_TARGETS = tuple(t for t in DESKTOP_TARGETS if t not in OPTIONAL_TARGETS)SMOKE_JOBS = {"smoke-darwin-arm64": "macOS DMG + ZIP (arm64)","smoke-darwin-x64": "macOS DMG + ZIP (x64)","smoke-win32-arm64": "Windows MSIX (arm64)","smoke-win32-x64": "Windows MSIX (x64)",}+SMOKE_TARGETS = {"smoke-darwin-arm64": "macos/arm64", "smoke-darwin-x64": "macos/x64",+ "smoke-win32-arm64": "windows/arm64", "smoke-win32-x64": "windows/x64"}def admit_claim(tag: str, commit: str, *, on_main) -> dict:@@ -64,22 +70,30 @@ def require_success(needs: dict, required: list[str]) -> None:# The claim flags that remove stable-release.yml jobs, per job. A job one of-# the claim's active flags removes must report `skipped`. Every other gated job-# must report `success`. Jobs not listed here never skip.+# the claim's active removals removes must report `skipped`. Every other gated+# job must report `success`. Jobs not listed here never skip.CLAIM_FLAGS = ("autopublish", "skipBundles", "skipTests")+# Opt-in platforms. A claim cut before these existed has neither key, and a+# missing key means false: those packages are not built unless asked for.+OPTIONAL_CLAIM_FLAGS = ("includeMacosIntel", "includeTermux")+# Removal reasons. The include flags remove their jobs when they are off._TESTS, _BUNDLES = frozenset({"skipTests"}), frozenset({"skipBundles"})+_INTEL, _TERMUX = frozenset({"excludeMacosIntel"}), frozenset({"excludeTermux"})SKIPPED_BY = {- **{job: _TESTS for job in ("ci", "nix", "termux-checks", "windows-live", "install-e2e",+ **{job: _TESTS for job in ("ci", "nix", "windows-live", "install-e2e","bootstrap-version")},- **{job: _BUNDLES for job in ("candidates-darwin-arm64", "candidates-darwin-x64",+ "termux-checks": _TESTS | _TERMUX,+ **{job: _BUNDLES for job in ("candidates-darwin-arm64","candidates-win32-arm64", "candidates-win32-x64",- "candidates-win32-bundle", "candidates-termux",+ "candidates-win32-bundle","candidate-manifest", "publish-bundles")},+ "candidates-darwin-x64": _BUNDLES | _INTEL,+ "candidates-termux": _BUNDLES | _TERMUX,# Bundle acceptance is a test of bundles, so either flag removes it.**{job: _TESTS | _BUNDLES for job in ("pm-bundle", "transitions-darwin-arm64",- "transitions-darwin-x64", "transitions-win32",- "windows-packaged", "macos-packaged-arm64",- "macos-packaged-x64")},+ "transitions-win32",+ "windows-packaged", "macos-packaged-arm64")},+ **{job: _TESTS | _BUNDLES | _INTEL for job in ("transitions-darwin-x64", "macos-packaged-x64")},}@@ -89,18 +103,24 @@ PACKAGED_BY = {"macos-packaged-arm64": "transitions-darwin-arm64","windows-packaged": "transitions-win32"}-def gate_expectations(required: list[str], *, skip_bundles: bool, skip_tests: bool) -> dict:+def gate_expectations(required: list[str], *, skip_bundles: bool, skip_tests: bool,+ include_macos_intel: bool = False, include_termux: bool = False) -> dict:"""Each gated job's required result under the claim's flags."""- active = {flag for flag, on in (("skipBundles", skip_bundles), ("skipTests", skip_tests)) if on}+ active = {flag for flag, on in (("skipBundles", skip_bundles), ("skipTests", skip_tests),+ ("excludeMacosIntel", not include_macos_intel),+ ("excludeTermux", not include_termux)) if on}return {name: "skipped" if SKIPPED_BY.get(name, frozenset()) & active else "success"for name in required}-def require_gate(needs: dict, required: list[str], *, skip_bundles: bool, skip_tests: bool) -> None:+def require_gate(needs: dict, required: list[str], *, skip_bundles: bool, skip_tests: bool,+ include_macos_intel: bool = False, include_termux: bool = False) -> None:"""``require_success`` that also demands a flag-removed job really was skipped."""if not required or len(set(required)) != len(required):raise ValueError("Invalid required-job list")- expected = gate_expectations(required, skip_bundles=skip_bundles, skip_tests=skip_tests)+ expected = gate_expectations(required, skip_bundles=skip_bundles, skip_tests=skip_tests,+ include_macos_intel=include_macos_intel,+ include_termux=include_termux)for packaged, planner in PACKAGED_BY.items():# Without a published baseline there is no OLD package, so the planner# skips the upgrade arm. Only that planner's own successful output can excuse it.@@ -114,12 +134,13 @@ def require_gate(needs: dict, required: list[str], *, skip_bundles: bool, skip_traise ValueError("Release blocked: " + ", ".join(failures))-def accepted_smoke_results(needs: object) -> dict:+def accepted_smoke_results(needs: object, *, absent: tuple[str, ...] | frozenset = ()) -> dict:"""Persist only observed native groups, never infer them from artifacts.Every group passed, or every group was skipped. Only a claim that skippedtests may produce the second shape. ``smokes_skipped`` lets claim-aware- readers check that.+ readers check that. A group whose target the release did not build+ (``absent``) ran no smoke, so it must be recorded as skipped."""if not isinstance(needs, dict):raise ValueError("Candidate smoke results must be a job-result object")@@ -128,7 +149,13 @@ def accepted_smoke_results(needs: object) -> dict:row = needs.get(job)results[job] = {"result": row.get("result") if isinstance(row, dict) else None}if {row["result"] for row in results.values()} != {"skipped"}:- require_success(results, list(SMOKE_JOBS))+ built = [job for job in SMOKE_JOBS if SMOKE_TARGETS[job] not in absent]+ require_success(results, built)+ unbuilt = [f"{job}={results[job]['result']}" for job in SMOKE_JOBS+ if job not in built and results[job]["result"] != "skipped"]+ if unbuilt:+ raise ValueError("Smoke results name targets this release did not build: "+ + ", ".join(unbuilt))return results@@ -188,7 +215,7 @@ def _validated_rows(manifest: dict, tag: str, commit: str, public_base: str,rows = {}for item in manifest["packages"]:target = f"{item.get('platform')}/{item.get('arch')}"- if target not in (*DESKTOP_TARGETS, "termux/aarch64") or target in rows or item.get("tag") != tag or item.get("commit") != commit:+ if target not in (*DESKTOP_TARGETS, *OPTIONAL_TARGETS) or target in rows or item.get("tag") != tag or item.get("commit") != commit:raise ValueError(f"Invalid or duplicate candidate target: {target}")artifact = item.get("artifact", {})url = urlsplit(artifact.get("url", ""))@@ -227,12 +254,23 @@ def validate_candidates(manifest: dict, tag: str, commit: str, public_base: str,never is."""rows = _validated_rows(manifest, tag, commit, public_base, release_epoch, archive=archive)- accepted_smoke_results(manifest.get("smoke_results"))- if any(target not in rows for target in DESKTOP_TARGETS):- raise ValueError("Candidate manifest must cover Windows and macOS on both architectures")+ if any(target not in rows for target in REQUIRED_DESKTOP_TARGETS):+ raise ValueError("Candidate manifest must cover Windows on both architectures and macOS arm64")+ accepted_smoke_results(manifest.get("smoke_results"),+ absent=frozenset(t for t in OPTIONAL_TARGETS if t not in rows))return rows+def require_targets_match_claim(manifest: dict, *, include_macos_intel: bool,+ include_termux: bool) -> None:+ """The opt-in targets are in the manifest exactly when the claim asked for them."""+ present = {f"{row.get('platform')}/{row.get('arch')}" for row in manifest.get("packages", [])}+ for target, wanted in (("macos/x64", include_macos_intel), ("termux/aarch64", include_termux)):+ if (target in present) != wanted:+ raise ValueError(f"Candidate manifest {'lacks' if wanted else 'carries'} {target}, "+ "which differs from the claim")++def validate_receipt(manifest: dict, receipt: str, tag: str, commit: str, public_base: str,release_epoch: int | None = None, *, archive: str) -> dict:"""One per-arch or bundle receipt: exactly that group's rows and no others."""@@ -278,7 +316,20 @@ def plan_transitions(previous: dict, candidate: dict, public_base: str) -> list[archive=previous.get("archive"))new = validate_candidates(candidate, candidate.get("tag"), candidate.get("commit"), public_base,archive=candidate.get("archive"))- return [_transition_row(target, old[target], new[target]) for target in DESKTOP_TARGETS]+ # An opt-in target upgrades only between two releases that both built it.+ return [_transition_row(target, old[target], new[target]) for target in DESKTOP_TARGETS+ if target in new and target in old]+++def baseline_covers(previous: dict, receipt: str, public_base: str) -> bool:+ """Whether the published baseline built every target of this receipt.++ A release that left macOS Intel out has no OLD Intel package, so the next+ release that opts back in has nothing to upgrade from on that arch.+ """+ old = validate_candidates(previous, previous.get("tag"), previous.get("commit"), public_base,+ archive=previous.get("archive"))+ return all(target in old for target in RECEIPT_TARGETS[receipt])def plan_receipt_transitions(previous: dict, receipt_manifest: dict, receipt: str,@@ -400,16 +451,24 @@ def output(argv: list[str]) -> str:def validate_claim(metadata: object, *, version: str, attempt: int, commit: str) -> dict:- """The claim message's exact shape. It is the one record of the attempt's policy."""+ """The claim message's exact shape. It is the one record of the attempt's policy.++ The opt-in platform flags are optional: every claim cut before they+ existed lacks them, and ``release`` writes them only when set. A missing+ one reads as false. The returned copy always carries both.+ """expected = {"schema": 1, "version": version, "attempt": attempt, "commit": commit}+ required = {*expected, *CLAIM_FLAGS, "claimEpoch"}if (not isinstance(metadata, dict)or any(metadata.get(key) != value for key, value in expected.items())or any(not isinstance(metadata.get(flag), bool) for flag in CLAIM_FLAGS)+ or any(not isinstance(metadata[flag], bool)+ for flag in OPTIONAL_CLAIM_FLAGS if flag in metadata)or not isinstance(metadata.get("claimEpoch"), int)or metadata["claimEpoch"] <= 0- or set(metadata) != {*expected, *CLAIM_FLAGS, "claimEpoch"}):+ or not required <= set(metadata) <= {*required, *OPTIONAL_CLAIM_FLAGS}):raise ValueError("Stable claim metadata is invalid")- return metadata+ return {**{flag: False for flag in OPTIONAL_CLAIM_FLAGS}, **metadata}def _claim_metadata(raw: str, *, version: str, attempt: int, commit: str) -> dict:@@ -503,7 +562,9 @@ def check_claim(env: dict, run=output) -> dict:raise ValueError("Stable claim epoch differs from its annotated tagger timestamp")return {**admitted, "claim_object": local_object,"autopublish": metadata["autopublish"], "skip_bundles": metadata["skipBundles"],- "skip_tests": metadata["skipTests"], "claim_epoch": claim_epoch}+ "skip_tests": metadata["skipTests"],+ "include_macos_intel": metadata["includeMacosIntel"],+ "include_termux": metadata["includeTermux"], "claim_epoch": claim_epoch}def stable_context(env: dict, run=output) -> tuple[str, str, dict]:@@ -619,13 +680,18 @@ def admit(env: dict) -> None:"release-id": release["databaseId"], "release-epoch": admitted["claim_epoch"],"skip-bundles": "true" if admitted["skip_bundles"] else "false","skip-tests": "true" if admitted["skip_tests"] else "false",+ "include-macos-intel": "true" if admitted["include_macos_intel"] else "false",+ "include-termux": "true" if admitted["include_termux"] else "false",}, env)skipped = [name for name, on in (("bundles", admitted["skip_bundles"]),("tests", admitted["skip_tests"])) if on]+ opted = [name for name, on in (("macOS Intel", admitted["include_macos_intel"]),+ ("Termux", admitted["include_termux"])) if on]summary(f"## Stable candidate {admitted['claim_tag']}\nCommit: {admitted['commit']}\n"f"Version: {admitted['version']}\nPayload tag: {admitted['tag']}\n"- f"Skipped: {', '.join(skipped) or 'nothing'}\n",+ f"Skipped: {', '.join(skipped) or 'nothing'}\n"+ f"Opt-in packages: {', '.join(opted) or 'none (macOS Intel and Termux are not built)'}\n",env,)@@ -697,9 +763,10 @@ def transitions(env: dict) -> None:previous = _published_baseline(env, base)receipt_manifest = _receipt_from_env(env, receipt, "RECEIPT", base)matrices = {"windows": {"include": []}, "macos": {"include": []}}- if previous is None:+ if previous is None or not baseline_covers(previous, receipt, base):# Native smokes still gate this release. Its packages become the- # baseline that the next bundle release must upgrade from.+ # baseline that the next bundle release must upgrade from. A baseline+ # that left this receipt's opt-in target out has no OLD package either.validate_receipt(receipt_manifest, receipt, receipt_manifest.get("tag"),receipt_manifest.get("commit"), base, archive=receipt_manifest.get("archive"))emit({**matrices, "baseline": "none"}, env)@@ -725,6 +792,13 @@ CANDIDATE_HANDOFFS = ("win32-x64", "win32-arm64", "darwin-x64", "darwin-arm64",CANDIDATE_INCLUDES = ("metadata-*.json", "*.msixbundle")+def claim_handoffs(*, include_macos_intel: bool, include_termux: bool) -> tuple[str, ...]:+ """The handoffs a claim's candidate calls stage. Opt-in groups only when asked for."""+ omitted = {name for name, on in (("darwin-x64", include_macos_intel),+ ("termux", include_termux)) if not on}+ return tuple(name for name in CANDIDATE_HANDOFFS if name not in omitted)++def candidate_manifest(env: dict) -> None:"""Merge the staged handoffs into the accepted candidate manifest."""from scripts.bundles.release_artifacts import assemble@@ -736,24 +810,29 @@ def candidate_manifest(env: dict) -> None:tag, commit, claim = stable_context(env)if claim["skip_bundles"]:raise ValueError("A claim that skipped bundles has no candidate manifest")+ handoffs = claim_handoffs(include_macos_intel=claim["include_macos_intel"],+ include_termux=claim["include_termux"])+ # A call the claim did not opt into never ran, so it has no smoke to record.+ calls = {call: job for call, job in CALL_SMOKE_JOBS.items()+ if call != "candidates-darwin-x64" or claim["include_macos_intel"]}+ smoke = {job: {"result": "skipped"} for job in CALL_SMOKE_JOBS.values()}if claim["skip_tests"]:# The calls built and staged their groups but ran no smoke. Record# that as skipped. Never let a green call stand in for a smoke.- require_success(needs, list(CALL_SMOKE_JOBS))- smoke = {job: {"result": "skipped"} for job in CALL_SMOKE_JOBS.values()}+ require_success(needs, list(calls))else:- smoke = {job: {"result": (needs.get(call) or {}).get("result")}- for call, job in CALL_SMOKE_JOBS.items()}- require_success(smoke, list(smoke))+ ran = {job: {"result": (needs.get(call) or {}).get("result")} for call, job in calls.items()}+ require_success(ran, list(ran))+ smoke.update(ran)base = env["CLOUDFLARE_R2_PUBLIC_URL"].rstrip("/")archive = claim["claim_tag"]with tempfile.TemporaryDirectory() as directory:root = Path(directory)- fetch(tag=archive, commit=commit, names=list(CANDIDATE_HANDOFFS), root=root,+ fetch(tag=archive, commit=commit, names=list(handoffs), root=root,includes=list(CANDIDATE_INCLUDES))out = root / "release-candidates.json"assemble(root, tag, commit, base, out, smoke_results=smoke,- release_epoch=claim["claim_epoch"], archive=archive)+ release_epoch=claim["claim_epoch"], archive=archive, handoffs=handoffs)digest = hashlib.sha256(out.read_bytes()).hexdigest()emit({"manifest-url": f"{base}/releases/tag/{archive}/release-candidates.json","manifest-sha256": digest}, env)@@ -912,6 +991,8 @@ def complete(env: dict) -> None:candidate = read_candidate(env)validate_candidates(candidate, tag, commit, base, claim["claim_epoch"], archive=claim["claim_tag"])require_smokes_match_claim(candidate, skip_tests=claim["skip_tests"])+ require_targets_match_claim(candidate, include_macos_intel=claim["include_macos_intel"],+ include_termux=claim["include_termux"])def _flag(env: dict, name: str) -> bool:@@ -928,7 +1009,9 @@ def main(argv: list[str] | None = None, env: dict | None = None) -> None:needs = json.loads(env["RELEASE_NEEDS"])summary("\n".join(f"- {name}: {needs.get(name, {}).get('result', 'missing')}" for name in argv[1:]), env)require_gate(needs, argv[1:], skip_bundles=_flag(env, "SKIP_BUNDLES"),- skip_tests=_flag(env, "SKIP_TESTS"))+ skip_tests=_flag(env, "SKIP_TESTS"),+ include_macos_intel=_flag(env, "INCLUDE_MACOS_INTEL"),+ include_termux=_flag(env, "INCLUDE_TERMUX"))returnif argv and argv[0] == "stage-receipt":if len(argv) != 3 or argv[1] != "--receipt" or argv[2] not in RECEIPT_TARGETS:diff --git a/tests/ci/test_stable_release_graph.py b/tests/ci/test_stable_release_graph.pyindex 7beffd9d80d..a111eed6441 100644--- a/tests/ci/test_stable_release_graph.py+++ b/tests/ci/test_stable_release_graph.py@@ -103,8 +103,11 @@ def test_claim_flags_remove_exactly_the_jobs_the_gate_expects_skipped():from scripts.releases.stable import SKIPPED_BYjobs = workflow("stable-release.yml")["jobs"]- outputs = {"skipTests": "needs.admit.outputs.skip-tests",- "skipBundles": "needs.admit.outputs.skip-bundles"}+ # A skip flag removes a job when it is true; an opt-in flag when it is not.+ outputs = {"skipTests": "needs.admit.outputs.skip-tests != 'true'",+ "skipBundles": "needs.admit.outputs.skip-bundles != 'true'",+ "excludeMacosIntel": "needs.admit.outputs.include-macos-intel == 'true'",+ "excludeTermux": "needs.admit.outputs.include-termux == 'true'"}def needs_of(name):needs = jobs[name].get("needs", [])@@ -112,7 +115,7 @@ def test_claim_flags_remove_exactly_the_jobs_the_gate_expects_skipped():def removed_by(name, flag):condition = str(jobs[name].get("if", ""))- if f"{outputs[flag]} != 'true'" in condition:+ if outputs[flag] in condition:return True# Without a status function a job skips when any job it needs skipped.return ("always()" not in condition and "!cancelled()" not in condition@@ -128,12 +131,15 @@ def test_claim_flags_remove_exactly_the_jobs_the_gate_expects_skipped():for name in ("docker", "candidates-darwin-arm64", "candidates-darwin-x64", "candidates-win32-arm64","candidates-win32-x64", "candidates-win32-bundle", "candidates-termux"):assert jobs[name]["with"]["skip-tests"] == "${{ needs.admit.outputs.skip-tests == 'true' }}"- assert {"skip-bundles", "skip-tests"} <= set(jobs["admit"]["outputs"])+ assert {"skip-bundles", "skip-tests", "include-macos-intel", "include-termux"} <= \+ set(jobs["admit"]["outputs"])for name in ("acceptance", "publication", "complete"):gate = next(step for step in jobs[name]["steps"]if "scripts.releases.stable gate" in step.get("run", ""))assert gate["env"]["SKIP_BUNDLES"] == "${{ needs.admit.outputs.skip-bundles }}"assert gate["env"]["SKIP_TESTS"] == "${{ needs.admit.outputs.skip-tests }}"+ assert gate["env"]["INCLUDE_MACOS_INTEL"] == "${{ needs.admit.outputs.include-macos-intel }}"+ assert gate["env"]["INCLUDE_TERMUX"] == "${{ needs.admit.outputs.include-termux }}"gated = gate["run"].split(" gate ", 1)[1].split()assert set(gated) <= set(needs_of(name)), namediff --git a/tests/scripts/test_release_artifacts.py b/tests/scripts/test_release_artifacts.pyindex 692582e5baa..a02870e1f3d 100644--- a/tests/scripts/test_release_artifacts.py+++ b/tests/scripts/test_release_artifacts.py@@ -257,6 +257,23 @@ def test_promote_writes_the_stable_mac_feed_from_the_attempt_archive(tmp_path, massert f"/releases/tag/{manifest['archive']}/HermesBundled-1.2.3-mac-arm64.zip" in urlsassert f"/releases/tag/{manifest['archive']}/HermesBundled-1.2.3-mac-x64.zip" in urls+ # A release that did not opt into macOS Intel or Termux promotes an+ # arm64-only Mac feed and leaves the APT channel untouched.+ default = copy.deepcopy(manifest)+ default['packages'] = [row for row in default['packages']+ if (row['platform'], row['arch']) not in (('macos', 'x64'), ('termux', 'aarch64'))]+ default['files'] = [f for f in default['files'] if '-mac-x64' not in f['path']+ and not f['path'].startswith('x64-') and not f['path'].startswith(('apt/', 'deb/'))]+ default['smoke_results'] = {**default['smoke_results'], 'smoke-darwin-x64': {'result': 'skipped'}}+ del r2_server.store['releases/darwin/stable/stable-mac.yml']+ r2_server.requests.clear()+ artifacts.promote(default, tmp_path / 'promote-default', base)+ puts = [path for method, path, _ in r2_server.requests if method == 'PUT']+ assert puts == ['/hermes-releases/releases/darwin/stable/stable-mac.yml',+ '/hermes-releases/releases/win32/stable/stable.appinstaller']+ feed = hermes_yaml.safe_load(r2_server.store['releases/darwin/stable/stable-mac.yml'][0].decode())+ assert [entry['url'].rsplit('/', 1)[1] for entry in feed['files']] == ['HermesBundled-1.2.3-mac-arm64.zip']+def test_promote_refuses_when_one_macos_arch_is_missing(tmp_path, monkeypatch, r2_server, https_origin, staged_candidate):import urllib.requestdiff --git a/tests/scripts/test_release_channels.py b/tests/scripts/test_release_channels.pyindex e143821f6b4..3bdf8417efd 100644--- a/tests/scripts/test_release_channels.py+++ b/tests/scripts/test_release_channels.py@@ -464,6 +464,15 @@ def test_accepted_release_receipts_feed_the_protected_head_without_rebuilding(tmchannel_releases.match_accepted_packages(manifest, wrong)with pytest.raises(ChannelError, match="every native"):channel_releases.match_accepted_packages(dict(manifest, packages=manifest["packages"][:1]), accepted)+ # A release that did not opt into macOS Intel accepts three desktop packages.+ def no_intel(rows, key):+ return [row for row in rows if (row[key], row["arch"]) not in (("darwin", "x64"), ("macos", "x64"))]+ lean = dict(accepted, packages=no_intel(accepted["packages"], "platform"))+ assert channel_releases.native_legs(lean) == ("darwin-arm64", "win32-arm64", "win32-x64", "windows-universal")+ assert channel_releases.native_legs(accepted) == channel_releases.NATIVE_LEGS+ channel_releases.match_accepted_packages(dict(manifest, packages=no_intel(manifest["packages"], "platform")), lean)+ with pytest.raises(ChannelError, match="every native"):+ channel_releases.match_accepted_packages(manifest, lean)# Exercise the real controller, HTTP receipt downloader, immutable feeds,# manifest and final CAS; only GitHub admission and generated product facts# are fixture inputs (no native signature acceptance is claimed here).diff --git a/tests/scripts/test_release_entrypoint.py b/tests/scripts/test_release_entrypoint.pyindex a7e7c4d64a3..a8643f6d35b 100644--- a/tests/scripts/test_release_entrypoint.py+++ b/tests/scripts/test_release_entrypoint.py@@ -112,6 +112,9 @@ def test_release_claims_the_first_attempt_creates_a_draft_and_dispatches(source)"schema": 1,"skipBundles": True,"skipTests": False,+ # macOS Intel and Termux are opt-in, and off unless asked for.+ "includeMacosIntel": False,+ "includeTermux": False,"version": "0.21.5",}create = calls[0]diff --git a/tests/scripts/test_stable_release.py b/tests/scripts/test_stable_release.pyindex 4735e6d492c..4b8ed4cd578 100644--- a/tests/scripts/test_stable_release.py+++ b/tests/scripts/test_stable_release.py@@ -11,7 +11,7 @@ from pathlib import Pathimport pytest-from tests.scripts.test_release_r2 import r2_server+from tests.scripts.test_release_r2 import r2_server as r2_server # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this importfrom scripts.releases.draft_warning import (WARNING_CLOSE, WARNING_OPEN, strip_draft_warning,)@@ -69,7 +69,8 @@ def test_gate_requires_every_success_including_real_cli(tmp_path):require_success(needs, required)summary = tmp_path / "summary.md"env = {**os.environ, "RELEASE_NEEDS": json.dumps(success), "GITHUB_STEP_SUMMARY": str(summary), "PYTHONPATH": str(ROOT),- "SKIP_BUNDLES": "false", "SKIP_TESTS": "false"}+ "SKIP_BUNDLES": "false", "SKIP_TESTS": "false",+ "INCLUDE_MACOS_INTEL": "false", "INCLUDE_TERMUX": "false"}argv = [sys.executable, "-m", "scripts.releases.stable", "gate", *required]assert subprocess.run(argv, cwd=tmp_path, env=env, capture_output=True, check=False).returncode == 0empty = subprocess.run(argv[:4], cwd=tmp_path, env=env, capture_output=True, text=True, encoding="utf-8", check=False)@@ -86,7 +87,8 @@ def test_gate_requires_every_flag_removed_job_to_have_skipped(tmp_path, skip_bunfrom scripts.releases.stable import SKIPPED_BY, gate_expectationsrequired = ["admit", "docker", "publish-docker", *SKIPPED_BY]- expected = gate_expectations(required, skip_bundles=skip_bundles, skip_tests=skip_tests)+ expected = gate_expectations(required, skip_bundles=skip_bundles, skip_tests=skip_tests,+ include_macos_intel=True, include_termux=True)# The flags remove jobs; they never remove admission or the Docker image.assert expected["admit"] == expected["docker"] == expected["publish-docker"] == "success"assert expected["transitions-win32"] == expected["pm-bundle"] == "skipped"@@ -94,7 +96,8 @@ def test_gate_requires_every_flag_removed_job_to_have_skipped(tmp_path, skip_bunenv = {**os.environ, "RELEASE_NEEDS": json.dumps(needs), "PYTHONPATH": str(ROOT),"GITHUB_STEP_SUMMARY": str(tmp_path / "summary.md"),"SKIP_BUNDLES": "true" if skip_bundles else "false",- "SKIP_TESTS": "true" if skip_tests else "false"}+ "SKIP_TESTS": "true" if skip_tests else "false",+ "INCLUDE_MACOS_INTEL": "true", "INCLUDE_TERMUX": "true"}argv = [sys.executable, "-m", "scripts.releases.stable", "gate", *required]assert subprocess.run(argv, cwd=tmp_path, env=env, capture_output=True, check=False).returncode == 0# A removed job that ran anyway blocks the release, and so does an unflagged gate.@@ -386,6 +389,8 @@ def test_claim_object_movement_and_lightweight_tags_fail_closed(tmp_path, monkey"claim_tag": "rc.1-v1.2.3", "claim_object": claim_object,"tag": "v1.2.3", "version": "1.2.3", "attempt": 1, "commit": commit,"autopublish": False, "skip_bundles": False, "skip_tests": False,+ # A claim without the opt-in platform keys reads them as false.+ "include_macos_intel": False, "include_termux": False,"claim_epoch": 1_790_000_000,}# The metadata binds the attempt its ref names.@@ -442,6 +447,87 @@ def test_claim_object_movement_and_lightweight_tags_fail_closed(tmp_path, monkeycheck_claim(env)+def test_a_claim_cut_before_the_opt_in_platform_flags_still_parses():+ """rc.1..rc.11 of v0.21.6/v0.21.7 carry no includeMacosIntel/includeTermux keys."""+ from scripts.releases.stable import _claim_metadata, validate_claim++ commit = "a" * 40+ old = {"schema": 1, "version": "0.21.7", "attempt": 11, "commit": commit,+ "autopublish": True, "skipBundles": False, "skipTests": False,+ "claimEpoch": 1_790_000_000}+ raw = json.dumps(old, sort_keys=True, separators=(",", ":"))+ parsed = _claim_metadata(raw, version="0.21.7", attempt=11, commit=commit)+ assert parsed == {**old, "includeMacosIntel": False, "includeTermux": False}+ assert old == json.loads(raw) # the caller's record is not mutated+ new = {**old, "includeMacosIntel": True, "includeTermux": False}+ assert validate_claim(new, version="0.21.7", attempt=11, commit=commit) == new+ # The keys stay optional, never loose: a non-boolean or an unknown key is refused.+ for wrong in ({**old, "includeTermux": "yes"}, {**old, "includeLinux": True}):+ with pytest.raises(ValueError, match="metadata is invalid"):+ validate_claim(wrong, version="0.21.7", attempt=11, commit=commit)+++def test_a_default_claim_builds_no_macos_intel_or_termux_and_the_flags_restore_them(+ tmp_path, r2_server, https_origin, monkeypatch):+ from scripts.releases import stable++ opt_in = {"candidates-darwin-x64", "transitions-darwin-x64", "macos-packaged-x64",+ "candidates-termux", "termux-checks"}+ required = ["admit", "docker", *stable.SKIPPED_BY]+ default = stable.gate_expectations(required, skip_bundles=False, skip_tests=False)+ assert {name for name, result in default.items() if result == "skipped"} == opt_in+ both = stable.gate_expectations(required, skip_bundles=False, skip_tests=False,+ include_macos_intel=True, include_termux=True)+ assert set(both.values()) == {"success"}+ intel = stable.gate_expectations(required, skip_bundles=False, skip_tests=False,+ include_macos_intel=True)+ assert {name for name, result in intel.items() if result == "skipped"} == \+ {"candidates-termux", "termux-checks"}+ # The skip flags still remove an opted-in platform's jobs.+ assert stable.gate_expectations(["candidates-termux"], skip_bundles=True, skip_tests=False,+ include_termux=True) == {"candidates-termux": "skipped"}++ # Only the default groups stage handoffs; the manifest is complete without+ # the x64 Mac and Termux rows and records the unbuilt smoke as skipped.+ https_origin.store = r2_server.store+ built = tmp_path / "built"+ built.mkdir()+ _stage_darwin_handoff(built, "arm64")+ _stage_windows_handoff(built, "x64")+ _stage_windows_handoff(built, "arm64")+ _stage_universal_bundle(built)+ monkeypatch.setattr(stable, "stable_context", _fake_stable_context(+ include_macos_intel=False, include_termux=False))+ calls = {call: {"result": "success"} for call in stable.CALL_SMOKE_JOBS+ if call != "candidates-darwin-x64"}+ calls["candidates-darwin-x64"] = {"result": "skipped"}+ env = {**_receipt_env(tmp_path, https_origin.base), "RELEASE_NEEDS": json.dumps(calls)}+ stable.main(["candidate-manifest"], env)+ stored, _ = r2_server.store[f"releases/tag/{ATTEMPT}/release-candidates.json"]+ manifest = json.loads(stored)+ assert {f"{row['platform']}/{row['arch']}" for row in manifest["packages"]} == {+ "macos/arm64", "windows/x64", "windows/arm64"}+ assert manifest["smoke_results"]["smoke-darwin-x64"] == {"result": "skipped"}+ stable.validate_candidates(manifest, "v1.2.3", RECEIPT_COMMIT, https_origin.base,+ RELEASE_EPOCH, archive=ATTEMPT)+ stable.require_targets_match_claim(manifest, include_macos_intel=False, include_termux=False)+ with pytest.raises(ValueError, match="lacks macos/x64"):+ stable.require_targets_match_claim(manifest, include_macos_intel=True, include_termux=False)+ # A smoke that claims to have passed for a target nobody built is refused.+ forged = {**manifest, "smoke_results": {**manifest["smoke_results"],+ "smoke-darwin-x64": {"result": "success"}}}+ with pytest.raises(ValueError, match="did not build"):+ stable.validate_candidates(forged, "v1.2.3", RECEIPT_COMMIT, https_origin.base,+ RELEASE_EPOCH, archive=ATTEMPT)+ # A claim that opted in needs the opt-in handoffs: a missing one leaves no manifest.+ del r2_server.store[f"releases/tag/{ATTEMPT}/release-candidates.json"]+ monkeypatch.setattr(stable, "stable_context", _fake_stable_context(include_termux=True,+ include_macos_intel=False))+ with pytest.raises(Exception, match="handoff-termux"):+ stable.main(["candidate-manifest"], env)+ assert f"releases/tag/{ATTEMPT}/release-candidates.json" not in r2_server.store++def _claim_fixture(tmp_path, *, tag, version, skip_bundles=False, skip_tests=False):"""A real checkout + bare remote carrying one annotated attempt claim."""from scripts.releases.versioning import parse_attempt_ref@@ -478,6 +564,10 @@ def test_complete_writes_no_final_tag_and_leaves_the_draft_on_the_attempt_ref(tmcommit, tag_object = _claim_fixture(tmp_path, tag="rc.1-v1.2.3", version="1.2.3")candidate = candidates("v1.2.3", commit, "c" * 64, archive="rc.1-v1.2.3")+ # The claim did not opt into macOS Intel, so the accepted manifest has no x64 Mac row.+ candidate["packages"] = [row for row in candidate["packages"]+ if (row["platform"], row["arch"]) != ("macos", "x64")]+ candidate["smoke_results"]["smoke-darwin-x64"] = {"result": "skipped"}calls = []def record(argv):@@ -713,11 +803,13 @@ WINDOWS_VERSION = "2026.5761.123.0"RELEASE_EPOCH = 1_787_965_323-def _fake_stable_context(*, skip_tests=False):+def _fake_stable_context(*, skip_tests=False, include_macos_intel=True, include_termux=True):def context(env):return "v1.2.3", RECEIPT_COMMIT, {"claim_tag": ATTEMPT, "claim_object": "0" * 40,"claim_epoch": RELEASE_EPOCH, "skip_bundles": False,- "skip_tests": skip_tests}+ "skip_tests": skip_tests,+ "include_macos_intel": include_macos_intel,+ "include_termux": include_termux}return context@@ -961,12 +1053,13 @@ def test_gate_excuses_an_upgrade_arm_only_for_its_planners_no_baseline_output():needs = {name: {"result": "skipped"} for name in PACKAGED_BY}needs.update({name: {"result": "success", "outputs": {"baseline": "none"}}for name in PACKAGED_BY.values()})- require_gate(needs, required, skip_bundles=False, skip_tests=False)+ require_gate(needs, required, skip_bundles=False, skip_tests=False, include_macos_intel=True)for packaged, planner in PACKAGED_BY.items():for planned in ({"result": "success", "outputs": {"baseline": "published"}},{"result": "success"}, {"result": "failure", "outputs": {"baseline": "none"}}):with pytest.raises(ValueError, match=packaged):- require_gate({**needs, planner: planned}, required, skip_bundles=False, skip_tests=False)+ require_gate({**needs, planner: planned}, required, skip_bundles=False, skip_tests=False,+ include_macos_intel=True)def test_candidate_manifest_needs_every_call_and_stages_the_archive_manifest(diff --git a/website/docs/developer-guide/stable-releases.md b/website/docs/developer-guide/stable-releases.mdindex a2b91581fbe..b3b460d8c7c 100644--- a/website/docs/developer-guide/stable-releases.md+++ b/website/docs/developer-guide/stable-releases.md@@ -22,14 +22,15 @@ files on `main`.non-prerelease GitHub draft on it, and dispatch `Stable Release` on that exactref. The attempt number comes from the existing attempt refs of that version.The claim message binds its commit, attempt number, autopublish policy,- `skipBundles` and `skipTests` flags, and+ `skipBundles`, `skipTests`, `includeMacosIntel` and `includeTermux` flags, andone monotonically allocated epoch. That epoch is the release date and nativepackaging clock for every matrix leg and retry. One outstanding attempt, ofany version, blocks a new `release`.3. Admit the exact remote annotated tag-object SHA, peeled commit, `GITHUB_REF`,`GITHUB_SHA`, checked-out `HEAD`, and ancestry on `origin/main`.-4. Run the whole source, Docker, Nix, PM bundle, install/update, Termux, Windows,- signed-package, and native-upgrade acceptance graph.+4. Run the whole source, Docker, Nix, PM bundle, install/update, Windows,+ signed-package, and native-upgrade acceptance graph (plus macOS Intel and+ Termux when the claim opted into them).5. Push immutable versioned Docker and R2 artifacts from the tested bytes. TheDocker image is pushed as soon as its own tests pass, tagged by the attemptref. Do not move `stable` or `latest` aliases yet and do not rebuild for@@ -148,6 +149,38 @@ and the protected R2 advance) refuses a manifest whose smoke results disagreewith the claim's `skipTests` flag. Use it only for an emergency fix, and cut anormal release after it.+### macOS Intel and Termux are opt-in++A stable release does not build the macOS Intel (`darwin-x64`) desktop bundle+or the Termux (Android aarch64) APT package unless the claim asks for them.+Intel macOS is not supported on `main`, and its `macos-15-intel` bundle leg+alone takes well over an hour. Both remain buildable:++```sh+python scripts/release.py release --commit "$(git rev-parse origin/main)" \+ --include-macos-intel --include-termux --remote origin+```++| | default | `--include-macos-intel` | `--include-termux` |+|---|---|---|---|+| `candidates-darwin-x64`, `transitions-darwin-x64`, `macos-packaged-x64` | skipped | run | skipped |+| `candidates-termux`, `termux-checks` | skipped | skipped | run |++Like the skip flags, `--include-macos-intel` and `--include-termux` are written+into the claim (`includeMacosIntel`, `includeTermux`) and `admit` emits them as+`include-macos-intel` and `include-termux`. A claim without those keys, which+includes every claim cut before they existed, reads them as `false`. The gate+requires an opted-out job to report `skipped`, and `--skip-bundles` /+`--skip-tests` still remove these jobs when the platform is opted in.++When a platform is left out, its rows are absent from the candidate manifest,+the release body's downloads table and the downloads page, and its channel+stays on the previous release that built it: the macOS feed then lists only the+arm64 leg, the protected R2 head carries three native packages, and the APT+indexes are not rewritten. A release that opts macOS Intel back in after one+that left it out has no published Intel baseline, so its Intel upgrade arm is+skipped like a first release.+The claim push is the atomic version lock. Two callers may derive the same nextversion, but only one push wins; the loser reports the winning tagger, time, andcommit. A rejected or abandoned claim remains spent. To publish or abandon:@@ -248,7 +281,8 @@ retain no downloadable job artifacts.The desktop workflow takes a `jobs` input with the groups `darwin-arm64`,`darwin-x64`, `win32-arm64`, `win32-x64`, `win32-bundle`, `linux-x64`,`linux-arm64`, and `termux`. Stable calls it once per group, except the linux-groups, which wait for a real Linux build. Each Mac arch and the Windows bundle+groups, which wait for a real Linux build, and the opt-in `darwin-x64` and+`termux` groups, which it calls only when the claim includes them. Each Mac arch and the Windows bundlestage a receipt, and each install arm starts from its own receipt as soon asits own bytes are staged. `acceptance` is the one join that blocks publication.diff --git a/website/docs/getting-started/platform-support.md b/website/docs/getting-started/platform-support.mdindex 973d747d9a1..929a04061e3 100644--- a/website/docs/getting-started/platform-support.md+++ b/website/docs/getting-started/platform-support.md@@ -33,18 +33,20 @@ PRs will be accepted to fix issues with them, but they will take precedence belo| OS / Architecture | Installation methods | Notes || ------------------------------ | -------------------------------------------------------------------- | ---------------------------------------------------------------------------- || **Nix** (macOS, Linux, NixOS) | [Nix flake and modules](./nix-setup.md) | Nix owns runtime installation and updates. |-| **Android / [Termux](./termux.md)** (aarch64) | [Signed APT repository](./termux.md), then `pkg install hermes-agent` | Prerelease package with Python, Node, and TUI. Run the gateway in a Termux session; Android can terminate background processes. |+| **Android / [Termux](./termux.md)** (aarch64) | [Signed APT repository](./termux.md), then `pkg install hermes-agent` | Prerelease package with Python, Node, and TUI. Not built by default: only releases cut with `--include-termux` update the APT channel. Run the gateway in a Termux session; Android can terminate background processes. |### Build targets and support priority-The native bundle pipeline includes Intel macOS (`x64`) as well as Apple Silicon.-It also defines signed-package update acceptance for both architectures.-That coverage does not change the Tier 1 priority assigned to Apple Silicon.-The `Hermes-Setup.dmg` bootstrap installer is the exception: it is built for-Apple Silicon (`arm64`) only, so on an Intel Mac it reports "not supported on-this Mac". Intel Macs use the `darwin-x64` desktop bundle instead, or install+Stable releases build the macOS desktop bundle for Apple Silicon (`arm64`) only.+The Intel macOS (`x64`) bundle and the Termux APT package are **not built by+default**: a release includes them only when it is cut with+`release.py release --include-macos-intel` or `--include-termux`. Releases+without them leave the Intel macOS update feed and the Termux APT channel on+the last release that built them.+The `Hermes-Setup.dmg` bootstrap installer is built for Apple Silicon only, so+on an Intel Mac it reports "not supported on this Mac". Intel Macs can installthe [CLI](./installation.md#linux--macos--wsl2--android-termux) and run-`hermes desktop`.+`hermes desktop`, or use a `darwin-x64` bundle from a release that included it.Linux desktop packaging is disabled in the release workflow, although localAppImage builds and native Linux PM bundle checks exist.@@ -57,7 +59,7 @@ PRs to fix them will _not_ be accepted, and any code that keeps compatibility wi- Android / Termux on non-aarch64 devices (aarch64 is [supported](./termux.md) via our APT package)- installs via the AUR (we might upstream patches if it helps out <3)-- 32-bit x86 macOS. Intel x86_64 has native bundle build and package-update acceptance lanes; this does not change the Tier 1 priority for Apple Silicon.+- 32-bit x86 macOS. Intel x86_64 desktop bundles are built only for releases cut with `--include-macos-intel`.- installs via `pypi` (e.g. `uv tool install hermes-agent`, `pip install hermes-agent`, etc.)- installs via `brew` (`brew install hermes-agent`)