Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

feat(release): automate Driver and Lume attribution (#2267)

Francesco Bonacci50199272cff6
diff --git a/.github/release-attribution-config.json b/.github/release-attribution-config.json
new file mode 100644
index 0000000000..d619588618
--- /dev/null
+++ b/.github/release-attribution-config.json
@@ -0,0 +1,31 @@
+{
+ "bots": [
+ "dependabot[bot]",
+ "github-actions[bot]",
+ "copilot",
+ "release-please[bot]",
+ "renovate[bot]",
+ "trycua-release[bot]"
+ ],
+ "ignoredCoauthorEmails": [
+ ],
+ "coauthorOverrides": {
+ "hippoley <[email protected]>": "hippoley"
+ },
+ "identityOverrides": {
+ "[email protected]": "ddupont808",
+ "[email protected]": "f-trycua",
+ "[email protected]": "pavelklymenko",
+ "[email protected]": "enchanted-koala",
+ "[email protected]": "sarinali"
+ },
+ "internalHandles": [
+ "enchanted-koala",
+ "f-trycua"
+ ],
+ "optOutHandles": []
+}
diff --git a/.github/release-manifest.schema.json b/.github/release-manifest.schema.json
new file mode 100644
index 0000000000..f1a57a0725
--- /dev/null
+++ b/.github/release-manifest.schema.json
@@ -0,0 +1,111 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "https://github.com/trycua/cua/.github/release-manifest.schema.json",
+ "title": "Cua release manifest",
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "schema",
+ "schemaVersion",
+ "repository",
+ "product",
+ "displayName",
+ "version",
+ "bump",
+ "tag",
+ "sha",
+ "previousTag",
+ "compareUrl",
+ "changelog",
+ "visualRequested",
+ "changes",
+ "contributors",
+ "assets"
+ ],
+ "properties": {
+ "schema": { "type": "string", "format": "uri" },
+ "schemaVersion": { "const": 1 },
+ "repository": { "type": "string", "pattern": "^[^/]+/[^/]+$" },
+ "product": { "type": "string", "minLength": 1 },
+ "displayName": { "type": "string", "minLength": 1 },
+ "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+" },
+ "bump": { "enum": ["patch", "minor", "major"] },
+ "tag": { "type": "string", "minLength": 1 },
+ "sha": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
+ "previousTag": { "type": ["string", "null"] },
+ "compareUrl": { "type": "string", "format": "uri" },
+ "changelog": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["path", "sha256"],
+ "properties": {
+ "path": { "type": "string" },
+ "sha256": { "$ref": "#/$defs/sha256" }
+ }
+ },
+ "visualRequested": { "type": "boolean" },
+ "changes": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["type", "scope", "summary", "breaking", "pr", "issues", "contributors"],
+ "properties": {
+ "type": { "enum": ["feat", "fix", "perf", "revert"] },
+ "scope": { "type": ["string", "null"] },
+ "summary": { "type": "string", "minLength": 1 },
+ "breaking": { "type": "boolean" },
+ "pr": { "type": "integer", "minimum": 1 },
+ "issues": { "type": "array", "items": { "type": "integer", "minimum": 1 }, "uniqueItems": true },
+ "contributors": { "type": "array", "items": { "$ref": "#/$defs/changeContributor" } }
+ }
+ }
+ },
+ "contributors": {
+ "type": "array",
+ "items": { "$ref": "#/$defs/releaseContributor" }
+ },
+ "assets": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["name", "bytes", "sha256"],
+ "properties": {
+ "name": { "type": "string" },
+ "bytes": { "type": "integer", "minimum": 0 },
+ "sha256": { "$ref": "#/$defs/sha256" }
+ }
+ }
+ }
+ },
+ "$defs": {
+ "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
+ "changeContributor": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["login", "role", "external"],
+ "properties": {
+ "login": { "type": "string", "minLength": 1 },
+ "role": { "enum": ["author", "coauthor", "reporter"] },
+ "external": { "type": "boolean" }
+ }
+ },
+ "releaseContributor": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["login", "roles", "external"],
+ "properties": {
+ "login": { "type": "string", "minLength": 1 },
+ "roles": {
+ "type": "array",
+ "items": { "enum": ["author", "coauthor", "reporter"] },
+ "minItems": 1,
+ "uniqueItems": true
+ },
+ "external": { "type": "boolean" }
+ }
+ }
+ }
+}
diff --git a/.github/release-notes/cua-driver-rs.md b/.github/release-notes/cua-driver-rs.md
new file mode 100644
index 0000000000..b7685ae45a
--- /dev/null
+++ b/.github/release-notes/cua-driver-rs.md
@@ -0,0 +1,17 @@
+## Install
+
+macOS and Linux:
+
+```bash
+/bin/bash -c "$(curl -fsSL https://cua.ai/driver/install.sh)"
+```
+
+Windows:
+
+```powershell
+irm https://cua.ai/driver/install.ps1 | iex
+```
+
+Cua Driver ships universal macOS binaries, x86_64 and arm64 Windows builds,
+and Linux preview builds. Release assets also include tag-pinned installer and
+uninstaller scripts.
diff --git a/.github/release-notes/lume.md b/.github/release-notes/lume.md
new file mode 100644
index 0000000000..81826d5b21
--- /dev/null
+++ b/.github/release-notes/lume.md
@@ -0,0 +1,8 @@
+## Install
+
+```bash
+/bin/bash -c "$(curl -fsSL https://cua.ai/lume/install.sh)"
+```
+
+Lume releases include a notarized macOS command-line archive and installer
+package, plus stable alias filenames for the install script.
diff --git a/.github/scripts/github_release.py b/.github/scripts/github_release.py
new file mode 100644
index 0000000000..c2883827a6
--- /dev/null
+++ b/.github/scripts/github_release.py
@@ -0,0 +1,312 @@
+#!/usr/bin/env python3
+"""Upload assets to a Release Please draft and publish it exactly once."""
+
+from __future__ import annotations
+
+import argparse
+import json
+import mimetypes
+import os
+from pathlib import Path
+import sys
+import time
+from typing import Any, Mapping, Sequence
+from urllib.error import HTTPError, URLError
+from urllib.parse import quote, urlencode
+from urllib.request import Request, urlopen
+
+
+class ReleaseError(RuntimeError):
+ """A release lifecycle invariant failed."""
+
+
+class GitHubApi:
+ RETRYABLE_STATUS_CODES = {429, 500, 502, 503, 504}
+
+ def __init__(
+ self,
+ token: str,
+ api_url: str = "https://api.github.com",
+ *,
+ max_attempts: int = 4,
+ retry_base_seconds: float = 1.0,
+ ) -> None:
+ if not token:
+ raise ReleaseError("GH_TOKEN is required")
+ if max_attempts < 1:
+ raise ValueError("max_attempts must be at least 1")
+ self.token = token
+ self.api_url = api_url.rstrip("/")
+ self.max_attempts = max_attempts
+ self.retry_base_seconds = retry_base_seconds
+
+ def _retry_delay(self, error: HTTPError | None, attempt: int) -> float:
+ if error is not None:
+ retry_after = error.headers.get("Retry-After")
+ if retry_after:
+ try:
+ return max(0.0, float(retry_after))
+ except ValueError:
+ pass
+ return self.retry_base_seconds * (2 ** (attempt - 1))
+
+ def request(
+ self,
+ method: str,
+ path: str,
+ *,
+ json_body: Mapping[str, Any] | None = None,
+ raw_body: bytes | None = None,
+ content_type: str | None = None,
+ ) -> Any:
+ url = path if path.startswith("http") else f"{self.api_url}/{path.lstrip('/')}"
+ headers = {
+ "Accept": "application/vnd.github+json",
+ "Authorization": f"Bearer {self.token}",
+ "User-Agent": "trycua-release-finalizer",
+ "X-GitHub-Api-Version": "2022-11-28",
+ }
+ body: bytes | None = raw_body
+ if json_body is not None:
+ body = json.dumps(json_body).encode()
+ headers["Content-Type"] = "application/json"
+ elif content_type:
+ headers["Content-Type"] = content_type
+ request = Request(url, data=body, headers=headers, method=method)
+ for attempt in range(1, self.max_attempts + 1):
+ try:
+ with urlopen(request, timeout=120) as response:
+ if response.status == 204:
+ return None
+ return json.load(response)
+ except HTTPError as error:
+ detail = error.read().decode("utf-8", errors="replace")
+ retryable = error.code in self.RETRYABLE_STATUS_CODES
+ if retryable and attempt < self.max_attempts:
+ delay = self._retry_delay(error, attempt)
+ print(
+ f"GitHub API {method} {path} returned {error.code}; "
+ f"retrying in {delay:g}s ({attempt}/{self.max_attempts})",
+ file=sys.stderr,
+ )
+ time.sleep(delay)
+ continue
+ raise ReleaseError(
+ f"GitHub API {method} {path} failed: {error.code} {detail}"
+ ) from error
+ except (URLError, TimeoutError) as error:
+ if attempt < self.max_attempts:
+ delay = self._retry_delay(None, attempt)
+ print(
+ f"GitHub API {method} {path} failed temporarily; "
+ f"retrying in {delay:g}s ({attempt}/{self.max_attempts}): {error}",
+ file=sys.stderr,
+ )
+ time.sleep(delay)
+ continue
+ raise ReleaseError(
+ f"GitHub API {method} {path} failed after {self.max_attempts} attempts: {error}"
+ ) from error
+ raise AssertionError("GitHub API retry loop exited unexpectedly")
+
+ def get(self, path: str) -> Any:
+ return self.request("GET", path)
+
+ def delete(self, path: str) -> None:
+ self.request("DELETE", path)
+
+ def patch(self, path: str, body: Mapping[str, Any]) -> Any:
+ return self.request("PATCH", path, json_body=body)
+
+ def upload(self, url: str, path: Path) -> Any:
+ content_type = mimetypes.guess_type(path.name)[0] or "application/octet-stream"
+ return self.request("POST", url, raw_body=path.read_bytes(), content_type=content_type)
+
+
+def releases_by_tag(api: GitHubApi, repository: str, tag: str) -> list[dict[str, Any]]:
+ matches: list[dict[str, Any]] = []
+ for page in range(1, 11):
+ releases = list(api.get(f"repos/{repository}/releases?per_page=100&page={page}"))
+ matches.extend(release for release in releases if release.get("tag_name") == tag)
+ if len(releases) < 100:
+ break
+ return matches
+
+
+def unique_release(api: GitHubApi, repository: str, tag: str) -> dict[str, Any]:
+ matches = releases_by_tag(api, repository, tag)
+ if not matches:
+ raise ReleaseError(f"Release Please draft for {tag} does not exist")
+ if len(matches) != 1:
+ ids = [release.get("id") for release in matches]
+ raise ReleaseError(f"expected one GitHub release for {tag}, found {ids}")
+ return matches[0]
+
+
+def tag_commit_sha(api: GitHubApi, repository: str, tag: str) -> str:
+ reference = api.get(f"repos/{repository}/git/ref/tags/{quote(tag, safe='')}")
+ target = reference["object"]
+ for _ in range(5):
+ if target["type"] == "commit":
+ return str(target["sha"])
+ if target["type"] != "tag":
+ raise ReleaseError(f"tag {tag} points to unsupported object type {target['type']}")
+ annotated = api.get(f"repos/{repository}/git/tags/{target['sha']}")
+ target = annotated["object"]
+ raise ReleaseError(f"tag {tag} has too many annotation layers")
+
+
+def release_assets(api: GitHubApi, repository: str, release_id: int) -> list[dict[str, Any]]:
+ assets: list[dict[str, Any]] = []
+ for page in range(1, 11):
+ result = list(
+ api.get(f"repos/{repository}/releases/{release_id}/assets?per_page=100&page={page}")
+ )
+ assets.extend(result)
+ if len(result) < 100:
+ break
+ return assets
+
+
+def upload_assets(
+ api: GitHubApi,
+ repository: str,
+ release: Mapping[str, Any],
+ asset_dir: Path,
+) -> None:
+ release_id = int(release["id"])
+ upload_url = str(release["upload_url"]).split("{", 1)[0]
+ existing = release_assets(api, repository, release_id)
+ by_name: dict[str, list[dict[str, Any]]] = {}
+ for asset in existing:
+ by_name.setdefault(str(asset["name"]), []).append(asset)
+
+ files = sorted(path for path in asset_dir.iterdir() if path.is_file())
+ if not files:
+ raise ReleaseError(f"asset directory {asset_dir} is empty")
+ for path in files:
+ matches = by_name.get(path.name, [])
+ complete = [
+ asset
+ for asset in matches
+ if asset.get("state") == "uploaded"
+ and int(asset.get("size", -1)) == path.stat().st_size
+ ]
+ if len(complete) == 1 and len(matches) == 1:
+ print(f"asset already uploaded with matching size: {path.name}")
+ continue
+ for asset in matches:
+ api.delete(f"repos/{repository}/releases/assets/{asset['id']}")
+ print(f"removed incomplete or duplicate asset: {path.name} ({asset['id']})")
+ query = urlencode({"name": path.name})
+ api.upload(f"{upload_url}?{query}", path)
+ print(f"uploaded {path.name}")
+
+
+def verify_published_assets(
+ api: GitHubApi,
+ repository: str,
+ release: Mapping[str, Any],
+ asset_dir: Path,
+) -> None:
+ existing = release_assets(api, repository, int(release["id"]))
+ by_name: dict[str, list[dict[str, Any]]] = {}
+ for asset in existing:
+ by_name.setdefault(str(asset["name"]), []).append(asset)
+ files = sorted(path for path in asset_dir.iterdir() if path.is_file())
+ if not files:
+ raise ReleaseError(f"asset directory {asset_dir} is empty")
+ for path in files:
+ matches = by_name.get(path.name, [])
+ if len(matches) != 1:
+ raise ReleaseError(
+ f"published release asset {path.name} has {len(matches)} matching uploads"
+ )
+ asset = matches[0]
+ if asset.get("state") != "uploaded" or int(asset.get("size", -1)) != path.stat().st_size:
+ raise ReleaseError(f"published release asset {path.name} does not match the local file")
+
+
+def finalize_release(
+ *,
+ api: GitHubApi,
+ repository: str,
+ tag: str,
+ expected_sha: str,
+ body: str,
+ asset_dir: Path,
+ prerelease: bool,
+ make_latest: bool,
+) -> dict[str, Any]:
+ actual_sha = tag_commit_sha(api, repository, tag)
+ if actual_sha != expected_sha:
+ raise ReleaseError(f"tag {tag} points to {actual_sha}, expected {expected_sha}")
+ release = unique_release(api, repository, tag)
+ if not release.get("draft"):
+ same_state = (
+ str(release.get("body") or "") == body and bool(release.get("prerelease")) == prerelease
+ )
+ if not same_state:
+ raise ReleaseError(
+ f"release {tag} is already published with different body or prerelease state"
+ )
+ verify_published_assets(api, repository, release, asset_dir)
+ if make_latest:
+ latest = api.get(f"repos/{repository}/releases/latest")
+ if int(latest.get("id", -1)) != int(release["id"]):
+ raise ReleaseError(f"published release {tag} is not the latest release")
+ print(f"release {tag} was already published and matches the requested state")
+ return dict(release)
+
+ upload_assets(api, repository, release, asset_dir)
+ if release.get("draft"):
+ release = api.patch(
+ f"repos/{repository}/releases/{release['id']}",
+ {
+ "body": body,
+ "draft": False,
+ "prerelease": prerelease,
+ "make_latest": "true" if make_latest else "false",
+ },
+ )
+ print(f"published {tag}: {release.get('html_url')}")
+ return dict(release)
+
+
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--repository", required=True)
+ parser.add_argument("--tag", required=True)
+ parser.add_argument("--sha", required=True)
+ parser.add_argument("--body", type=Path, required=True)
+ parser.add_argument("--asset-dir", type=Path, required=True)
+ parser.add_argument("--prerelease", action="store_true")
+ parser.add_argument("--make-latest", action="store_true")
+ return parser
+
+
+def main(argv: Sequence[str] | None = None) -> int:
+ args = build_parser().parse_args(argv)
+ try:
+ api = GitHubApi(
+ os.environ.get("GH_TOKEN", ""),
+ os.environ.get("GITHUB_API_URL", "https://api.github.com"),
+ )
+ finalize_release(
+ api=api,
+ repository=args.repository,
+ tag=args.tag,
+ expected_sha=args.sha,
+ body=args.body.read_text(),
+ asset_dir=args.asset_dir,
+ prerelease=args.prerelease,
+ make_latest=args.make_latest,
+ )
+ except (OSError, ReleaseError, ValueError) as error:
+ print(f"release finalization error: {error}", file=sys.stderr)
+ return 1
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/.github/scripts/release_attribution.py b/.github/scripts/release_attribution.py
new file mode 100644
index 0000000000..b954984ef5
--- /dev/null
+++ b/.github/scripts/release_attribution.py
@@ -0,0 +1,794 @@
+#!/usr/bin/env python3
+"""Build and render deterministic, pull-request-first release attribution.
+
+The collector reads the exact local tag range and uses the GitHub API only to
+resolve commits to pull requests, contributors, and explicitly closed issues.
+It never infers GitHub handles from a git author display name.
+"""
+
+from __future__ import annotations
+
+import argparse
+from collections import defaultdict
+from dataclasses import dataclass
+from hashlib import sha256
+import html
+import json
+import os
+from pathlib import Path
+import re
+import subprocess
+import sys
+import textwrap
+from typing import Any, Iterable, Mapping, Sequence
+from urllib.error import HTTPError
+from urllib.parse import quote
+from urllib.request import Request, urlopen
+
+
+CONVENTIONAL_RE = re.compile(
+ r"^(?P<type>[a-z][a-z0-9-]*)(?:\((?P<scope>[^)]+)\))?(?P<breaking>!)?:\s+(?P<summary>\S.*)$"
+)
+COAUTHOR_RE = re.compile(
+ r"^Co-authored-by:\s*(?P<name>.*?)\s*<(?P<email>[^>]+)>\s*$",
+ re.IGNORECASE | re.MULTILINE,
+)
+OVERRIDE_RE = re.compile(
+ r"BEGIN_COMMIT_OVERRIDE\s*(?P<body>.*?)\s*END_COMMIT_OVERRIDE",
+ re.IGNORECASE | re.DOTALL,
+)
+ISSUE_RE = re.compile(
+ r"\b(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s*:?[ \t]*(?:(?:https://github\.com/(?P<repository>[^/]+/[^/]+)/issues/)|#)(?P<number>\d+)",
+ re.IGNORECASE,
+)
+SOURCE_PR_RE = re.compile(
+ r"\b(?:adapted from|based on|salvaged from|source[- ]?pr)\s*:?[ \t]*(?:(?:https://github\.com/(?P<repository>[^/]+/[^/]+)/pull/)|#)(?P<number>\d+)",
+ re.IGNORECASE,
+)
+NOREPLY_RE = re.compile(
+ r"^(?:\d+\+)?(?P<login>[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})(?:\[bot\])?)@users\.noreply\.github\.com$",
+ re.IGNORECASE,
+)
+RELEASING_TYPES = {"feat", "fix", "perf", "revert"}
+ALLOWED_TITLE_TYPES = RELEASING_TYPES | {
+ "build",
+ "chore",
+ "ci",
+ "docs",
+ "refactor",
+ "style",
+ "test",
+}
+TYPE_HEADINGS = {
+ "feat": "Features",
+ "fix": "Fixes",
+ "perf": "Performance",
+ "revert": "Reverts",
+}
+ROLE_ORDER = {"author": 0, "coauthor": 1, "reporter": 2}
+ASSOCIATION_INTERNAL = {"OWNER", "MEMBER", "COLLABORATOR"}
+
+
+class ReleaseError(RuntimeError):
+ """A release invariant failed."""
+
+
+@dataclass(frozen=True)
+class CommitRecord:
+ sha: str
+ subject: str
+ body: str
+
+
+@dataclass(frozen=True)
+class ConventionalEntry:
+ change_type: str
+ scope: str | None
+ summary: str
+ breaking: bool
+
+
+class GitHubClient:
+ """Small GitHub REST client with explicit, testable endpoints."""
+
+ def __init__(self, token: str, api_url: str = "https://api.github.com") -> None:
+ if not token:
+ raise ReleaseError("GH_TOKEN is required to resolve release attribution")
+ self.token = token
+ self.api_url = api_url.rstrip("/")
+
+ def get(self, path: str) -> Any:
+ url = path if path.startswith("http") else f"{self.api_url}/{path.lstrip('/')}"
+ request = Request(
+ url,
+ headers={
+ "Accept": "application/vnd.github+json",
+ "Authorization": f"Bearer {self.token}",
+ "User-Agent": "trycua-release-attribution",
+ "X-GitHub-Api-Version": "2022-11-28",
+ },
+ )
+ try:
+ with urlopen(request, timeout=30) as response:
+ return json.load(response)
+ except HTTPError as error:
+ detail = error.read().decode("utf-8", errors="replace")
+ raise ReleaseError(f"GitHub API GET {path} failed: {error.code} {detail}") from error
+
+ def pulls_for_commit(self, repository: str, commit_sha: str) -> list[dict[str, Any]]:
+ return list(self.get(f"repos/{repository}/commits/{commit_sha}/pulls?per_page=100"))
+
+ def pull(self, repository: str, number: int) -> dict[str, Any]:
+ return dict(self.get(f"repos/{repository}/pulls/{number}"))
+
+ def issue(self, repository: str, number: int) -> dict[str, Any]:
+ return dict(self.get(f"repos/{repository}/issues/{number}"))
+
+
+def run_git(repo_root: Path, *args: str) -> str:
+ process = subprocess.run(
+ ["git", *args],
+ cwd=repo_root,
+ check=False,
+ text=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ )
+ if process.returncode != 0:
+ raise ReleaseError(
+ f"git {' '.join(args)} failed ({process.returncode}): {process.stderr.strip()}"
+ )
+ return process.stdout
+
+
+def resolve_tag_sha(repo_root: Path, tag: str) -> str:
+ return run_git(repo_root, "rev-list", "-n", "1", tag).strip()
+
+
+def find_previous_tag(repo_root: Path, current_tag: str, tag_prefix: str) -> str | None:
+ tags = run_git(repo_root, "tag", "--list", f"{tag_prefix}*", "--sort=-v:refname").splitlines()
+ return next((tag for tag in tags if tag and tag != current_tag), None)
+
+
+def commits_in_range(
+ repo_root: Path,
+ previous_tag: str | None,
+ current_tag: str,
+ paths: Sequence[str],
+ exclude_paths: Sequence[str] = (),
+) -> list[CommitRecord]:
+ range_spec = f"{previous_tag}..{current_tag}" if previous_tag else current_tag
+ pathspecs = [*paths, *(f":(exclude){path}" for path in exclude_paths)]
+ shas = run_git(repo_root, "log", "--reverse", "--format=%H", range_spec, "--", *pathspecs)
+ records: list[CommitRecord] = []
+ for commit_sha in shas.splitlines():
+ if not commit_sha:
+ continue
+ raw = run_git(repo_root, "show", "-s", "--format=%s%x00%B", commit_sha)
+ subject, _, body = raw.partition("\x00")
+ records.append(CommitRecord(commit_sha, subject.strip(), body.strip()))
+ return records
+
+
+def parse_conventional_line(line: str) -> ConventionalEntry | None:
+ match = CONVENTIONAL_RE.match(line.strip())
+ if not match:
+ return None
+ return ConventionalEntry(
+ change_type=match.group("type"),
+ scope=match.group("scope"),
+ summary=match.group("summary").strip().rstrip("."),
+ breaking=bool(match.group("breaking")),
+ )
+
+
+def release_entries(subject: str, commit_body: str, pull_body: str) -> list[ConventionalEntry]:
+ override = OVERRIDE_RE.search(pull_body or "")
+ candidates = override.group("body").splitlines() if override else [subject]
+ entries = [entry for line in candidates if (entry := parse_conventional_line(line))]
+ if "BREAKING CHANGE:" in commit_body or "BREAKING-CHANGE:" in commit_body:
+ entries = [
+ ConventionalEntry(entry.change_type, entry.scope, entry.summary, True)
+ for entry in entries
+ ]
+ return [entry for entry in entries if entry.change_type in RELEASING_TYPES]
+
+
+def validate_pr_title(title: str) -> None:
+ entry = parse_conventional_line(title)
+ if not entry:
+ raise ReleaseError(
+ "pull request title must use Conventional Commit syntax, for example "
+ "'fix(driver): preserve input while reconnecting'"
+ )
+ if entry.change_type not in ALLOWED_TITLE_TYPES:
+ allowed = ", ".join(sorted(ALLOWED_TITLE_TYPES))
+ raise ReleaseError(
+ f"unsupported pull request type '{entry.change_type}'; use one of: {allowed}"
+ )
+
+
+def login_from_email(email: str, overrides: Mapping[str, str]) -> str | None:
+ normalized = email.strip().lower()
+ if normalized in overrides:
+ return overrides[normalized]
+ match = NOREPLY_RE.match(normalized)
+ return match.group("login") if match else None
+
+
+def is_bot(login: str, configured_bots: set[str]) -> bool:
+ lowered = login.lower()
+ return lowered.endswith("[bot]") or lowered in configured_bots
+
+
+def is_external(association: str | None, login: str, internal_handles: set[str]) -> bool:
+ if login.lower() in internal_handles:
+ return False
+ return (association or "").upper() not in ASSOCIATION_INTERNAL
+
+
+def _local_reference_numbers(
+ pattern: re.Pattern[str], text: str, repository: str | None
+) -> list[int]:
+ numbers = {
+ int(match.group("number"))
+ for match in pattern.finditer(text or "")
+ if not match.group("repository")
+ or not repository
+ or match.group("repository").lower() == repository.lower()
+ }
+ return sorted(numbers)
+
+
+def linked_issue_numbers(pull_body: str, repository: str | None = None) -> list[int]:
+ return _local_reference_numbers(ISSUE_RE, pull_body, repository)
+
+
+def source_pull_numbers(text: str, repository: str | None = None) -> list[int]:
+ return _local_reference_numbers(SOURCE_PR_RE, text, repository)
+
+
+def select_pull(pulls: Sequence[Mapping[str, Any]], commit_sha: str) -> Mapping[str, Any]:
+ if not pulls:
+ raise ReleaseError(f"commit {commit_sha} is not associated with a pull request")
+ exact = [pull for pull in pulls if pull.get("merge_commit_sha") == commit_sha]
+ candidates = exact or [pull for pull in pulls if pull.get("merged_at")]
+ if not candidates:
+ candidates = list(pulls)
+ candidates = sorted(candidates, key=lambda pull: int(pull.get("number", 0)))
+ return candidates[-1]
+
+
+def contributor(
+ login: str,
+ role: str,
+ external: bool,
+) -> dict[str, Any]:
+ return {"login": login, "role": role, "external": external}
+
+
+def merge_contributors(items: Iterable[Mapping[str, Any]]) -> list[dict[str, Any]]:
+ by_login: dict[str, dict[str, Any]] = {}
+ for item in items:
+ login = str(item["login"])
+ existing = by_login.setdefault(
+ login,
+ {"login": login, "roles": set(), "external": bool(item.get("external", True))},
+ )
+ existing["roles"].add(str(item["role"]))
+ existing["external"] = existing["external"] and bool(item.get("external", True))
+ return [
+ {
+ "login": item["login"],
+ "roles": sorted(item["roles"], key=lambda role: ROLE_ORDER.get(role, 99)),
+ "external": item["external"],
+ }
+ for item in sorted(by_login.values(), key=lambda value: value["login"].lower())
+ ]
+
+
+def asset_checksums(asset_dir: Path | None) -> list[dict[str, Any]]:
+ if not asset_dir:
+ return []
+ assets: list[dict[str, Any]] = []
+ for path in sorted(asset_dir.rglob("*")):
+ if not path.is_file() or path.name in {
+ "release-manifest.json",
+ "release-body.md",
+ "release-social.txt",
+ "release-card.svg",
+ "release-card.png",
+ }:
+ continue
+ digest = sha256(path.read_bytes()).hexdigest()
+ assets.append(
+ {
+ "name": path.relative_to(asset_dir).as_posix(),
+ "bytes": path.stat().st_size,
+ "sha256": digest,
+ }
+ )
+ return assets
+
+
+def _change_contributors(
+ pull: Mapping[str, Any],
+ commit: CommitRecord,
+ github: GitHubClient,
+ repository: str,
+ config: Mapping[str, Any],
+) -> tuple[list[dict[str, Any]], list[int], bool]:
+ bots = {str(item).lower() for item in config.get("bots", [])}
+ overrides = {
+ str(email).lower(): str(login)
+ for email, login in dict(config.get("identityOverrides", {})).items()
+ }
+ coauthor_overrides = {
+ str(identity).lower(): str(login)
+ for identity, login in dict(config.get("coauthorOverrides", {})).items()
+ }
+ ignored_coauthor_emails = {
+ str(item).lower() for item in config.get("ignoredCoauthorEmails", [])
+ }
+ internal = {str(item).lower() for item in config.get("internalHandles", [])}
+ opt_out = {str(item).lower() for item in config.get("optOutHandles", [])}
+ items: list[dict[str, Any]] = []
+
+ author_login = str((pull.get("user") or {}).get("login") or "")
+ if author_login and not is_bot(author_login, bots) and author_login.lower() not in opt_out:
+ items.append(
+ contributor(
+ author_login,
+ "author",
+ is_external(str(pull.get("author_association") or ""), author_login, internal),
+ )
+ )
+
+ for match in COAUTHOR_RE.finditer(commit.body):
+ email = match.group("email").strip().lower()
+ if email in ignored_coauthor_emails:
+ continue
+ identity = f"{match.group('name').strip()} <{email}>".lower()
+ login = coauthor_overrides.get(identity) or login_from_email(email, overrides)
+ if not login:
+ raise ReleaseError(
+ f"commit {commit.sha} has an unresolved human coauthor email; "
+ "add an exceptional identityOverrides entry"
+ )
+ if is_bot(login, bots) or login.lower() in opt_out:
+ continue
+ items.append(contributor(login, "coauthor", login.lower() not in internal))
+
+ source_numbers = source_pull_numbers(f"{commit.body}\n{pull.get('body') or ''}", repository)
+ for number in source_numbers:
+ source = github.pull(repository, number)
+ login = str((source.get("user") or {}).get("login") or "")
+ if not login or is_bot(login, bots) or login.lower() in opt_out:
+ continue
+ items.append(
+ contributor(
+ login,
+ "coauthor",
+ is_external(str(source.get("author_association") or ""), login, internal),
+ )
+ )
+
+ issues = linked_issue_numbers(str(pull.get("body") or ""), repository)
+ for number in issues:
+ issue = github.issue(repository, number)
+ if issue.get("pull_request"):
+ continue
+ login = str((issue.get("user") or {}).get("login") or "")
+ if not login or is_bot(login, bots) or login.lower() in opt_out:
+ continue
+ items.append(
+ contributor(
+ login,
+ "reporter",
+ is_external(str(issue.get("author_association") or ""), login, internal),
+ )
+ )
+
+ labels = {str((label or {}).get("name") or "") for label in pull.get("labels", [])}
+ return _dedupe_change_contributors(items), issues, "release-visual" in labels
+
+
+def _dedupe_change_contributors(items: Iterable[Mapping[str, Any]]) -> list[dict[str, Any]]:
+ unique: dict[tuple[str, str], dict[str, Any]] = {}
+ for item in items:
+ key = (str(item["login"]).lower(), str(item["role"]))
+ unique[key] = dict(item)
+ return sorted(
+ unique.values(),
+ key=lambda item: (ROLE_ORDER.get(str(item["role"]), 99), str(item["login"]).lower()),
+ )
+
+
+def extract_changelog_section(changelog: Path, version: str) -> str:
+ content = changelog.read_text()
+ pattern = re.compile(
+ rf"^##\s+(?:\[{re.escape(version)}\]|{re.escape(version)})(?:\s|\(|$).*?(?=^##\s|\Z)",
+ re.MULTILINE | re.DOTALL,
+ )
+ match = pattern.search(content)
+ if not match:
+ raise ReleaseError(f"{changelog} has no changelog section for {version}")
+ return match.group(0).rstrip() + "\n"
+
+
+def build_manifest(
+ *,
+ repo_root: Path,
+ repository: str,
+ product: str,
+ display_name: str,
+ version: str,
+ tag: str,
+ previous_tag: str | None,
+ expected_sha: str,
+ paths: Sequence[str],
+ changelog_path: Path,
+ attribution_config: Mapping[str, Any],
+ github: GitHubClient,
+ release_ref: str | None = None,
+ exclude_paths: Sequence[str] = (),
+ asset_dir: Path | None = None,
+) -> dict[str, Any]:
+ current_ref = release_ref or tag
+ actual_sha = resolve_tag_sha(repo_root, current_ref)
+ if actual_sha != expected_sha:
+ raise ReleaseError(
+ f"release ref {current_ref} points to {actual_sha}, expected {expected_sha}"
+ )
+
+ changes: list[dict[str, Any]] = []
+ seen_changes: set[tuple[int, str, str]] = set()
+ all_contributors: list[dict[str, Any]] = []
+ visual_requested = False
+
+ for commit in commits_in_range(repo_root, previous_tag, current_ref, paths, exclude_paths):
+ if re.match(r"^chore(?:\([^)]+\))?: release\b", commit.subject, re.IGNORECASE):
+ continue
+ parsed_subject = parse_conventional_line(commit.subject)
+ if parsed_subject and parsed_subject.change_type not in RELEASING_TYPES:
+ continue
+
+ selected = select_pull(github.pulls_for_commit(repository, commit.sha), commit.sha)
+ pull_number = int(selected["number"])
+ pull = github.pull(repository, pull_number)
+ entries = release_entries(commit.subject, commit.body, str(pull.get("body") or ""))
+ if not entries:
+ continue
+ contributors, issues, pull_visual = _change_contributors(
+ pull, commit, github, repository, attribution_config
+ )
+ visual_requested = visual_requested or pull_visual
+ all_contributors.extend(contributors)
+
+ for entry in entries:
+ key = (pull_number, entry.change_type, entry.summary.lower())
+ if key in seen_changes:
+ continue
+ seen_changes.add(key)
+ changes.append(
+ {
+ "type": entry.change_type,
+ "scope": entry.scope,
+ "summary": entry.summary,
+ "breaking": entry.breaking,
+ "pr": pull_number,
+ "issues": issues,
+ "contributors": contributors,
+ }
+ )
+
+ if not changes:
+ raise ReleaseError(f"no releasing pull requests found for {tag}")
+
+ changelog_section = extract_changelog_section(changelog_path, version)
+ missing_prs = sorted(
+ {
+ int(change["pr"])
+ for change in changes
+ if f"#{change['pr']}" not in changelog_section
+ and f"/pull/{change['pr']}" not in changelog_section
+ }
+ )
+ if missing_prs:
+ raise ReleaseError(f"changelog section is missing pull requests: {missing_prs}")
+
+ bump = "patch"
+ if any(change["breaking"] for change in changes):
+ bump = "major"
+ elif any(change["type"] == "feat" for change in changes):
+ bump = "minor"
+
+ owner, repo = repository.split("/", 1)
+ compare_url = (
+ f"https://github.com/{owner}/{repo}/compare/{quote(previous_tag)}...{quote(tag)}"
+ if previous_tag
+ else f"https://github.com/{owner}/{repo}/releases/tag/{quote(tag)}"
+ )
+ return {
+ "schema": (
+ f"https://raw.githubusercontent.com/{repository}/{actual_sha}/"
+ ".github/release-manifest.schema.json"
+ ),
+ "schemaVersion": 1,
+ "repository": repository,
+ "product": product,
+ "displayName": display_name,
+ "version": version,
+ "bump": bump,
+ "tag": tag,
+ "sha": actual_sha,
+ "previousTag": previous_tag,
+ "compareUrl": compare_url,
+ "changelog": {
+ "path": changelog_path.relative_to(repo_root).as_posix(),
+ "sha256": sha256(changelog_section.encode()).hexdigest(),
+ },
+ "visualRequested": visual_requested or bump == "major",
+ "changes": changes,
+ "contributors": merge_contributors(all_contributors),
+ "assets": asset_checksums(asset_dir),
+ }
+
+
+def _thanks(change: Mapping[str, Any]) -> str:
+ external = [
+ item
+ for item in change.get("contributors", [])
+ if item.get("external") and item.get("role") in {"author", "coauthor"}
+ ]
+ reporters = [
+ item
+ for item in change.get("contributors", [])
+ if item.get("external") and item.get("role") == "reporter"
+ ]
+ parts: list[str] = []
+ if external:
+ parts.append("Thanks " + ", ".join(f"@{item['login']}" for item in external))
+ if reporters:
+ parts.append("reported by " + ", ".join(f"@{item['login']}" for item in reporters))
+ return "; ".join(parts)
+
+
+def render_body(manifest: Mapping[str, Any], footer: str = "") -> str:
+ display_name = str(manifest["displayName"])
+ version = str(manifest["version"])
+ changes = list(manifest["changes"])
+ repository_url = f"https://github.com/{manifest['repository']}"
+ feature_count = sum(change["type"] == "feat" for change in changes)
+ fix_count = sum(change["type"] == "fix" for change in changes)
+ if feature_count and fix_count:
+ summary = f"This release adds {feature_count} features and includes {fix_count} fixes."
+ elif feature_count:
+ noun = "feature" if feature_count == 1 else "features"
+ summary = f"This release adds {feature_count} {noun}."
+ elif fix_count:
+ noun = "fix" if fix_count == 1 else "fixes"
+ summary = f"This release includes {fix_count} {noun}."
+ else:
+ noun = "change" if len(changes) == 1 else "changes"
+ summary = f"This release includes {len(changes)} user-facing {noun}."
+
+ lines = [f"# {display_name} {version}", "", "## Summary", "", summary]
+ if manifest.get("visualRequested"):
+ card_url = (
+ f"https://github.com/{manifest['repository']}/releases/download/"
+ f"{quote(str(manifest['tag']), safe='')}/release-card.png"
+ )
+ lines.extend(
+ [
+ "",
+ f"![{display_name} {version} release highlights]({card_url})",
+ ]
+ )
+ grouped: dict[str, list[Mapping[str, Any]]] = defaultdict(list)
+ for change in changes:
+ grouped[str(change["type"])].append(change)
+ for change_type in ("feat", "fix", "perf", "revert"):
+ if not grouped[change_type]:
+ continue
+ lines.extend(["", f"## {TYPE_HEADINGS[change_type]}", ""])
+ for change in grouped[change_type]:
+ suffix = _thanks(change)
+ bullet = (
+ f"- {change['summary']}. ([#{change['pr']}]({repository_url}/pull/{change['pr']}))"
+ )
+ if suffix:
+ bullet += f" {suffix}."
+ lines.append(bullet)
+
+ external = [item for item in manifest["contributors"] if item.get("external")]
+ lines.extend(["", "## Contributors", ""])
+ if external:
+ lines.append(
+ "Thanks to "
+ + ", ".join(f"@{item['login']}" for item in external)
+ + " for contributing to this release."
+ )
+ else:
+ lines.append("This release contains maintainer changes only.")
+
+ if footer.strip():
+ lines.extend(["", footer.strip()])
+
+ assets = list(manifest.get("assets", []))
+ if assets:
+ lines.extend(["", "## SHA256 Checksums", "", "```text"])
+ lines.extend(f"{asset['sha256']} {asset['name']}" for asset in assets)
+ lines.append("```")
+
+ lines.extend(
+ [
+ "",
+ "## Full changelog",
+ "",
+ f"[{manifest.get('previousTag') or 'Initial release'}...{manifest['tag']}]({manifest['compareUrl']})",
+ "",
+ ]
+ )
+ return "\n".join(lines)
+
+
+def render_social(manifest: Mapping[str, Any]) -> str:
+ first = str(manifest["changes"][0]["summary"]).rstrip(".")
+ external = [item for item in manifest["contributors"] if item.get("external")]
+ thanks = ""
+ if external:
+ noun = "contributor" if len(external) == 1 else "contributors"
+ thanks = f"\n\nThanks to {len(external)} community {noun}."
+ url = f"https://github.com/{manifest['repository']}/releases/tag/{manifest['tag']}"
+ prefix = f"{manifest['displayName']} {manifest['version']} is out.\n\n"
+ suffix = f"{thanks}\n\nRelease notes: {url}"
+ available = max(40, 280 - len(prefix) - len(suffix))
+ if len(first) > available:
+ first = first[: available - 1].rstrip() + "…"
+ return f"{prefix}{first}.{suffix}\n"
+
+
+def render_card_svg(manifest: Mapping[str, Any]) -> str:
+ changes = list(manifest["changes"])[:5]
+ lines: list[str] = []
+ y = 640
+ for change in changes:
+ wrapped = textwrap.wrap(str(change["summary"]), width=44)[:2]
+ lines.append(f'<circle cx="170" cy="{y - 13}" r="9" fill="#8BE9FD"/>')
+ for index, text in enumerate(wrapped):
+ lines.append(
+ f'<text x="205" y="{y + index * 48}" class="change">{html.escape(text)}</text>'
+ )
+ y += 65 + 44 * max(0, len(wrapped) - 1)
+ contributors = sum(item.get("external", False) for item in manifest["contributors"])
+ return f"""<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1600" viewBox="0 0 1600 1600">
+<defs><linearGradient id="bg" x1="0" y1="0" x2="1" y2="1"><stop stop-color="#08111f"/><stop offset="1" stop-color="#123a55"/></linearGradient></defs>
+<rect width="1600" height="1600" fill="url(#bg)"/><rect x="80" y="80" width="1440" height="1440" rx="52" fill="none" stroke="#8BE9FD" stroke-width="4" opacity="0.65"/>
+<style>.eyebrow{{font:600 34px system-ui;letter-spacing:8px;fill:#8BE9FD}}.title{{font:700 118px system-ui;fill:#fff}}.version{{font:500 64px ui-monospace,monospace;fill:#BD93F9}}.change{{font:500 42px system-ui;fill:#F8F8F2}}.meta{{font:500 32px ui-monospace,monospace;fill:#A8B2C1}}</style>
+<text x="150" y="220" class="eyebrow">CUA RELEASE</text><text x="150" y="395" class="title">{html.escape(str(manifest["displayName"]))}</text><text x="150" y="495" class="version">v{html.escape(str(manifest["version"]))}</text>
+{"".join(lines)}
+<text x="150" y="1430" class="meta">{len(manifest["changes"])} changes · {contributors} external contributors · {html.escape(str(manifest["repository"]))}</text></svg>\n"""
+
+
+def render_card_alt_text(manifest: Mapping[str, Any]) -> str:
+ highlights = "; ".join(str(change["summary"]).rstrip(".") for change in manifest["changes"][:5])
+ contributors = sum(item.get("external", False) for item in manifest["contributors"])
+ noun = "contributor" if contributors == 1 else "contributors"
+ return (
+ f"{manifest['displayName']} {manifest['version']} release highlights: "
+ f"{highlights}. {len(manifest['changes'])} changes and {contributors} "
+ f"external {noun}.\n"
+ )
+
+
+def write_json(path: Path, value: Mapping[str, Any]) -> None:
+ path.parent.mkdir(parents=True, exist_ok=True)
+ path.write_text(json.dumps(value, indent=2, sort_keys=True) + "\n")
+
+
+def collect_command(args: argparse.Namespace) -> None:
+ repo_root = args.repo_root.resolve()
+ config = json.loads(args.config.read_text())
+ previous_tag = args.previous_tag or find_previous_tag(repo_root, args.tag, args.tag_prefix)
+ client = GitHubClient(
+ os.environ.get("GH_TOKEN", ""), os.environ.get("GITHUB_API_URL", "https://api.github.com")
+ )
+ manifest = build_manifest(
+ repo_root=repo_root,
+ repository=args.repository,
+ product=args.product,
+ display_name=args.display_name,
+ version=args.version,
+ tag=args.tag,
+ previous_tag=previous_tag,
+ expected_sha=args.sha,
+ paths=args.path,
+ changelog_path=(repo_root / args.changelog).resolve(),
+ attribution_config=config,
+ github=client,
+ release_ref=args.ref,
+ exclude_paths=args.exclude_path,
+ asset_dir=args.asset_dir.resolve() if args.asset_dir else None,
+ )
+ write_json(args.output, manifest)
+ print(f"wrote {args.output} with {len(manifest['changes'])} changes")
+
+
+def render_command(args: argparse.Namespace) -> None:
+ manifest = json.loads(args.manifest.read_text())
+ if manifest.get("schemaVersion") != 1:
+ raise ReleaseError(f"unsupported release manifest schema {manifest.get('schemaVersion')}")
+ footer = args.footer.read_text() if args.footer else ""
+ body = render_body(manifest, footer)
+ if len(body.encode()) > 125_000:
+ raise ReleaseError("rendered GitHub release body exceeds 125,000 bytes")
+ for output in (args.body, args.social, args.card, args.alt):
+ if output:
+ output.parent.mkdir(parents=True, exist_ok=True)
+ args.body.write_text(body)
+ args.social.write_text(render_social(manifest))
+ if args.card and manifest.get("visualRequested"):
+ args.card.write_text(render_card_svg(manifest))
+ if args.alt:
+ args.alt.write_text(render_card_alt_text(manifest))
+
+
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(description=__doc__)
+ subparsers = parser.add_subparsers(dest="command", required=True)
+
+ validate = subparsers.add_parser("validate-title")
+ validate.add_argument("--title", required=True)
+
+ collect = subparsers.add_parser("collect")
+ collect.add_argument("--repo-root", type=Path, default=Path.cwd())
+ collect.add_argument("--repository", required=True)
+ collect.add_argument("--product", required=True)
+ collect.add_argument("--display-name", required=True)
+ collect.add_argument("--version", required=True)
+ collect.add_argument("--tag", required=True)
+ collect.add_argument("--ref", help="git ref to inspect before the release tag exists")
+ collect.add_argument("--tag-prefix", required=True)
+ collect.add_argument("--previous-tag")
+ collect.add_argument("--sha", required=True)
+ collect.add_argument("--path", action="append", required=True)
+ collect.add_argument("--exclude-path", action="append", default=[])
+ collect.add_argument("--changelog", type=Path, required=True)
+ collect.add_argument(
+ "--config", type=Path, default=Path(".github/release-attribution-config.json")
+ )
+ collect.add_argument("--asset-dir", type=Path)
+ collect.add_argument("--output", type=Path, required=True)
+
+ render = subparsers.add_parser("render")
+ render.add_argument("--manifest", type=Path, required=True)
+ render.add_argument("--body", type=Path, required=True)
+ render.add_argument("--social", type=Path, required=True)
+ render.add_argument("--card", type=Path)
+ render.add_argument("--alt", type=Path)
+ render.add_argument("--footer", type=Path)
+ return parser
+
+
+def main(argv: Sequence[str] | None = None) -> int:
+ parser = build_parser()
+ args = parser.parse_args(argv)
+ try:
+ if args.command == "validate-title":
+ validate_pr_title(args.title)
+ print("release title is valid")
+ elif args.command == "collect":
+ collect_command(args)
+ elif args.command == "render":
+ render_command(args)
+ else:
+ parser.error(f"unknown command {args.command}")
+ except (ReleaseError, OSError, ValueError) as error:
+ print(f"release attribution error: {error}", file=sys.stderr)
+ return 1
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/.github/scripts/tests/test_cua_driver_release_wiring.py b/.github/scripts/tests/test_cua_driver_release_wiring.py
index 68f33ac69e..06a94291cb 100644
--- a/.github/scripts/tests/test_cua_driver_release_wiring.py
+++ b/.github/scripts/tests/test_cua_driver_release_wiring.py
@@ -18,7 +18,7 @@ class TestCuaDriverReleaseWiring(unittest.TestCase):
self.assertIn('workflows: ["CD: Cua Driver (cross-platform)"]', workflow)
self.assertNotIn("branches:\n - main", workflow)
- self.assertIn('github.event.workflow_run.conclusion != \'cancelled\'', workflow)
+ self.assertIn("github.event.workflow_run.conclusion != 'cancelled'", workflow)
self.assertIn('gh release view "$TAG" --repo "$GITHUB_REPOSITORY"', workflow)
def test_python_publish_defaults_to_current_rust_version(self) -> None:
@@ -34,42 +34,46 @@ class TestCuaDriverReleaseWiring(unittest.TestCase):
self.assertIn("os: ubuntu-24.04-arm", workflow)
self.assertIn("arch: arm64", workflow)
- def test_release_on_merge_tracks_rust_driver(self) -> None:
- workflow = self.read(".github/workflows/release-on-merge.yml")
+ def test_release_please_owns_driver_and_lume(self) -> None:
+ config = self.read("release-please-config.json")
+ workflow = self.read(".github/workflows/release-please.yml")
- self.assertIn('["libs/cua-driver/rust/"]="cua-driver-rs"', workflow)
-
- def test_release_bump_version_only_exposes_rust_driver(self) -> None:
- workflow = self.read(".github/workflows/release-bump-version.yml")
-
- self.assertIn(" - cua-driver-rs\n", workflow)
- self.assertIn(' "cua-driver-rs")\n', workflow)
+ self.assertIn('"libs/cua-driver"', config)
+ self.assertIn('"libs/lume"', config)
+ self.assertIn('"component": "cua-driver-rs"', config)
+ self.assertIn('"component": "lume"', config)
+ self.assertIn("5c625bfb5d1ff62eadeeb3772007f7f66fdcf071", workflow)
+ self.assertIn('-p cua-driver --precise "$DRIVER_VERSION"', workflow)
self.assertIn(
- 'echo "directory=libs/cua-driver/rust" >> $GITHUB_OUTPUT', workflow
+ "gh pr list --state open --base main --limit 100 --json number",
+ workflow,
)
- self.assertNotIn(" - cua-driver\n", workflow)
- self.assertNotIn(' "cua-driver")\n', workflow)
- self.assertNotIn("inputs.service == 'cua-driver'", workflow)
-
- def test_release_reminder_tracks_rust_driver(self) -> None:
- workflow = self.read(".github/workflows/ci-release-reminder.yml")
+ self.assertNotIn("if: steps.release.outputs.prs_created == 'true'", workflow)
+ self.assertNotIn("RELEASE_PRS: ${{ steps.release.outputs.prs }}", workflow)
- self.assertIn('["libs/cua-driver/rust/"]="cua-driver-rs"', workflow)
- self.assertIn("cua-driver desktop release validation", workflow)
- self.assertIn("e2e-rust-windows.yml", workflow)
- self.assertIn(
- "libs/cua-driver/tests/runners/macos-lume/run-all.sh", workflow
- )
- self.assertIn("e2e-rust-linux.yml", workflow)
- self.assertIn("e2e-rust-linux-wayland.yml", workflow)
+ def test_required_release_metadata_check_runs_for_every_pull_request(self) -> None:
+ workflow = self.read(".github/workflows/ci-release-metadata.yml")
- def test_unreleased_digest_tracks_rust_driver(self) -> None:
- workflow = self.read(".github/workflows/release-unreleased-digest.yml")
+ trigger = workflow.split("permissions:", 1)[0]
+ self.assertNotIn(" paths:", trigger)
+ self.assertIn("Determine product release scope", workflow)
+ self.assertIn("if: steps.scope.outputs.product_changed == 'true'", workflow)
- self.assertIn(
- 'SERVICE_TAG_DIR["cua-driver-rs"]="cua-driver-rs-v|libs/cua-driver/rust/"',
- workflow,
- )
+ def test_legacy_release_routes_exclude_driver_and_lume(self) -> None:
+ workflow = self.read(".github/workflows/release-bump-version.yml")
+ self.assertNotIn(" - cua-driver-rs\n", workflow)
+ self.assertNotIn(" - lume\n", workflow)
+ self.assertNotIn("gh api -X DELETE", workflow)
+ self.assertIn("release tags are immutable", workflow)
+
+ for path in (
+ ".github/workflows/release-on-merge.yml",
+ ".github/workflows/ci-release-reminder.yml",
+ ".github/workflows/release-unreleased-digest.yml",
+ ):
+ legacy = self.read(path)
+ self.assertNotIn('="cua-driver-rs"', legacy, path)
+ self.assertNotIn('SERVICE_TAG_DIR["lume"]', legacy, path)
def test_distro_compat_downloads_release_asset_once_per_run(self) -> None:
workflow = self.read(".github/workflows/ci-distro-compat-cua-driver.yml")
@@ -81,11 +85,14 @@ class TestCuaDriverReleaseWiring(unittest.TestCase):
self.assertIn('CUA_DRIVER_RS_TELEMETRY_ENABLED: "false"', workflow)
self.assertIn('CUA_TELEMETRY_ENABLED: "false"', workflow)
- def test_rust_driver_bump_keeps_python_wrapper_version_synced(self) -> None:
- config = self.read("libs/cua-driver/rust/.bumpversion.cfg")
+ def test_release_please_keeps_driver_version_sources_synced(self) -> None:
+ config = self.read("release-please-config.json")
- self.assertIn("[bumpversion:file:../python/pyproject.toml]", config)
- self.assertIn("[bumpversion:file:../python/src/cua_driver/__init__.py]", config)
+ self.assertIn('"path": "rust/Cargo.toml"', config)
+ self.assertIn('"path": "python/pyproject.toml"', config)
+ self.assertIn('"path": "python/src/cua_driver/__init__.py"', config)
+ self.assertIn('"path": "scripts/_install-rust.sh"', config)
+ self.assertIn('"path": "scripts/install.ps1"', config)
def test_installers_preserve_legacy_telemetry_state_before_cleanup(self) -> None:
for relative_path in (
@@ -106,11 +113,11 @@ class TestCuaDriverReleaseWiring(unittest.TestCase):
)
powershell = self.read("libs/cua-driver/scripts/install.ps1")
- cleanup = powershell.index(
- "Remove-Item -LiteralPath $LegacyHomeDir -Recurse -Force"
- )
+ cleanup = powershell.index("Remove-Item -LiteralPath $LegacyHomeDir -Recurse -Force")
self.assertLess(
- powershell.index("foreach ($telemetryFile in @('.telemetry_id', '.installation_recorded'))"),
+ powershell.index(
+ "foreach ($telemetryFile in @('.telemetry_id', '.installation_recorded'))"
+ ),
cleanup,
)
self.assertLess(
@@ -130,7 +137,7 @@ class TestCuaDriverReleaseWiring(unittest.TestCase):
'codesign_bounded 20 --force --deep --sign "$SIGN_ID" "$APP_STAGE"',
installer,
)
- self.assertNotIn('printf \'%s\' "$CUA_LOCAL_SIGN_CN"; return', installer)
+ self.assertNotIn("printf '%s' \"$CUA_LOCAL_SIGN_CN\"; return", installer)
def test_release_installers_persist_channel_before_binary_swap(self) -> None:
shell = self.read("libs/cua-driver/scripts/_install-rust.sh")
@@ -162,44 +169,41 @@ class TestCuaDriverReleaseWiring(unittest.TestCase):
def test_release_and_skill_installers_do_not_depend_on_github_latest(self) -> None:
workflow = self.read(".github/workflows/cd-rust-cua-driver.yml")
- self.assertIn("prerelease: true", workflow)
- self.assertIn("make_latest: false", workflow)
+ self.assertIn("--prerelease", workflow)
+ self.assertNotIn("softprops/action-gh-release", workflow)
+ self.assertNotIn("bake version into install scripts", workflow.lower())
- windows_skill = self.read(
- "libs/cua-driver/rust/Skills/cua-driver/WINDOWS.md"
- )
+ windows_skill = self.read("libs/cua-driver/rust/Skills/cua-driver/WINDOWS.md")
self.assertIn("https://cua.ai/driver/install.ps1", windows_skill)
self.assertNotIn("/releases/latest/download/install.ps1", windows_skill)
+ def test_lume_uses_the_same_draft_finalizer(self) -> None:
+ workflow = self.read(".github/workflows/cd-swift-lume.yml")
+
+ self.assertIn("--make-latest", workflow)
+ self.assertIn("github_release.py", workflow)
+ self.assertNotIn("softprops/action-gh-release", workflow)
+ self.assertNotIn("bake-lume-version", workflow)
+
def test_lifecycle_telemetry_runs_outside_foreground_command(self) -> None:
main = self.read("libs/cua-driver/rust/crates/cua-driver/src/main.rs")
- telemetry = self.read(
- "libs/cua-driver/rust/crates/cua-driver/src/telemetry.rs"
- )
+ telemetry = self.read("libs/cua-driver/rust/crates/cua-driver/src/telemetry.rs")
self.assertNotIn("telemetry::ensure_first_run_registration();", main)
- self.assertGreaterEqual(
- main.count("telemetry::run_lifecycle_worker_if_requested()"), 2
- )
- self.assertGreaterEqual(
- main.count("telemetry::spawn_first_run_registration_worker()"), 3
- )
+ self.assertGreaterEqual(main.count("telemetry::run_lifecycle_worker_if_requested()"), 2)
+ self.assertGreaterEqual(main.count("telemetry::spawn_first_run_registration_worker()"), 3)
self.assertIn("CUA_DRIVER_LIFECYCLE_TELEMETRY_WORKER", telemetry)
self.assertIn(".stdin(Stdio::null())", telemetry)
self.assertIn(".stdout(Stdio::null())", telemetry)
self.assertIn(".stderr(Stdio::null())", telemetry)
def test_released_linux_smoke_waits_for_assets_and_installs_xkbcommon(self) -> None:
- workflow = self.read(
- ".github/workflows/ci-distro-compat-cua-driver.yml"
- )
+ workflow = self.read(".github/workflows/ci-distro-compat-cua-driver.yml")
self.assertIn("for attempt in $(seq 1 90)", workflow)
- self.assertIn(
- "release asset was still unavailable after 15 minutes", workflow
- )
+ self.assertIn("release asset was still unavailable after 15 minutes", workflow)
self.assertEqual(workflow.count("libxkbcommon0"), 4)
- self.assertEqual(workflow.count("libxkbcommon\""), 2)
+ self.assertEqual(workflow.count('libxkbcommon"'), 2)
if __name__ == "__main__":
diff --git a/.github/scripts/tests/test_github_release.py b/.github/scripts/tests/test_github_release.py
new file mode 100644
index 0000000000..6ea81bfffa
--- /dev/null
+++ b/.github/scripts/tests/test_github_release.py
@@ -0,0 +1,173 @@
+from __future__ import annotations
+
+from io import BytesIO
+import json
+from pathlib import Path
+from urllib.error import HTTPError
+
+import pytest
+
+import github_release
+from github_release import (
+ GitHubApi,
+ ReleaseError,
+ finalize_release,
+ tag_commit_sha,
+ unique_release,
+)
+
+
+class FakeApi:
+ def __init__(self, expected_sha: str) -> None:
+ self.expected_sha = expected_sha
+ self.deleted: list[str] = []
+ self.uploaded: list[tuple[str, str]] = []
+ self.patches: list[tuple[str, dict]] = []
+ self.assets = [{"id": 21, "name": "old.zip", "state": "starter", "size": 0}]
+ self.release = {
+ "id": 7,
+ "tag_name": "lume-v0.4.0",
+ "draft": True,
+ "prerelease": False,
+ "body": "generated placeholder",
+ "upload_url": "https://uploads.example/releases/7/assets{?name,label}",
+ "html_url": "https://github.com/trycua/cua/releases/tag/lume-v0.4.0",
+ }
+
+ def get(self, path: str):
+ if path.endswith("/git/ref/tags/lume-v0.4.0"):
+ return {"object": {"type": "tag", "sha": "annotated"}}
+ if path.endswith("/git/tags/annotated"):
+ return {"object": {"type": "commit", "sha": self.expected_sha}}
+ if "/releases?" in path:
+ return [self.release] if self.release else []
+ if path.endswith("/releases/7/assets?per_page=100&page=1"):
+ return list(self.assets)
+ if path.endswith("/releases/latest"):
+ return self.release
+ raise AssertionError(path)
+
+ def delete(self, path: str):
+ self.deleted.append(path)
+
+ def upload(self, url: str, path: Path):
+ self.uploaded.append((url, path.name))
+
+ def patch(self, path: str, body: dict):
+ self.patches.append((path, body))
+ self.release.update(body)
+ return self.release
+
+
+def test_finalize_verifies_tag_replaces_incomplete_assets_then_publishes(tmp_path: Path):
+ (tmp_path / "old.zip").write_bytes(b"new archive")
+ (tmp_path / "new.sha256").write_text("digest")
+ api = FakeApi("abc123")
+
+ release = finalize_release(
+ api=api,
+ repository="trycua/cua",
+ tag="lume-v0.4.0",
+ expected_sha="abc123",
+ body="final body",
+ asset_dir=tmp_path,
+ prerelease=False,
+ make_latest=True,
+ )
+
+ assert tag_commit_sha(api, "trycua/cua", "lume-v0.4.0") == "abc123"
+ assert api.deleted == ["repos/trycua/cua/releases/assets/21"]
+ assert [name for _, name in api.uploaded] == ["new.sha256", "old.zip"]
+ assert api.patches[0][1] == {
+ "body": "final body",
+ "draft": False,
+ "prerelease": False,
+ "make_latest": "true",
+ }
+ assert release["draft"] is False
+
+
+def test_release_and_tag_invariants_fail_closed():
+ api = FakeApi("actual")
+ with pytest.raises(ReleaseError, match="expected expected"):
+ finalize_release(
+ api=api,
+ repository="trycua/cua",
+ tag="lume-v0.4.0",
+ expected_sha="expected",
+ body="body",
+ asset_dir=Path("unused"),
+ prerelease=False,
+ make_latest=True,
+ )
+ api.release = None
+ with pytest.raises(ReleaseError, match="does not exist"):
+ unique_release(api, "trycua/cua", "lume-v0.4.0")
+
+
+def test_published_release_is_verified_without_mutation(tmp_path: Path):
+ artifact = tmp_path / "lume.tar.gz"
+ artifact.write_bytes(b"archive")
+ api = FakeApi("abc123")
+ api.release.update({"draft": False, "body": "final body"})
+ api.assets = [
+ {
+ "id": 22,
+ "name": "lume.tar.gz",
+ "state": "uploaded",
+ "size": artifact.stat().st_size,
+ }
+ ]
+
+ finalize_release(
+ api=api,
+ repository="trycua/cua",
+ tag="lume-v0.4.0",
+ expected_sha="abc123",
+ body="final body",
+ asset_dir=tmp_path,
+ prerelease=False,
+ make_latest=True,
+ )
+
+ assert api.uploaded == []
+ assert api.deleted == []
+ assert api.patches == []
+
+
+def test_github_api_retries_transient_server_error(monkeypatch: pytest.MonkeyPatch):
+ class Response(BytesIO):
+ status = 200
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *_args):
+ self.close()
+
+ responses = iter(
+ [
+ HTTPError(
+ "https://api.github.com/repos/trycua/cua/releases",
+ 503,
+ "Service Unavailable",
+ {"Retry-After": "0.25"},
+ BytesIO(b"temporary GitHub error"),
+ ),
+ Response(json.dumps({"ok": True}).encode()),
+ ]
+ )
+ sleeps: list[float] = []
+
+ def fake_urlopen(*_args, **_kwargs):
+ response = next(responses)
+ if isinstance(response, Exception):
+ raise response
+ return response
+
+ monkeypatch.setattr(github_release, "urlopen", fake_urlopen)
+ monkeypatch.setattr(github_release.time, "sleep", sleeps.append)
+
+ api = GitHubApi("token", max_attempts=3, retry_base_seconds=0.1)
+ assert api.get("repos/trycua/cua/releases") == {"ok": True}
+ assert sleeps == [0.25]
diff --git a/.github/scripts/tests/test_release_attribution.py b/.github/scripts/tests/test_release_attribution.py
new file mode 100644
index 0000000000..630356244b
--- /dev/null
+++ b/.github/scripts/tests/test_release_attribution.py
@@ -0,0 +1,269 @@
+from __future__ import annotations
+
+import json
+from pathlib import Path
+import subprocess
+
+import pytest
+from jsonschema import Draft202012Validator
+
+from release_attribution import (
+ CommitRecord,
+ ReleaseError,
+ _change_contributors,
+ build_manifest,
+ linked_issue_numbers,
+ login_from_email,
+ release_entries,
+ render_body,
+ render_card_svg,
+ render_card_alt_text,
+ render_social,
+ source_pull_numbers,
+ validate_pr_title,
+)
+
+
+REPO_ROOT = Path(__file__).resolve().parents[3]
+
+
+def git(root: Path, *args: str) -> str:
+ return subprocess.run(
+ ["git", *args], cwd=root, check=True, text=True, capture_output=True
+ ).stdout.strip()
+
+
+class FakeGitHub:
+ def __init__(self, commit_sha: str) -> None:
+ self.commit_sha = commit_sha
+
+ def pulls_for_commit(self, repository: str, commit_sha: str):
+ assert repository == "trycua/cua"
+ assert commit_sha == self.commit_sha
+ return [{"number": 12, "merge_commit_sha": commit_sha, "merged_at": "now"}]
+
+ def pull(self, repository: str, number: int):
+ if number == 9:
+ return {
+ "number": 9,
+ "user": {"login": "source-author"},
+ "author_association": "NONE",
+ "body": "",
+ "labels": [],
+ }
+ assert number == 12
+ return {
+ "number": 12,
+ "user": {"login": "pr-author"},
+ "author_association": "NONE",
+ "body": "Closes #7\n\nSalvaged from #9",
+ "labels": [{"name": "release-visual"}],
+ }
+
+ def issue(self, repository: str, number: int):
+ assert number == 7
+ return {
+ "number": 7,
+ "user": {"login": "bug-reporter"},
+ "author_association": "NONE",
+ }
+
+
+def test_title_validation_and_override_entries():
+ validate_pr_title("feat(driver)!: expose structured reconnect state")
+ with pytest.raises(ReleaseError, match="Conventional Commit"):
+ validate_pr_title("Make reconnect better")
+ with pytest.raises(ReleaseError, match="unsupported"):
+ validate_pr_title("release(driver): reconnect")
+
+ entries = release_entries(
+ "chore: merge work",
+ "",
+ "BEGIN_COMMIT_OVERRIDE\nfeat(driver): add readiness\nfix(driver): keep focus\nEND_COMMIT_OVERRIDE",
+ )
+ assert [(entry.change_type, entry.summary) for entry in entries] == [
+ ("feat", "add readiness"),
+ ("fix", "keep focus"),
+ ]
+
+
+def test_login_from_noreply_and_override():
+ assert login_from_email("[email protected]", {}) == "octo-user"
+ assert (
+ login_from_email("github-actions[bot]@users.noreply.github.com", {})
+ == "github-actions[bot]"
+ )
+ assert login_from_email("[email protected]", {"[email protected]": "person"}) == "person"
+ assert login_from_email("[email protected]", {}) is None
+
+
+def test_cross_repository_references_are_not_resolved_in_cua():
+ body = (
+ "Closes https://github.com/other/project/issues/7 and closes #8. "
+ "Salvaged from https://github.com/other/project/pull/9 and source-pr: #10"
+ )
+ assert linked_issue_numbers(body, "trycua/cua") == [8]
+ assert source_pull_numbers(body, "trycua/cua") == [10]
+
+
+def test_manifest_is_pr_first_and_renders_deterministically(tmp_path: Path):
+ git(tmp_path, "init")
+ git(tmp_path, "config", "user.name", "Release Test")
+ git(tmp_path, "config", "user.email", "[email protected]")
+ product = tmp_path / "libs/cua-driver/rust"
+ product.mkdir(parents=True)
+ (product / "CHANGELOG.md").write_text("# Changelog\n")
+ (product / "driver.txt").write_text("initial\n")
+ git(tmp_path, "add", ".")
+ git(tmp_path, "commit", "-m", "chore: seed fixture")
+ git(tmp_path, "tag", "cua-driver-rs-v0.8.1")
+
+ python = tmp_path / "libs/cua-driver/python"
+ python.mkdir(parents=True)
+ (python / "wrapper.py").write_text("excluded\n")
+ git(tmp_path, "add", ".")
+ git(tmp_path, "commit", "-m", "fix(python): excluded wrapper change")
+
+ (product / "driver.txt").write_text("fixed\n")
+ (product / "CHANGELOG.md").write_text(
+ "# Changelog\n\n"
+ "## [0.8.2](https://github.com/trycua/cua/compare/"
+ "cua-driver-rs-v0.8.1...cua-driver-rs-v0.8.2) (2026-07-16)\n\n"
+ "* fix: preserve focus (#12)\n"
+ )
+ git(tmp_path, "add", ".")
+ git(
+ tmp_path,
+ "commit",
+ "-m",
+ "fix(driver): preserve focus while reconnecting",
+ "-m",
+ "Co-authored-by: Claude Opus <[email protected]>\n"
+ "Co-authored-by: Actions <github-actions[bot]@users.noreply.github.com>\n"
+ "Co-authored-by: Pair <[email protected]>",
+ )
+ commit_sha = git(tmp_path, "rev-parse", "HEAD")
+ git(tmp_path, "tag", "cua-driver-rs-v0.8.2")
+
+ assets = tmp_path / "assets"
+ assets.mkdir()
+ (assets / "cua-driver").write_bytes(b"binary")
+ manifest = build_manifest(
+ repo_root=tmp_path,
+ repository="trycua/cua",
+ product="cua-driver-rs",
+ display_name="Cua Driver",
+ version="0.8.2",
+ tag="cua-driver-rs-v0.8.2",
+ previous_tag="cua-driver-rs-v0.8.1",
+ expected_sha=commit_sha,
+ paths=("libs/cua-driver",),
+ exclude_paths=("libs/cua-driver/python",),
+ changelog_path=product / "CHANGELOG.md",
+ attribution_config={
+ "bots": ["github-actions[bot]"],
+ "coauthorOverrides": {},
+ "ignoredCoauthorEmails": ["[email protected]"],
+ "identityOverrides": {},
+ "internalHandles": [],
+ "optOutHandles": [],
+ },
+ github=FakeGitHub(commit_sha),
+ asset_dir=assets,
+ )
+
+ assert manifest["repository"] == "trycua/cua"
+ assert manifest["schema"].endswith(f"/{commit_sha}/.github/release-manifest.schema.json")
+ assert manifest["bump"] == "patch"
+ assert manifest["visualRequested"] is True
+ assert manifest["changes"] == [
+ {
+ "type": "fix",
+ "scope": "driver",
+ "summary": "preserve focus while reconnecting",
+ "breaking": False,
+ "pr": 12,
+ "issues": [7],
+ "contributors": [
+ {"login": "pr-author", "role": "author", "external": True},
+ {"login": "pair-user", "role": "coauthor", "external": True},
+ {"login": "source-author", "role": "coauthor", "external": True},
+ {"login": "bug-reporter", "role": "reporter", "external": True},
+ ],
+ }
+ ]
+ assert manifest["assets"][0]["name"] == "cua-driver"
+ schema = json.loads((REPO_ROOT / ".github/release-manifest.schema.json").read_text())
+ Draft202012Validator(schema, format_checker=None).validate(manifest)
+ body = render_body(manifest)
+ assert "Thanks @pr-author, @pair-user, @source-author; reported by @bug-reporter." in body
+ assert "https://github.com/trycua/cua/pull/12" in body
+ assert "releases/download/cua-driver-rs-v0.8.2/release-card.png" in body
+ social = render_social(manifest)
+ assert len(social.rstrip()) <= 280
+ assert "releases/tag/cua-driver-rs-v0.8.2" in social
+ assert "Thanks to 4 community contributors." in social
+ assert "@pr-author" not in social
+ card = render_card_svg(manifest)
+ assert "Cua Driver" in card
+ assert "trycua/cua" in card
+ alt = render_card_alt_text(manifest)
+ assert alt.startswith("Cua Driver 0.8.2 release highlights:")
+ assert "4 external contributors" in alt
+ assert json.dumps(manifest, sort_keys=True) == json.dumps(manifest, sort_keys=True)
+
+ preflight = build_manifest(
+ repo_root=tmp_path,
+ repository="trycua/cua",
+ product="cua-driver-rs",
+ display_name="Cua Driver",
+ version="0.8.2",
+ tag="cua-driver-rs-v0.8.2-not-created-yet",
+ release_ref=commit_sha,
+ previous_tag="cua-driver-rs-v0.8.1",
+ expected_sha=commit_sha,
+ paths=("libs/cua-driver",),
+ exclude_paths=("libs/cua-driver/python",),
+ changelog_path=product / "CHANGELOG.md",
+ attribution_config={
+ "bots": ["github-actions[bot]"],
+ "coauthorOverrides": {},
+ "ignoredCoauthorEmails": ["[email protected]"],
+ "identityOverrides": {},
+ "internalHandles": [],
+ "optOutHandles": [],
+ },
+ github=FakeGitHub(commit_sha),
+ asset_dir=assets,
+ )
+ assert preflight["tag"] == "cua-driver-rs-v0.8.2-not-created-yet"
+ assert preflight["sha"] == commit_sha
+
+
+def test_unresolved_human_coauthor_fails_closed():
+ commit = CommitRecord(
+ "deadbeef",
+ "fix(driver): preserve focus",
+ "Co-authored-by: Unknown Person <[email protected]>",
+ )
+ pull = {
+ "user": {"login": "author"},
+ "author_association": "NONE",
+ "body": "",
+ "labels": [],
+ }
+ with pytest.raises(ReleaseError, match="unresolved human coauthor"):
+ _change_contributors(
+ pull,
+ commit,
+ FakeGitHub("deadbeef"),
+ "trycua/cua",
+ {
+ "bots": [],
+ "coauthorOverrides": {},
+ "ignoredCoauthorEmails": [],
+ "identityOverrides": {},
+ "internalHandles": [],
+ "optOutHandles": [],
+ },
+ )
diff --git a/.github/scripts/tests/test_validate_release_versions.py b/.github/scripts/tests/test_validate_release_versions.py
new file mode 100644
index 0000000000..1f5129dc89
--- /dev/null
+++ b/.github/scripts/tests/test_validate_release_versions.py
@@ -0,0 +1,30 @@
+from pathlib import Path
+import shutil
+
+import pytest
+
+from validate_release_versions import VersionError, validate
+
+
+REPO_ROOT = Path(__file__).resolve().parents[3]
+
+
+def copy_release_sources(destination: Path) -> None:
+ shutil.copy(REPO_ROOT / ".release-please-manifest.json", destination)
+ for relative in ("libs/cua-driver", "libs/lume"):
+ source = REPO_ROOT / relative
+ target = destination / relative
+ target.parent.mkdir(parents=True, exist_ok=True)
+ shutil.copytree(source, target)
+
+
+def test_current_release_versions_agree():
+ validate(REPO_ROOT, "all")
+
+
+def test_version_drift_fails_with_the_source_name(tmp_path: Path):
+ copy_release_sources(tmp_path)
+ path = tmp_path / "libs/lume/src/Main.swift"
+ path.write_text(path.read_text().replace('"0.3.16"', '"9.9.9"'))
+ with pytest.raises(VersionError, match="src/Main.swift=9.9.9"):
+ validate(tmp_path, "lume")
diff --git a/.github/scripts/validate_release_versions.py b/.github/scripts/validate_release_versions.py
new file mode 100644
index 0000000000..be8f5b023d
--- /dev/null
+++ b/.github/scripts/validate_release_versions.py
@@ -0,0 +1,113 @@
+#!/usr/bin/env python3
+"""Verify that checked-in Driver and Lume release versions agree."""
+
+from __future__ import annotations
+
+import argparse
+import json
+from pathlib import Path
+import re
+import sys
+
+try:
+ import tomllib
+except ModuleNotFoundError: # Python 3.10 and earlier
+ import tomli as tomllib
+from typing import Sequence
+
+
+class VersionError(RuntimeError):
+ """Checked-in version sources do not describe one release."""
+
+
+def read_match(path: Path, pattern: str) -> str:
+ match = re.search(pattern, path.read_text(), re.MULTILINE)
+ if not match:
+ raise VersionError(f"could not read a release version from {path}")
+ return match.group(1)
+
+
+def require_equal(product: str, expected: str, values: dict[str, str]) -> None:
+ mismatches = {name: value for name, value in values.items() if value != expected}
+ if mismatches:
+ details = ", ".join(f"{name}={value}" for name, value in sorted(mismatches.items()))
+ raise VersionError(f"{product} expects {expected}; mismatched sources: {details}")
+
+
+def driver_versions(root: Path) -> tuple[str, dict[str, str]]:
+ base = root / "libs/cua-driver"
+ expected = (base / "rust/VERSION").read_text().strip()
+ cargo = tomllib.loads((base / "rust/Cargo.toml").read_text())
+ python_project = tomllib.loads((base / "python/pyproject.toml").read_text())
+ values = {
+ "rust/Cargo.toml": str(cargo["workspace"]["package"]["version"]),
+ "python/pyproject.toml": str(python_project["project"]["version"]),
+ "python/src/cua_driver/__init__.py": read_match(
+ base / "python/src/cua_driver/__init__.py", r'^__version__\s*=\s*"([^"]+)"'
+ ),
+ "scripts/_install-rust.sh": read_match(
+ base / "scripts/_install-rust.sh", r'^CUA_DRIVER_RS_BAKED_VERSION="([^"]+)"'
+ ),
+ "scripts/install.ps1": read_match(
+ base / "scripts/install.ps1",
+ r'^\$Script:CuaDriverRsBakedVersion\s*=\s*"([^"]+)"',
+ ),
+ }
+
+ members = [base / "rust" / member for member in cargo["workspace"]["members"]]
+ local_names = {
+ tomllib.loads((member / "Cargo.toml").read_text())["package"]["name"] for member in members
+ }
+ lock = tomllib.loads((base / "rust/Cargo.lock").read_text())
+ for package in lock["package"]:
+ if package["name"] in local_names:
+ values[f"rust/Cargo.lock:{package['name']}"] = str(package["version"])
+ missing = local_names - {
+ key.split(":", 1)[1] for key in values if key.startswith("rust/Cargo.lock:")
+ }
+ if missing:
+ raise VersionError(f"Cargo.lock is missing workspace packages: {sorted(missing)}")
+ return expected, values
+
+
+def lume_versions(root: Path) -> tuple[str, dict[str, str]]:
+ base = root / "libs/lume"
+ expected = (base / "VERSION").read_text().strip()
+ return expected, {
+ "src/Main.swift": read_match(
+ base / "src/Main.swift", r'static let current: String = "([^"]+)"'
+ ),
+ "scripts/install.sh": read_match(
+ base / "scripts/install.sh", r'^LUME_BAKED_VERSION="([^"]+)"'
+ ),
+ }
+
+
+def validate(root: Path, product: str) -> None:
+ manifest = json.loads((root / ".release-please-manifest.json").read_text())
+ if product in {"all", "driver"}:
+ expected, values = driver_versions(root)
+ values[".release-please-manifest.json"] = str(manifest["libs/cua-driver"])
+ require_equal("Cua Driver", expected, values)
+ if product in {"all", "lume"}:
+ expected, values = lume_versions(root)
+ values[".release-please-manifest.json"] = str(manifest["libs/lume"])
+ require_equal("Lume", expected, values)
+
+
+def main(argv: Sequence[str] | None = None) -> int:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--repo-root", type=Path, default=Path.cwd())
+ parser.add_argument("--product", choices=("all", "driver", "lume"), default="all")
+ args = parser.parse_args(argv)
+ try:
+ validate(args.repo_root.resolve(), args.product)
+ except (KeyError, OSError, VersionError, ValueError) as error:
+ print(f"release version error: {error}", file=sys.stderr)
+ return 1
+ print(f"release versions agree for {args.product}")
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/.github/workflows/cd-rust-cua-driver.yml b/.github/workflows/cd-rust-cua-driver.yml
index d4707e89e5..1a5028b97e 100644
--- a/.github/workflows/cd-rust-cua-driver.yml
+++ b/.github/workflows/cd-rust-cua-driver.yml
@@ -28,6 +28,12 @@ on:
permissions:
contents: write
+ issues: read
+ pull-requests: read
+
+concurrency:
+ group: cd-cua-driver-${{ github.ref }}
+ cancel-in-progress: false
jobs:
# ── Linux (x86_64 + arm64) ───────────────────────────────────────────────────
@@ -107,7 +113,7 @@ jobs:
rust-cua-driver-rs-linux-${{ matrix.arch }}-
- name: Build (release)
working-directory: libs/cua-driver/rust
- run: cargo build -p cua-driver --release --features portal-input --target ${{ matrix.target }}
+ run: cargo build --locked -p cua-driver --release --features portal-input --target ${{ matrix.target }}
- name: Package
working-directory: libs/cua-driver/rust
run: |
@@ -175,7 +181,7 @@ jobs:
# `cua-driver-uia.exe` is the Windows-only sibling daemon that runs
# at UIAccess integrity so SendInput / UI Automation can cross UIPI
# into UWP apps — see crates/cua-driver-uia/ and #1602.
- run: cargo build -p cua-driver -p cua-driver-uia --release --target ${{ matrix.target }}
+ run: cargo build --locked -p cua-driver -p cua-driver-uia --release --target ${{ matrix.target }}
- name: Package
working-directory: libs/cua-driver/rust
shell: pwsh
@@ -284,10 +290,10 @@ jobs:
rust-cua-driver-rs-darwin-universal-
- name: Build arm64
working-directory: libs/cua-driver/rust
- run: cargo build -p cua-driver --release --target aarch64-apple-darwin
+ run: cargo build --locked -p cua-driver --release --target aarch64-apple-darwin
- name: Build x86_64
working-directory: libs/cua-driver/rust
- run: cargo build -p cua-driver --release --target x86_64-apple-darwin
+ run: cargo build --locked -p cua-driver --release --target x86_64-apple-darwin
- name: Create universal binary (lipo)
working-directory: libs/cua-driver/rust
run: |
@@ -434,38 +440,8 @@ jobs:
with:
path: artifacts
- # Bake the new version into the working-tree install scripts BEFORE
- # staging them for the release upload, so the per-tag release assets
- # carry version N's baked default — not version N-1's. The same sed
- # patterns run again later under `Bake version into install scripts
- # (commit + push)` to land the change on main; doing the in-tree
- # rewrite here is idempotent (sed on an already-baked file is a
- # no-op) and ensures the GitHub Release page and main-branch commit
- # stay in lockstep.
- - name: Bake version into install scripts (in-tree)
- if: startsWith(github.ref, 'refs/tags/cua-driver-rs-v')
- env:
- VERSION: ${{ steps.version.outputs.version }}
- run: |
- # GNU sed (ubuntu-latest). The Swift CD workflow runs on
- # macos-15 and uses the BSD form (`sed -i ''`).
- # The Rust install logic now lives at
- # libs/cua-driver/scripts/_install-rust.sh (a private helper
- # invoked by libs/cua-driver/scripts/install.sh by default).
- sed -i \
- "s/^CUA_DRIVER_RS_BAKED_VERSION=.*/CUA_DRIVER_RS_BAKED_VERSION=\"${VERSION}\"/" \
- libs/cua-driver/scripts/_install-rust.sh
-
- # install.ps1 lives at the canonical Swift install dir;
- # PowerShell line starts with `$Script:` — escape the `$` for
- # sed's BRE so it matches the literal dollar sign.
- sed -i \
- "s/^\\\$Script:CuaDriverRsBakedVersion = .*/\\\$Script:CuaDriverRsBakedVersion = \"${VERSION}\"/" \
- libs/cua-driver/scripts/install.ps1
-
- echo "Baked version ${VERSION} into working-tree install scripts:"
- grep -E '^CUA_DRIVER_RS_BAKED_VERSION=' libs/cua-driver/scripts/_install-rust.sh
- grep -E '^\$Script:CuaDriverRsBakedVersion = ' libs/cua-driver/scripts/install.ps1
+ - name: Verify checked-in release versions
+ run: python3 .github/scripts/validate_release_versions.py --product driver
- name: Stage release files
run: |
@@ -480,9 +456,8 @@ jobs:
# The tag-pinned asset URLs below are a convenience for users who
# want to audit the exact installer that shipped with a release.
#
- # The freshly-baked scripts (rewritten in the prior step) are
- # what gets copied here, so the per-tag release assets carry the
- # current version's baked default — not the previous version's.
+ # Release Please updates checked-in versions before tagging, so
+ # these assets match the immutable tag without a later main push.
# Both user-facing installers live under libs/cua-driver/scripts/:
# install.sh is the canonical macOS/Linux installer and delegates
# to the Rust _install-rust.sh helper by default. install.ps1 is
@@ -528,174 +503,61 @@ jobs:
echo "Release files:"
ls -lh release-upload/
- - name: Generate SHA256 checksums
- id: checksums
+ - name: Collect PR-first release attribution
+ env:
+ GH_TOKEN: ${{ github.token }}
run: |
- cd release-upload
- {
- echo "## SHA256 Checksums"
- echo '```'
- shasum -a 256 cua-driver-rs-*.{tar.gz,zip} 2>/dev/null | sort
- echo '```'
- } > checksums.txt
- checksums=$(cat checksums.txt)
- echo "checksums<<EOF" >> "$GITHUB_OUTPUT"
- echo "$checksums" >> "$GITHUB_OUTPUT"
- echo "EOF" >> "$GITHUB_OUTPUT"
-
- - name: Generate path-filtered release notes
- id: notes
+ mkdir -p release-metadata
+ python3 .github/scripts/release_attribution.py collect \
+ --repository "${{ github.repository }}" \
+ --product cua-driver-rs \
+ --display-name "Cua Driver" \
+ --version "${{ steps.version.outputs.version }}" \
+ --tag "${{ github.ref_name }}" \
+ --tag-prefix cua-driver-rs-v \
+ --sha "${{ github.sha }}" \
+ --path libs/cua-driver \
+ --exclude-path libs/cua-driver/docs \
+ --exclude-path libs/cua-driver/python \
+ --exclude-path libs/cua-driver/tests \
+ --changelog libs/cua-driver/rust/CHANGELOG.md \
+ --asset-dir release-upload \
+ --output release-metadata/release-manifest.json
+
+ - name: Render release body and announcement draft
run: |
- PREV_TAG=$(git tag -l "cua-driver-rs-v*" --sort=-v:refname \
- | grep -v "^${{ github.ref_name }}$" \
- | head -n 1 || echo "")
- if [ -n "$PREV_TAG" ]; then
- NOTES=$(git log ${PREV_TAG}..HEAD --pretty=format:"* %s (%h) by @%an" -- "libs/cua-driver/rust" | head -50)
- else
- NOTES=$(git log --pretty=format:"* %s (%h) by @%an" -- "libs/cua-driver/rust" | head -50)
+ python3 .github/scripts/release_attribution.py render \
+ --manifest release-metadata/release-manifest.json \
+ --body release-metadata/release-body.md \
+ --social release-metadata/release-social.txt \
+ --card release-metadata/release-card.svg \
+ --alt release-metadata/release-card-alt.txt \
+ --footer .github/release-notes/cua-driver-rs.md
+ cp release-metadata/release-manifest.json release-upload/
+ if [ -f release-metadata/release-card.svg ]; then
+ sudo apt-get update
+ sudo apt-get install -y --no-install-recommends librsvg2-bin
+ rsvg-convert release-metadata/release-card.svg \
+ --output release-metadata/release-card.png
+ cp release-metadata/release-card.png release-upload/
fi
- [ -z "$NOTES" ] && NOTES="* No path-specific changes found"
- {
- echo "RELEASE_NOTES<<EOF"
- echo "## What's Changed"
- echo ""
- echo "$NOTES"
- echo "EOF"
- } >> "$GITHUB_OUTPUT"
- - name: Create GitHub Release
- uses: softprops/action-gh-release@v2
+ - name: Preserve release evidence
+ uses: actions/upload-artifact@v4
with:
- files: release-upload/*
- prerelease: true
- body: |
- > **cua-driver-rs**
- >
- > `cua-driver-rs` is the Rust implementation of
- > [`cua-driver`](https://github.com/trycua/cua/tree/main/libs/cua-driver),
- > shipping the same user-facing `cua-driver` binary for macOS and
- > Windows, plus Linux pre-release artifacts for early testing.
- >
- > The Rust port and the Swift driver publish to the same GitHub repo under
- > **distinct tag prefixes** (`cua-driver-rs-v*` vs `cua-driver-v*`), so their
- > release artifacts do not collide.
-
- ${{ steps.notes.outputs.RELEASE_NOTES }}
-
- ${{ steps.checksums.outputs.checksums }}
-
- ### Install (macOS / Linux pre-release)
-
- ```bash
- /bin/bash -c "$(curl -fsSL https://cua.ai/driver/install.sh)"
- ```
-
- The shell installer covers macOS and the Linux pre-release backend
- and installs the Rust implementation by default. Linux artifacts are
- published for early testing and are not yet an official supported
- release tier.
-
- ### Install (Windows)
-
- ```powershell
- irm https://cua.ai/driver/install.ps1 | iex
- ```
-
- The installer auto-detects host architecture (x86_64 / arm64) and uses
- directory junctions for the install layout, so it runs without admin
- and without Developer Mode.
-
- ### Artifacts
-
- **macOS (universal — arm64 + x86_64 in one binary, like the Swift cua-driver)**
- - `cua-driver-rs-${{ steps.version.outputs.version }}-darwin-universal.tar.gz` — directory tarball with LICENSE + `CuaDriver.app` bundle (install.sh expects this layout)
- - `cua-driver-rs-${{ steps.version.outputs.version }}-darwin-arm64.tar.gz` — same payload, named for arm64 callers
- - `cua-driver-rs-${{ steps.version.outputs.version }}-darwin-x86_64.tar.gz` — same payload, named for x86_64 callers
- - `cua-driver-rs-${{ steps.version.outputs.version }}-darwin-universal-binary.tar.gz` — bare universal binary (single file at archive root; **no** .app — bypasses the TCC auto-relaunch path)
-
- **Linux pre-release**
- - `cua-driver-rs-${{ steps.version.outputs.version }}-linux-x86_64.tar.gz` — directory tarball
- - `cua-driver-rs-${{ steps.version.outputs.version }}-linux-x86_64-binary.tar.gz` — bare binary
- - `cua-driver-rs-${{ steps.version.outputs.version }}-linux-arm64.tar.gz` — directory tarball (Linux on ARM / aarch64)
- - `cua-driver-rs-${{ steps.version.outputs.version }}-linux-arm64-binary.tar.gz` — bare binary (Linux on ARM / aarch64)
-
- **Windows**
- - `cua-driver-rs-${{ steps.version.outputs.version }}-windows-x86_64.zip` — directory zip
- - `cua-driver-rs-${{ steps.version.outputs.version }}-windows-x86_64-binary.zip` — bare `cua-driver.exe`
- - `cua-driver-rs-${{ steps.version.outputs.version }}-windows-arm64.zip` — directory zip (Windows on ARM)
- - `cua-driver-rs-${{ steps.version.outputs.version }}-windows-arm64-binary.zip` — bare `cua-driver.exe` (Windows on ARM)
-
- **Installer scripts**
- - `install.sh` — macOS / Linux pre-release one-liner installer
- - `install.ps1` — Windows one-liner installer
- - `uninstall.sh` — macOS / Linux pre-release one-liner uninstaller
- - `uninstall.ps1` — Windows one-liner uninstaller
- generate_release_notes: false
- make_latest: false
-
- # The bump-version workflow uses this same GitHub App so its pushes
- # bypass the "Changes must be made through a pull request" ruleset
- # on main. The default GITHUB_TOKEN (github-actions[bot]) is NOT on
- # the bypass list and gets rejected here. Mirror the Swift CD
- # workflow's auth setup so the bake-version push lands.
- - name: Generate GitHub App token (for bake-version push)
- id: app-token
- if: startsWith(github.ref, 'refs/tags/cua-driver-rs-v')
- uses: actions/create-github-app-token@v1
- with:
- app-id: ${{ secrets.RELEASE_APP_ID }}
- private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- owner: ${{ github.repository_owner }}
- repositories: ${{ github.event.repository.name }}
+ name: cua-driver-release-metadata-${{ steps.version.outputs.version }}
+ path: release-metadata/
+ if-no-files-found: error
+ retention-days: 90
- - name: Bake version into install scripts (commit + push)
- if: startsWith(github.ref, 'refs/tags/cua-driver-rs-v')
+ - name: Publish the verified Release Please draft
env:
- VERSION: ${{ steps.version.outputs.version }}
- GH_TOKEN: ${{ steps.app-token.outputs.token }}
+ GH_TOKEN: ${{ github.token }}
run: |
- # Re-authenticate the origin remote with the app token so the
- # push uses the bypass-enabled identity, not the default
- # github-actions[bot] credentials baked in by actions/checkout.
- #
- # actions/checkout sets `http.https://github.com/.extraheader`
- # with the default GITHUB_TOKEN; that header otherwise overrides
- # the URL-embedded App token on the push (two Authorization
- # headers sent → server takes the extraheader → push rejected
- # by the main-branch ruleset). Drop it so only the App token's
- # auth survives.
- git config --unset-all "http.https://github.com/.extraheader" || true
- git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git"
- git fetch origin main
- git checkout -B bake-version origin/main
-
- # Replay the same sed the earlier in-tree step ran against the
- # working tree — but here against origin/main, so the commit we
- # push back to main has the new baked version regardless of
- # whether the in-tree step ran (it's idempotent and the on-disk
- # working-tree edits got discarded by the checkout above).
- #
- # The release job runs on ubuntu-latest, so this uses GNU sed
- # syntax (`sed -i` with no empty-string arg) — the Swift CD
- # workflow's bake step runs on macos-15 and uses the BSD form
- # (`sed -i ''`).
- # Rust install logic lives at libs/cua-driver/scripts/_install-rust.sh
- # (private helper invoked by the canonical libs/cua-driver/scripts/install.sh
- # by default).
- sed -i \
- "s/^CUA_DRIVER_RS_BAKED_VERSION=.*/CUA_DRIVER_RS_BAKED_VERSION=\"${VERSION}\"/" \
- libs/cua-driver/scripts/_install-rust.sh
-
- # install.ps1 lives at libs/cua-driver/scripts/install.ps1
- # (canonical Windows entry point). The PowerShell line starts
- # with `$Script:` — escape the `$` for sed's BRE so it matches
- # the literal dollar sign.
- sed -i \
- "s/^\\\$Script:CuaDriverRsBakedVersion = .*/\\\$Script:CuaDriverRsBakedVersion = \"${VERSION}\"/" \
- libs/cua-driver/scripts/install.ps1
-
- git config user.name "trycua-release[bot]"
- git config user.email "trycua-release[bot]@users.noreply.github.com"
- git add libs/cua-driver/scripts/_install-rust.sh libs/cua-driver/scripts/install.ps1
- git commit -m "chore(cua-driver-rs): bake version ${VERSION} into install scripts [skip ci]"
- git push origin bake-version:main
+ python3 .github/scripts/github_release.py \
+ --repository "${{ github.repository }}" \
+ --tag "${{ github.ref_name }}" \
+ --sha "${{ github.sha }}" \
+ --body release-metadata/release-body.md \
+ --asset-dir release-upload \
+ --prerelease
diff --git a/.github/workflows/cd-swift-lume.yml b/.github/workflows/cd-swift-lume.yml
index 56b6c3ce49..0b98f5c467 100644
--- a/.github/workflows/cd-swift-lume.yml
+++ b/.github/workflows/cd-swift-lume.yml
@@ -33,13 +33,15 @@ on:
required: true
PROVISIONING_PROFILE_BASE64:
required: true
- RELEASE_APP_ID:
- required: false
- RELEASE_APP_PRIVATE_KEY:
- required: false
permissions:
contents: write
+ issues: read
+ pull-requests: read
+
+concurrency:
+ group: cd-lume-${{ github.ref }}
+ cancel-in-progress: false
env:
APPLICATION_CERT_BASE64: ${{ secrets.APPLICATION_CERT_BASE64 }}
@@ -50,14 +52,11 @@ env:
APP_SPECIFIC_PASSWORD: ${{ secrets.APP_SPECIFIC_PASSWORD }}
DEVELOPER_NAME: ${{ secrets.DEVELOPER_NAME }}
PROVISIONING_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }}
- RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
- RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
jobs:
notarize:
runs-on: macos-15
outputs:
- sha256_checksums: ${{ steps.generate_checksums.outputs.checksums }}
version: ${{ steps.set_version.outputs.version }}
steps:
- uses: actions/checkout@v4
@@ -84,17 +83,17 @@ jobs:
elif [[ -n "${{ inputs.version }}" ]]; then
VERSION="${{ inputs.version }}"
echo "Using version from input: $VERSION"
- elif [[ -n "${{ inputs.version }}" ]]; then
- VERSION="${{ inputs.version }}"
- echo "Using version from workflow_call input: $VERSION"
else
echo "Error: No version found in tag or input"
exit 1
fi
- # Update version in Main.swift
- echo "Updating version in Main.swift to $VERSION"
- sed -i '' "s/static let current: String = \".*\"/static let current: String = \"$VERSION\"/" libs/lume/src/Main.swift
+ SOURCE_VERSION=$(tr -d '[:space:]' < libs/lume/VERSION)
+ if [[ "$SOURCE_VERSION" != "$VERSION" ]]; then
+ echo "Tag/input version $VERSION does not match libs/lume/VERSION ($SOURCE_VERSION)"
+ exit 1
+ fi
+ python3 .github/scripts/validate_release_versions.py --product lume
# Set output for later steps
echo "version=$VERSION" >> $GITHUB_OUTPUT
@@ -208,30 +207,6 @@ jobs:
path: ./libs/lume/build.log
retention-days: 7
- - name: Generate SHA256 Checksums
- id: generate_checksums
- working-directory: ./libs/lume/.release
- run: |
- # Use existing checksums file if it exists, otherwise generate one
- if [ -f "checksums.txt" ]; then
- echo "Using existing checksums file"
- cat checksums.txt
- else
- echo "## SHA256 Checksums" > checksums.txt
- echo '```' >> checksums.txt
- shasum -a 256 lume-*.tar.gz >> checksums.txt
- echo '```' >> checksums.txt
- fi
-
- checksums=$(cat checksums.txt)
- echo "checksums<<EOF" >> $GITHUB_OUTPUT
- echo "$checksums" >> $GITHUB_OUTPUT
- echo "EOF" >> $GITHUB_OUTPUT
-
- # Debug: Show all files in the release directory
- echo "All files in release directory:"
- ls -la
-
- name: Create Standard Version Releases
working-directory: ./libs/lume/.release
run: |
@@ -251,106 +226,93 @@ jobs:
echo "Files with symlinks in release directory:"
ls -la
- - name: Upload Notarized Package (Tarball)
+ - name: Stage notarized release assets
+ working-directory: ./libs/lume/.release
+ run: |
+ mkdir -p release-upload
+ for asset in lume-*.tar.gz lume-darwin.tar.gz lume-darwin.pkg.tar.gz lume.tar.gz lume.pkg.tar.gz; do
+ [ -e "$asset" ] || continue
+ cp -L "$asset" "release-upload/$asset"
+ done
+ ls -lh release-upload
+
+ - name: Upload notarized release assets
uses: actions/upload-artifact@v4
with:
- name: lume-notarized-tarball
- path: ./libs/lume/${{ steps.build_notarize.outputs.tarball_path }}
+ name: lume-release-assets
+ path: ./libs/lume/.release/release-upload/
if-no-files-found: error
- - name: Upload Notarized Package (Installer)
- uses: actions/upload-artifact@v4
+ release:
+ needs: notarize
+ if: startsWith(github.ref, 'refs/tags/lume-v')
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
with:
- name: lume-notarized-installer
- path: ./libs/lume/${{ steps.build_notarize.outputs.pkg_path }}
- if-no-files-found: error
+ fetch-depth: 0
- - name: Generate path-filtered release notes
- if: startsWith(github.ref, 'refs/tags/lume-v')
- id: release-notes
- run: |
- # Find previous lume tag
- PREV_TAG=$(git tag -l "lume-v*" --sort=-v:refname | grep -v "^${{ github.ref_name }}$" | head -n 1 || echo "")
+ - name: Download notarized release assets
+ uses: actions/download-artifact@v4
+ with:
+ name: lume-release-assets
+ path: release-upload
- echo "Current tag: ${{ github.ref_name }}"
- echo "Previous tag: $PREV_TAG"
+ - name: Verify checked-in release versions
+ run: python3 .github/scripts/validate_release_versions.py --product lume
- # Generate release notes filtered by libs/lume path
- if [ -n "$PREV_TAG" ]; then
- echo "Generating notes for commits between $PREV_TAG and HEAD in libs/lume"
- NOTES=$(git log ${PREV_TAG}..HEAD --pretty=format:"* %s (%h) by @%an" -- "libs/lume" | head -50)
- else
- echo "No previous tag found, generating notes for recent commits in libs/lume"
- NOTES=$(git log --pretty=format:"* %s (%h) by @%an" -- "libs/lume" | head -50)
- fi
-
- if [ -z "$NOTES" ]; then
- NOTES="* Initial release or no path-specific changes found"
+ - name: Collect PR-first release attribution
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ mkdir -p release-metadata
+ python3 .github/scripts/release_attribution.py collect \
+ --repository "${{ github.repository }}" \
+ --product lume \
+ --display-name Lume \
+ --version "${{ needs.notarize.outputs.version }}" \
+ --tag "${{ github.ref_name }}" \
+ --tag-prefix lume-v \
+ --sha "${{ github.sha }}" \
+ --path libs/lume \
+ --changelog libs/lume/CHANGELOG.md \
+ --asset-dir release-upload \
+ --output release-metadata/release-manifest.json
+
+ - name: Render release body and announcement draft
+ run: |
+ python3 .github/scripts/release_attribution.py render \
+ --manifest release-metadata/release-manifest.json \
+ --body release-metadata/release-body.md \
+ --social release-metadata/release-social.txt \
+ --card release-metadata/release-card.svg \
+ --alt release-metadata/release-card-alt.txt \
+ --footer .github/release-notes/lume.md
+ cp release-metadata/release-manifest.json release-upload/
+ if [ -f release-metadata/release-card.svg ]; then
+ sudo apt-get update
+ sudo apt-get install -y --no-install-recommends librsvg2-bin
+ rsvg-convert release-metadata/release-card.svg \
+ --output release-metadata/release-card.png
+ cp release-metadata/release-card.png release-upload/
fi
- # Store notes in output
- echo "RELEASE_NOTES<<EOF" >> $GITHUB_OUTPUT
- echo "## What's Changed" >> $GITHUB_OUTPUT
- echo "" >> $GITHUB_OUTPUT
- echo "$NOTES" >> $GITHUB_OUTPUT
- echo "EOF" >> $GITHUB_OUTPUT
-
- - name: Create Release
- if: startsWith(github.ref, 'refs/tags/lume-v')
- uses: softprops/action-gh-release@v1
- with:
- files: |
- ./libs/lume/${{ steps.build_notarize.outputs.tarball_path }}
- ./libs/lume/${{ steps.build_notarize.outputs.pkg_path }}
- ./libs/lume/.release/lume-darwin.tar.gz
- ./libs/lume/.release/lume-darwin.pkg.tar.gz
- ./libs/lume/.release/lume.tar.gz
- ./libs/lume/.release/lume.pkg.tar.gz
- body: |
- ${{ steps.release-notes.outputs.RELEASE_NOTES }}
-
- ${{ steps.generate_checksums.outputs.checksums }}
-
- ### Installation with script
-
- ```bash
- /bin/bash -c "$(curl -fsSL https://cua.ai/lume/install.sh)"
- ```
- generate_release_notes: false
- make_latest: true
-
- - name: Generate GitHub App token (for bake-version push)
- id: app-token
- if: startsWith(github.ref, 'refs/tags/lume-v')
- uses: actions/create-github-app-token@v1
+ - name: Preserve release evidence
+ uses: actions/upload-artifact@v4
with:
- app-id: ${{ secrets.RELEASE_APP_ID }}
- private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- owner: ${{ github.repository_owner }}
- repositories: ${{ github.event.repository.name }}
+ name: lume-release-metadata-${{ needs.notarize.outputs.version }}
+ path: release-metadata/
+ if-no-files-found: error
+ retention-days: 90
- - name: Bake version into install script (commit + push)
- if: startsWith(github.ref, 'refs/tags/lume-v')
+ - name: Publish the verified Release Please draft
env:
- VERSION: ${{ steps.set_version.outputs.version }}
- GH_TOKEN: ${{ steps.app-token.outputs.token }}
+ GH_TOKEN: ${{ github.token }}
run: |
- git config --unset-all "http.https://github.com/.extraheader" || true
- git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git"
- git fetch origin main
- git checkout -B bake-lume-version origin/main
-
- sed -i '' \
- "s/^LUME_BAKED_VERSION=.*/LUME_BAKED_VERSION=\"${VERSION}\"/" \
- libs/lume/scripts/install.sh
-
- if git diff --quiet -- libs/lume/scripts/install.sh; then
- echo "LUME_BAKED_VERSION already ${VERSION}; nothing to commit."
- exit 0
- fi
-
- git config user.name "trycua-release[bot]"
- git config user.email "trycua-release[bot]@users.noreply.github.com"
- git add libs/lume/scripts/install.sh
- git commit -m "chore(lume): bake version ${VERSION} into install script [skip ci]"
- git push origin bake-lume-version:main
+ python3 .github/scripts/github_release.py \
+ --repository "${{ github.repository }}" \
+ --tag "${{ github.ref_name }}" \
+ --sha "${{ github.sha }}" \
+ --body release-metadata/release-body.md \
+ --asset-dir release-upload \
+ --make-latest
diff --git a/.github/workflows/ci-release-metadata.yml b/.github/workflows/ci-release-metadata.yml
new file mode 100644
index 0000000000..6116c85908
--- /dev/null
+++ b/.github/workflows/ci-release-metadata.yml
@@ -0,0 +1,102 @@
+name: "CI: Release metadata"
+
+on:
+ pull_request:
+ types: [opened, edited, synchronize, reopened]
+
+permissions:
+ contents: read
+ issues: read
+ pull-requests: read
+
+jobs:
+ validate:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ ref: ${{ github.event.pull_request.head.sha }}
+
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.11"
+
+ - name: Determine product release scope
+ id: scope
+ env:
+ BASE_SHA: ${{ github.event.pull_request.base.sha }}
+ HEAD_SHA: ${{ github.event.pull_request.head.sha }}
+ run: |
+ set -euo pipefail
+ PRODUCT_CHANGED=false
+ while IFS= read -r path; do
+ case "$path" in
+ libs/lume/*)
+ PRODUCT_CHANGED=true
+ ;;
+ libs/cua-driver/docs/*|libs/cua-driver/python/*|libs/cua-driver/tests/*)
+ ;;
+ libs/cua-driver/*)
+ PRODUCT_CHANGED=true
+ ;;
+ esac
+ done < <(git diff --name-only "$BASE_SHA...$HEAD_SHA")
+ echo "product_changed=$PRODUCT_CHANGED" >> "$GITHUB_OUTPUT"
+
+ - name: Validate squash-release title
+ if: steps.scope.outputs.product_changed == 'true'
+ env:
+ PR_TITLE: ${{ github.event.pull_request.title }}
+ run: |
+ python3 .github/scripts/release_attribution.py validate-title \
+ --title "$PR_TITLE"
+
+ - name: Validate checked-in release versions
+ run: python3 .github/scripts/validate_release_versions.py --product all
+
+ - name: Preflight trusted Release Please attribution
+ if: >-
+ steps.scope.outputs.product_changed == 'true' &&
+ github.event.pull_request.head.repo.full_name == github.repository &&
+ startsWith(github.event.pull_request.head.ref, 'release-please--branches--')
+ env:
+ BASE_SHA: ${{ github.event.pull_request.base.sha }}
+ GH_TOKEN: ${{ github.token }}
+ HEAD_SHA: ${{ github.event.pull_request.head.sha }}
+ run: |
+ set -euo pipefail
+ CHANGED=$(git diff --name-only "$BASE_SHA...$HEAD_SHA")
+ if grep -qx 'libs/cua-driver/rust/VERSION' <<<"$CHANGED"; then
+ VERSION=$(tr -d '[:space:]' < libs/cua-driver/rust/VERSION)
+ python3 .github/scripts/release_attribution.py collect \
+ --repository "${{ github.repository }}" \
+ --product cua-driver-rs \
+ --display-name "Cua Driver" \
+ --version "$VERSION" \
+ --tag "cua-driver-rs-v$VERSION" \
+ --tag-prefix cua-driver-rs-v \
+ --ref "$HEAD_SHA" \
+ --sha "$HEAD_SHA" \
+ --path libs/cua-driver \
+ --exclude-path libs/cua-driver/docs \
+ --exclude-path libs/cua-driver/python \
+ --exclude-path libs/cua-driver/tests \
+ --changelog libs/cua-driver/rust/CHANGELOG.md \
+ --output /tmp/cua-driver-release-manifest.json
+ fi
+ if grep -qx 'libs/lume/VERSION' <<<"$CHANGED"; then
+ VERSION=$(tr -d '[:space:]' < libs/lume/VERSION)
+ python3 .github/scripts/release_attribution.py collect \
+ --repository "${{ github.repository }}" \
+ --product lume \
+ --display-name Lume \
+ --version "$VERSION" \
+ --tag "lume-v$VERSION" \
+ --tag-prefix lume-v \
+ --ref "$HEAD_SHA" \
+ --sha "$HEAD_SHA" \
+ --path libs/lume \
+ --changelog libs/lume/CHANGELOG.md \
+ --output /tmp/lume-release-manifest.json
+ fi
diff --git a/.github/workflows/ci-release-reminder.yml b/.github/workflows/ci-release-reminder.yml
index 953a4ed802..9116f7bb01 100644
--- a/.github/workflows/ci-release-reminder.yml
+++ b/.github/workflows/ci-release-reminder.yml
@@ -47,8 +47,6 @@ jobs:
["libs/qemu-docker/android/"]="docker/qemu-android"
["libs/qemu-docker/linux/"]="docker/qemu-linux"
["libs/qemu-docker/windows/"]="docker/qemu-windows"
- ["libs/lume/"]="lume"
- ["libs/cua-driver/rust/"]="cua-driver-rs"
)
# Find affected services
@@ -111,16 +109,6 @@ jobs:
BODY+="\nOr add \`no-release\` to skip."
fi
- if printf '%s\n' "${AFFECTED[@]}" | grep -qx 'cua-driver-rs'; then
- BODY+="\n\n### cua-driver desktop release validation\n\n"
- BODY+="Before adding the release label, a maintainer records green runs on the exact release SHA:\n"
- BODY+="- [ ] [Windows canonical matrix](https://github.com/${REPO}/actions/workflows/e2e-rust-windows.yml)\n"
- BODY+="- [ ] macOS Lume maintainer gate: \`libs/cua-driver/tests/runners/macos-lume/run-all.sh\`, with the typed summary attached to the PR\n"
- BODY+="- [ ] [Linux X11 canonical matrix](https://github.com/${REPO}/actions/workflows/e2e-rust-linux.yml)\n"
- BODY+="- [ ] [Linux Sway canonical matrix](https://github.com/${REPO}/actions/workflows/e2e-rust-linux-wayland.yml) with environment \`sway\`\n"
- BODY+="- [ ] Result links and remaining experimental environment gaps are recorded in the PR\n"
- fi
-
# Delete previous reminder comment if exists, then post new one
EXISTING_COMMENT_ID=$(gh api "repos/${REPO}/issues/${PR_NUMBER}/comments" \
--jq ".[] | select(.body | contains(\"${COMMENT_MARKER}\")) | .id" 2>/dev/null | head -1)
diff --git a/.github/workflows/ci-test-scripts.yml b/.github/workflows/ci-test-scripts.yml
index 2c14a469d1..9b0a6d669f 100644
--- a/.github/workflows/ci-test-scripts.yml
+++ b/.github/workflows/ci-test-scripts.yml
@@ -4,6 +4,13 @@ on:
pull_request:
paths:
- ".github/scripts/**"
+ - ".github/release-attribution-config.json"
+ - ".github/release-manifest.schema.json"
+ - ".github/workflows/cd-rust-cua-driver.yml"
+ - ".github/workflows/cd-swift-lume.yml"
+ - ".github/workflows/release-please.yml"
+ - ".release-please-manifest.json"
+ - "release-please-config.json"
- ".github/workflows/ci-test-scripts.yml"
jobs:
@@ -22,7 +29,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- pip install pytest toml
+ pip install jsonschema pytest toml
- name: Run tests
run: |
diff --git a/.github/workflows/release-bump-version.yml b/.github/workflows/release-bump-version.yml
index ea1ae53c19..669320135f 100644
--- a/.github/workflows/release-bump-version.yml
+++ b/.github/workflows/release-bump-version.yml
@@ -30,8 +30,6 @@ on:
- npm/fleet
- npm/playground
- npm/cuabot
- - lume
- - cua-driver-rs
- docker/cuabot
- docker/kasm
- docker/xfce
@@ -152,14 +150,6 @@ jobs:
echo "directory=libs/cuabot" >> $GITHUB_OUTPUT
echo "type=npm" >> $GITHUB_OUTPUT
;;
- "lume")
- echo "directory=libs/lume" >> $GITHUB_OUTPUT
- echo "type=lume" >> $GITHUB_OUTPUT
- ;;
- "cua-driver-rs")
- echo "directory=libs/cua-driver/rust" >> $GITHUB_OUTPUT
- echo "type=cua-driver-rs" >> $GITHUB_OUTPUT
- ;;
"docker/cuabot")
echo "directory=libs/cuabot" >> $GITHUB_OUTPUT
echo "type=docker" >> $GITHUB_OUTPUT
@@ -215,52 +205,24 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- - name: Reconcile cua-driver-rs bump base with Cargo.toml (drift guard)
- if: ${{ inputs.service == 'cua-driver-rs' }}
- run: |
- # Cargo.toml is the single source of truth for the cua-driver-rs
- # version. bump2version keeps a duplicate current_version in
- # .bumpversion.cfg, and that copy has silently drifted before and cut
- # a release at the wrong version (binary reported a stale version,
- # tag could downgrade). Reconcile the cfg to Cargo.toml here, before
- # the dry-run tag-clean and the real bump both read it, so a bump can
- # never start from a stale base again no matter what the committed
- # cfg says.
- cd "${{ steps.package.outputs.directory }}"
- CARGO_VERSION=$(grep -m1 '^version[[:space:]]*=' Cargo.toml | sed -E 's/.*"([^"]+)".*/\1/')
- CFG_VERSION=$(grep -m1 '^current_version[[:space:]]*=' .bumpversion.cfg | sed -E 's/.*=[[:space:]]*//')
- if [ -z "$CARGO_VERSION" ]; then
- echo "::error::could not read version from libs/cua-driver/rust/Cargo.toml"
- exit 1
- fi
- if [ "$CARGO_VERSION" != "$CFG_VERSION" ]; then
- echo "::warning::.bumpversion.cfg current_version ($CFG_VERSION) drifted from Cargo.toml ($CARGO_VERSION); reconciling to Cargo.toml before bump."
- sed -i.bak -E "s/^current_version[[:space:]]*=.*/current_version = ${CARGO_VERSION}/" .bumpversion.cfg
- rm -f .bumpversion.cfg.bak
- fi
- echo "cua-driver-rs bump base: $(grep -m1 '^current_version' .bumpversion.cfg)"
-
- - name: Clean existing tags if present
+ - name: Reject an existing release tag
run: |
- # Function to clean a tag for a given package directory
- clean_tag() {
+ reject_existing_tag() {
local dir=$1
local config_file=${2:-.bumpversion.cfg}
cd "$dir"
NEW_VERSION=$(bump2version --config-file "$config_file" --dry-run --list ${{ inputs.bump_type }} 2>/dev/null | grep -m1 '^new_version=' | sed 's/new_version=//')
TAG_NAME=$(grep -m1 '^tag_name' "$config_file" | sed 's/tag_name *= *//' | sed "s|{new_version}|$NEW_VERSION|")
- echo "Checking for existing tag: $TAG_NAME"
- git tag -d "$TAG_NAME" 2>/dev/null || true
- git push origin ":refs/tags/$TAG_NAME" 2>/dev/null || true
+ if git show-ref --verify --quiet "refs/tags/$TAG_NAME" || \
+ git ls-remote --exit-code --tags origin "refs/tags/$TAG_NAME" >/dev/null 2>&1; then
+ echo "::error::release tag $TAG_NAME already exists; release tags are immutable"
+ exit 1
+ fi
cd - > /dev/null
}
- # Clean tag for the primary package
BUMPVERSION_CONFIG="${{ steps.package.outputs.bumpversion_config }}"
- clean_tag "${{ steps.package.outputs.directory }}" "${BUMPVERSION_CONFIG:-.bumpversion.cfg}"
-
- # No cascade tag cleaning — each package is bumped independently.
- # Dependent packages use version ranges and resolve deps at publish time.
+ reject_existing_tag "${{ steps.package.outputs.directory }}" "${BUMPVERSION_CONFIG:-.bumpversion.cfg}"
- name: Run bump2version
run: |
@@ -271,31 +233,6 @@ jobs:
fi
bump2version $CONFIG_FLAG ${{ inputs.bump_type }}
- - name: Sync Cargo.lock into the cua-driver-rs bump commit
- # bump2version edits only `[workspace.package] version` in Cargo.toml,
- # leaving Cargo.lock's workspace-member versions stale. The next plain
- # `cargo build` anyone runs then re-locks them and diverges from the
- # committed lockfile — which used to break the nix build's cargoHash.
- # Re-lock the members now and fold the change into the bump commit so the
- # lockfile never ships out of sync with the manifest. (cargo is
- # preinstalled on ubuntu runners; `--workspace` touches members only, not
- # registry deps, so this never silently bumps dependencies.)
- if: ${{ inputs.service == 'cua-driver-rs' }}
- run: |
- cd ${{ steps.package.outputs.directory }}
- cargo update --workspace
- if ! git diff --quiet Cargo.lock; then
- TAG=$(git tag --points-at HEAD | head -1)
- git add Cargo.lock
- git commit --amend --no-edit
- # bump2version tagged the pre-amend commit; move the tag onto the
- # amended commit so the release pipeline builds the synced lockfile.
- [ -n "$TAG" ] && git tag -f "$TAG" HEAD
- echo "Re-locked Cargo.lock and moved tag ${TAG:-<none>} to the amended bump commit."
- else
- echo "Cargo.lock already in sync; nothing to fold in."
- fi
-
- name: Collect created tag
id: collect_tags
run: |
@@ -471,22 +408,6 @@ jobs:
echo "npm/playground version: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- - name: Capture bumped lume version
- if: ${{ inputs.service == 'lume' }}
- id: lume_version
- run: |
- VERSION=$(grep -oP 'static let current: String = "\K[^"]+' libs/lume/src/Main.swift)
- echo "lume version: $VERSION"
- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
-
- - name: Capture bumped cua-driver-rs version
- if: ${{ inputs.service == 'cua-driver-rs' }}
- id: cua_driver_rs_version
- run: |
- VERSION=$(grep -m1 -oP '^version = "\K[^"]+' libs/cua-driver/rust/Cargo.toml)
- echo "cua-driver-rs version: $VERSION"
- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
-
- name: Capture bumped cuabot version
if: ${{ inputs.service == 'npm/cuabot' }}
id: cuabot_version
@@ -571,7 +492,6 @@ jobs:
echo "Creating tag via API..."
for tag in $ALL_TAGS; do
echo "Creating tag: $tag"
- gh api -X DELETE /repos/${{ github.repository }}/git/refs/tags/${tag} 2>/dev/null || true
gh api /repos/${{ github.repository }}/git/refs \
-f ref="refs/tags/${tag}" \
-f sha="${COMMIT_SHA}"
diff --git a/.github/workflows/release-on-merge.yml b/.github/workflows/release-on-merge.yml
index 32d803381e..38497d14e6 100644
--- a/.github/workflows/release-on-merge.yml
+++ b/.github/workflows/release-on-merge.yml
@@ -24,15 +24,12 @@ jobs:
- name: Detect packages, release labeled, notify unlabeled
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
+ LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
+ PR_NUMBER: ${{ github.event.pull_request.number }}
+ PR_TITLE: ${{ github.event.pull_request.title }}
+ PR_URL: ${{ github.event.pull_request.html_url }}
+ REPO: ${{ github.repository }}
run: |
- PR_NUMBER="${{ github.event.pull_request.number }}"
- PR_TITLE="${{ github.event.pull_request.title }}"
- PR_URL="${{ github.event.pull_request.html_url }}"
- REPO="${{ github.repository }}"
-
- # Get labels
- LABELS='${{ toJSON(github.event.pull_request.labels.*.name) }}'
-
# Skip everything if no-release
if echo "$LABELS" | grep -q '"no-release"'; then
echo "no-release label found, skipping."
@@ -83,8 +80,6 @@ jobs:
["libs/qemu-docker/android/"]="docker/qemu-android"
["libs/qemu-docker/linux/"]="docker/qemu-linux"
["libs/qemu-docker/windows/"]="docker/qemu-windows"
- ["libs/lume/"]="lume"
- ["libs/cua-driver/rust/"]="cua-driver-rs"
)
# Find all affected services from changed files
diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml
new file mode 100644
index 0000000000..2700e363db
--- /dev/null
+++ b/.github/workflows/release-please.yml
@@ -0,0 +1,82 @@
+name: "Release: Prepare component releases"
+
+on:
+ push:
+ branches:
+ - main
+ workflow_dispatch:
+
+permissions:
+ contents: write
+ pull-requests: write
+
+concurrency:
+ group: release-please-main
+ cancel-in-progress: false
+
+jobs:
+ release-please:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Generate release GitHub App token
+ id: app-token
+ uses: actions/create-github-app-token@v1
+ with:
+ app-id: ${{ secrets.RELEASE_APP_ID }}
+ private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
+ owner: ${{ github.repository_owner }}
+ repositories: ${{ github.event.repository.name }}
+
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ token: ${{ steps.app-token.outputs.token }}
+
+ # release-please-action v4.4.1, embedding release-please ^17.3.0.
+ - name: Open or update release pull requests
+ id: release
+ uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071
+ with:
+ token: ${{ steps.app-token.outputs.token }}
+ config-file: release-please-config.json
+ manifest-file: .release-please-manifest.json
+
+ - name: Synchronize Cua Driver Cargo.lock on its release pull request
+ env:
+ GH_TOKEN: ${{ steps.app-token.outputs.token }}
+ run: |
+ set -euo pipefail
+ while read -r number; do
+ PR=$(gh pr view "$number" --json headRefName,headRepositoryOwner,files)
+ if ! echo "$PR" | jq -e \
+ '.files | any(.path == "libs/cua-driver/rust/VERSION")' >/dev/null; then
+ continue
+ fi
+
+ OWNER=$(echo "$PR" | jq -r '.headRepositoryOwner.login')
+ BRANCH=$(echo "$PR" | jq -r '.headRefName')
+ if [[ "$OWNER" != "${GITHUB_REPOSITORY%/*}" || "$BRANCH" != release-please--branches--* ]]; then
+ echo "Refusing to run release-branch code from $OWNER:$BRANCH"
+ exit 1
+ fi
+
+ git fetch origin "refs/heads/$BRANCH:refs/remotes/origin/$BRANCH"
+ git checkout -B "$BRANCH" "origin/$BRANCH"
+ DRIVER_VERSION=$(tr -d '[:space:]' < libs/cua-driver/rust/VERSION)
+ cargo update --manifest-path libs/cua-driver/rust/Cargo.toml \
+ -p cua-driver --precise "$DRIVER_VERSION"
+ python3 .github/scripts/validate_release_versions.py --product driver
+ git add libs/cua-driver/rust/Cargo.lock
+ if git diff --cached --quiet; then
+ echo "Cargo.lock already matches release PR #$number"
+ continue
+ fi
+ git config user.name "trycua-release[bot]"
+ git config user.email "trycua-release[bot]@users.noreply.github.com"
+ git commit -m "chore(cua-driver-rs): synchronize release lockfile"
+ git push origin "HEAD:$BRANCH"
+ done < <(gh pr list --state open --base main --limit 100 --json number --jq '.[].number')
+
+ - name: Verify repository release versions
+ if: steps.release.outputs.prs_created != 'true'
+ run: python3 .github/scripts/validate_release_versions.py --product all
diff --git a/.github/workflows/release-unreleased-digest.yml b/.github/workflows/release-unreleased-digest.yml
index fe625d0d60..4fc2cf4dc4 100644
--- a/.github/workflows/release-unreleased-digest.yml
+++ b/.github/workflows/release-unreleased-digest.yml
@@ -42,8 +42,6 @@ jobs:
SERVICE_TAG_DIR["docker/qemu-android"]="docker-cua-qemu-android-v|libs/qemu-docker/android/"
SERVICE_TAG_DIR["docker/qemu-linux"]="docker-cua-qemu-linux-v|libs/qemu-docker/linux/"
SERVICE_TAG_DIR["docker/qemu-windows"]="docker-cua-qemu-windows-v|libs/qemu-docker/windows/"
- SERVICE_TAG_DIR["lume"]="lume-v|libs/lume/"
- SERVICE_TAG_DIR["cua-driver-rs"]="cua-driver-rs-v|libs/cua-driver/rust/"
UNRELEASED=""
UNRELEASED_COUNT=0
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
new file mode 100644
index 0000000000..b99a39a650
--- /dev/null
+++ b/.release-please-manifest.json
@@ -0,0 +1,4 @@
+{
+ "libs/cua-driver": "0.8.3",
+ "libs/lume": "0.3.16"
+}
diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 0000000000..9641b31176
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,18 @@
+# Repository agent guidance
+
+## Contributor authorship
+
+Preserve contributor credit when external code or design ships in Cua.
+
+- Merge the contributor's pull request when it can land directly.
+- When moving a commit, use `git cherry-pick -x <sha>` so its author and source
+ commit remain in history.
+- When adapting material parts of a contribution in a new commit, add the
+ contributor with a `Co-authored-by` trailer and write `Salvaged from #<pr>`
+ in the commit or landing pull request body.
+- Preserve known human coauthor trailers during rebases and squash merges.
+- Link the source pull request and tell its author where the work shipped.
+- Honor public credit opt-out requests. Keep security attribution private until
+ disclosure is permitted.
+
+Do not reimplement submitted work solely to remove its authorship history.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 29d7bdc0ce..a7123be12f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -32,6 +32,28 @@ workarounds when known.
5. Run the formatters and linters owned by the changed component.
6. Open a focused pull request that explains behavior, validation, and known gaps.
+Use a Conventional Commit title because the squash-merge title becomes the
+release entry. `fix(driver): preserve input while reconnecting` produces a
+patch release, `feat(lume): add a VM readiness probe` produces a minor release,
+and `feat(driver)!: remove the legacy event endpoint` marks a breaking change.
+Use `docs`, `test`, `ci`, or `chore` when the pull request has no user-facing
+release entry.
+
+## Preserve Contributor Authorship
+
+Keep the original author when external code or design ships in Cua. Merge the
+contributor's pull request when possible. If you move their commit, use
+`git cherry-pick -x <sha>` so the original author and source commit remain in
+history.
+
+If a maintainer adapts material parts of a contribution in a new commit,
+include a `Co-authored-by` trailer with the contributor's GitHub no-reply email
+and link the source pull request in the landing pull request. Use a line such as
+`Salvaged from #123` so release automation can recover the source author.
+Preserve human coauthor trailers during rebases and squash merges. Honor public
+credit opt-out requests and keep security-report attribution private until the
+report can be disclosed.
+
Root pre-commit hooks are optional local helpers. Install them with:
```bash
diff --git a/docs/content/docs/reference/lume/cli-reference.mdx b/docs/content/docs/reference/lume/cli-reference.mdx
index f5a527c3e7..36d585a123 100644
--- a/docs/content/docs/reference/lume/cli-reference.mdx
+++ b/docs/content/docs/reference/lume/cli-reference.mdx
@@ -7,12 +7,12 @@ description: Command Line Interface reference for Lume
AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
Generated by: npx tsx scripts/docs-generators/lume.ts
Source: lume dump-docs --type cli
- Version: 0.3.15
+ Version: 0.3.16
*/}
A lightweight CLI and local API server to build, run and manage macOS VMs.
-Documented against Lume **0.3.15**. Run `lume --version` for your installed version.
+Documented against Lume **0.3.16**. Run `lume --version` for your installed version.
For installation steps, see [Install Lume](/how-to-guides/lume/install-lume).
diff --git a/docs/content/docs/reference/lume/http-api.mdx b/docs/content/docs/reference/lume/http-api.mdx
index 1f40540dbd..f6d89d626d 100644
--- a/docs/content/docs/reference/lume/http-api.mdx
+++ b/docs/content/docs/reference/lume/http-api.mdx
@@ -7,14 +7,14 @@ description: HTTP API reference for Lume server
AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
Generated by: npx tsx scripts/docs-generators/lume.ts
Source: lume dump-docs --type api
- Version: 0.3.15
+ Version: 0.3.16
*/}
import { Tabs, Tab } from 'fumadocs-ui/components/tabs';
HTTP API for managing macOS and Linux virtual machines
-Documented against Lume **0.3.15**. Run `lume --version` for your installed version.
+Documented against Lume **0.3.16**. Run `lume --version` for your installed version.
## Default URL
diff --git a/docs/release-attribution-and-announcements-plan.md b/docs/release-attribution-and-announcements-plan.md
new file mode 100644
index 0000000000..0a2db845f4
--- /dev/null
+++ b/docs/release-attribution-and-announcements-plan.md
@@ -0,0 +1,916 @@
+# Release attribution and announcements plan
+
+- **Status:** Implemented and fixture-proven; merge and first production smoke release remain
+- **Initial products:** Cua Driver and Lume
+- **Audience:** Engineering, developer relations, and release owners
+
+## Summary
+
+We want every Cua Driver and Lume release to publish accurate change notes and credit the people who contributed. The same release data should later produce announcement drafts for X and other channels.
+
+The proposed system uses Release Please as its release foundation. Conventional squash-merge titles provide the change type and user-facing summary. Release Please maintains independent release pull requests, versions, changelogs, tags, and GitHub releases for Cua Driver and Lume. A small Cua-owned step checks contributor credit and writes a machine-readable manifest for release visuals and social drafts.
+
+We will automate facts and formatting first. A release owner will still review editorial summaries, visuals, and social posts before publication.
+
+### Audit outcome
+
+The independent Fable audit returned **REVISE** with high confidence. The overall architecture is sound, but the first draft assumed that Release Please's Rust strategy could update Cua Driver's virtual Cargo workspace and that the existing CD jobs could safely write to a Release Please draft by tag. Neither assumption is safe for this repository without changes.
+
+This revision makes the initial design explicit:
+
+- Treat the Cua Driver release as one product that contains nine Cargo crates.
+- Use Release Please's `simple` strategy for Cua Driver, backed by a small `rust/VERSION` file and a targeted update of `[workspace.package].version`.
+- Regenerate and commit Driver's inherited workspace versions in `Cargo.lock`
+ with `cargo update -p cua-driver --precise <version>`.
+- Pin the Release Please action and test the draft/tag behavior before cutover.
+- Address draft releases by release ID while artifacts are being assembled.
+- Give one finalizer job sole ownership of the release body and draft-to-published transition.
+- Remove every legacy Cua Driver/Lume release trigger during cutover, including the `bump2version` menu entries, label-driven dispatch, reminder, and digest mappings.
+
+### Implementation status (July 17, 2026)
+
+The core repository now contains the proposed Release Please configuration,
+version synchronizer, PR-first attribution collector, manifest schema, release
+body/card/social renderers, draft finalizer, contributor policy, and Driver/Lume
+workflow cutover. The old Driver and Lume bump configs and legacy route mappings
+have been removed. The remaining generic bump workflow rejects existing tags
+instead of deleting them.
+
+Verification includes:
+
+- 50 passing release-script and wiring tests;
+- validation against the pinned Release Please 17.3.0 config and manifest schemas;
+- direct Release Please updater tests for all configured TOML, Python, shell,
+ PowerShell, and Swift version sources;
+- actionlint and YAML parsing for the changed workflows;
+- locked Cargo metadata with all nine Driver workspace packages at `0.8.3` on
+ the checked-in branch and `0.9.0` on the generated fixture release branch;
+- an implementation review and re-audit by Claude Code Fable. The re-audit
+ returned **PASS WITH FOLLOW-UPS**. Its findings about AI coauthors, linked
+ Release Please changelog headings, and GitHub `[bot]` no-reply identities now
+ have regression coverage, and its fixture follow-ups were exercised in the
+ fork rollout.
+
+The fork fixture completed the two-component lifecycle. Release Please created
+separate Lume and Driver release pull requests, exact component tags, and draft
+releases in [successful run #9](https://github.com/f-trycua/cua/actions/runs/29543877375).
+The finalizer was rerun against the same release and retained one
+release ID and one copy of each asset. A transient GitHub 503 was recovered by
+the retry path. The fixture also exposed and fixed a multi-component edge case:
+after one component ships, Release Please can rewrite another component's open
+release pull request. The workflow now resynchronizes every open trusted Driver
+release branch so the generated Cargo.lock commit cannot disappear.
+
+Production history also closes the GitHub App trigger gate. The legacy bump
+workflow uses the same `RELEASE_APP_ID` and `RELEASE_APP_PRIVATE_KEY` as the new
+Release Please workflow. Tags it created as `cua-release-bot[bot]` started the
+existing Driver and Lume tag-push CD workflows, including successful
+[`cua-driver-rs-v0.8.3`](https://github.com/trycua/cua/actions/runs/29458645707)
+and [`lume-v0.3.16`](https://github.com/trycua/cua/actions/runs/29376412794)
+releases.
+
+The implementation is ready for review and merge. After the workflow exists on
+`main`, make `CI: Release metadata / validate` a required check for release
+pull requests. That check prevents a Release Please branch refresh from
+dropping the generated Cargo.lock sync commit before merge. The first real
+Release Please-driven Driver or Lume release remains an end-to-end smoke test.
+The team must also preserve squash-merge titles as the release input for
+product pull requests.
+
+## Why this work is needed
+
+Cua Driver and Lume currently generate GitHub release notes from a path-filtered `git log`. The workflow formats the git author name as a GitHub mention and limits the output to 50 commits.
+
+This causes several problems:
+
+- A git author name is often different from the contributor's GitHub handle.
+- Rebase, squash, and salvage workflows can hide the original pull request author.
+- Coauthors and issue reporters do not receive credit.
+- A 50-commit limit can silently omit changes.
+- Commit subjects vary in quality and often describe implementation work instead of user impact.
+- The release body is Markdown only, so later systems must parse prose to create announcements.
+- Cua Driver and Lume duplicate similar release-note shell code.
+
+The version bump workflow can also delete and recreate remote tags. Published release tags should be immutable. This safety fix should land before the new release-note pipeline.
+
+## What we learned from Hermes and OpenClaw
+
+### Hermes
+
+Hermes generates release notes from commits between tags. Its release script categorizes conventional commits, resolves git authors, reads `Co-authored-by` trailers, prints a contributor section, supports a dry run, and creates a GitHub release.
+
+Hermes also states that contributor authorship should survive when maintainers salvage external work. That policy is worth adopting.
+
+The main cost is identity maintenance. Hermes has a large email-to-GitHub-handle map because git metadata alone cannot consistently identify GitHub contributors. We should avoid making such a map the core of our system.
+
+Hermes occasionally adds a custom release infographic. The `v2026.6.5` Surface Release includes a 1024 by 1024 blueprint-style card with the main features and release statistics. This appears to be an editorial choice for a large release rather than a step used for every release.
+
+### OpenClaw
+
+OpenClaw builds a pull-request-first release manifest from git history and GitHub data. It then checks the human-written release summary against that manifest.
+
+Its process separates two jobs:
+
+1. The generated contribution record proves which pull requests, issues, and contributors shipped.
+2. The editorial sections group that work by user impact.
+
+OpenClaw validates missing pull requests, missing human attribution, invalid issue references, bot credit, duplicate records, and release-body drift. It also renders GitHub release notes from a tag-pinned changelog section.
+
+OpenClaw's full process is larger than we need for two products. We should adopt its PR-first source of truth and validation rules without copying its complete release system.
+
+The OpenClaw checkout was not available under `/Users/administrator/repo` during the local audit. The claims above come from the linked upstream files and must be rechecked against a pinned upstream revision before implementation. The Hermes claims were verified against the local `hermes-agent` checkout.
+
+## Goals
+
+- Credit external pull request authors in every patch, minor, and major release.
+- Preserve known human coauthor credit.
+- Credit issue reporters when their issue directly led to a shipped fix.
+- Use verified GitHub handles instead of names inferred from git metadata.
+- Produce useful, product-specific notes for Cua Driver and Lume.
+- Keep each product's version and release history independent.
+- Generate the GitHub body, changelog entry, contribution record, and release manifest from the same data.
+- Support a reviewed infographic for major releases and selected feature launches.
+- Produce structured data that can later generate X post drafts.
+- Make release generation deterministic and testable.
+
+## Non-goals for the first rollout
+
+- Migrating every package in the monorepo.
+- Automatically posting to X.
+- Generating final editorial prose with no review.
+- Backfilling perfect attribution for every historical release.
+- Building a general marketing automation service in the cloud repository.
+- Copying OpenClaw's full release evidence and multi-platform approval system.
+
+## Proposed release model
+
+### Tool choice
+
+Common release systems solve different parts of this problem:
+
+| System | Common use | Fit for Cua Driver and Lume |
+| --- | --- | --- |
+| GitHub generated release notes | List merged pull requests, contributors, and a compare link; group entries with labels | Useful as a fallback and reference, but it does not own component versions and its release range is repository-wide rather than path-scoped for each product. |
+| Changesets | Collect per-pull-request change files and version packages in JavaScript monorepos | Its change-file model is good, but its package and publish flow centers on package-manager workspaces. Adapting it to a Cargo workspace and Swift executable would add Cua-owned glue. |
+| dist (formerly cargo-dist) | Build and announce Rust applications from package-aware tags; emit a distribution manifest | A possible later improvement for Cua Driver packaging. It does not manage Lume's Swift version or a shared two-component release PR flow. |
+| Release Please | Manage path-scoped components, versions, changelogs, release pull requests, tags, and GitHub releases | Best match. It supports Rust workspaces, a generic version-file strategy for Lume, independent component tags, and monorepo manifest mode. |
+
+Hermes and OpenClaw both built custom systems because they need release behavior beyond these tools. Cua should begin with Release Please and add code only for attribution checks, the social manifest, and visual generation.
+
+### Standard release foundation: Release Please
+
+Use Release Please in manifest mode instead of creating a Cua-specific product catalog. Manifest mode is Release Please's standard monorepo configuration. It defines components by repository path, tracks each component's released version, creates release pull requests, updates version and changelog files, creates component-prefixed tags, and creates GitHub releases.
+
+Release Please fits the two initial products:
+
+- Its `simple` strategy can manage Cua Driver as one product while a targeted TOML updater changes `[workspace.package].version`.
+- A release-PR sync step can run the same `cargo update --workspace` operation the current bump workflow uses, keeping every inherited workspace-member version in `Cargo.lock` aligned.
+- Its `simple` strategy can use Lume's existing `VERSION` file and update `CHANGELOG.md`.
+- Its generic extra-file updater can keep `libs/lume/src/Main.swift` in sync after we add an `x-release-please-version` annotation to the version line.
+- Manifest paths and exclusions isolate the commits considered for Cua Driver and Lume. The Cua Driver scope includes the Rust workspace, shared installer scripts, and Wayland helper, while excluding its separately released Python package, internal docs, and test fixtures.
+- Component-prefixed tags preserve `cua-driver-rs-vX.Y.Z` and `lume-vX.Y.Z`.
+- Separate release pull requests preserve independent release timing.
+
+The built-in `rust` strategy is not the initial choice because `libs/cua-driver/rust/Cargo.toml` is a virtual workspace: it has `[workspace.package]` but no root `[package]`, and all nine members use `version.workspace = true`. The current Release Please Rust updater attempts to update a root `[package].version` and rejects a virtual root. Its Cargo workspace plugin also assumes individually versioned package manifests, which is not Cua Driver's model.
+
+Proposed configuration:
+
+```json
+{
+ "separate-pull-requests": true,
+ "include-component-in-tag": true,
+ "include-v-in-tag": true,
+ "tag-separator": "-",
+ "draft": true,
+ "force-tag-creation": true,
+ "packages": {
+ "libs/cua-driver": {
+ "release-type": "simple",
+ "component": "cua-driver-rs",
+ "package-name": "cua-driver-rs",
+ "version-file": "rust/VERSION",
+ "changelog-path": "rust/CHANGELOG.md",
+ "exclude-paths": [
+ "libs/cua-driver/docs",
+ "libs/cua-driver/python",
+ "libs/cua-driver/tests"
+ ],
+ "extra-files": [
+ {
+ "type": "toml",
+ "path": "rust/Cargo.toml",
+ "jsonpath": "$.workspace.package.version"
+ },
+ {
+ "type": "toml",
+ "path": "python/pyproject.toml",
+ "jsonpath": "$.project.version"
+ },
+ {
+ "type": "generic",
+ "path": "python/src/cua_driver/__init__.py"
+ },
+ {
+ "type": "generic",
+ "path": "scripts/_install-rust.sh"
+ },
+ {
+ "type": "generic",
+ "path": "scripts/install.ps1"
+ }
+ ]
+ },
+ "libs/lume": {
+ "release-type": "simple",
+ "component": "lume",
+ "package-name": "lume",
+ "version-file": "VERSION",
+ "changelog-path": "CHANGELOG.md",
+ "extra-files": [
+ {
+ "type": "generic",
+ "path": "src/Main.swift"
+ },
+ {
+ "type": "generic",
+ "path": "scripts/install.sh"
+ }
+ ]
+ }
+ }
+}
+```
+
+Seed Release Please's version manifest from the current product versions:
+
+```json
+{
+ "libs/cua-driver": "0.8.3",
+ "libs/lume": "0.3.16"
+}
+```
+
+Add `libs/cua-driver/rust/VERSION` during implementation and seed it to the same value as `[workspace.package].version`. A release-PR workflow runs `cargo update -p cua-driver --precise <version>` after Release Please changes those two files. Cargo updates all nine inherited workspace-member versions without resolving unrelated dependencies. The workflow commits the resulting `Cargo.lock` change to the release pull request with the release GitHub App and fails if the version file, Cargo manifest, or lockfile disagree.
+
+The exact configuration was tested in an isolated fork before adoption. The fixture proved that existing tags are detected, component release pull requests remain independent, Rust version files and lockfile update together, Lume's version files stay equal, and draft finalization is idempotent. Production history separately proves that tags created with the Cua release GitHub App token trigger the existing CD workflows.
+
+Pin `googleapis/release-please-action` by commit SHA and record the embedded Release Please version. Do not point `$schema` at the moving `main` branch: the current schema and runtime have drifted on keys such as `component`, `package-name`, and `include-commit-authors`. Either use the schema from the exact embedded Release Please tag after validating it or omit `$schema` and validate the config with that pinned CLI/action in CI.
+
+Use Release Please's default changelog renderer for component releases. Its optional `github` changelog renderer asks GitHub for repository-wide generated notes and does not use Release Please's path-filtered commit list. That would mix unrelated monorepo changes into Cua Driver or Lume notes.
+
+Release Please documents `force-tag-creation` as eager creation of a tag ref when `draft` is enabled; it does not authorize overwriting or moving an existing tag. The fork fixture proved that the pinned version creates the component tag and draft release and leaves the draft unpublished until the finalizer succeeds. Production history proves that App-token-created tags start the existing CD workflows. The first production release should verify the composed path end to end without weakening the immutable-tag or single-finalizer guarantees.
+
+Release Please replaces `bump2version` for these two components when this implementation merges. Other packages remain on the existing workflow.
+
+### Pull request release input
+
+Use Conventional Commit syntax in squash-merge titles instead of adding a custom change-fragment format:
+
+```text
+fix(driver): preserve keyboard input while the driver reconnects
+feat(lume): add a VM readiness probe
+feat(driver)!: remove the deprecated event endpoint
+```
+
+Release Please maps `fix` to a patch, `feat` to a minor, and `!` or a `BREAKING CHANGE` footer to a major. It also supports multiple release entries in one squash commit and a `BEGIN_COMMIT_OVERRIDE` block in the merged pull request body when the original summary needs correction.
+
+Pull requests with no user-facing release entry should use a non-releasing type such as `chore`, `test`, `docs`, or `ci`. We can keep `release-note:none` as a review signal, but Release Please does not need it as release input.
+
+A pull request that changes both products is included in both path-scoped component histories. Release Please scopes work at the commit level, so the same conventional entry and SemVer effect apply to both components. Multiple conventional entries in one squash commit would appear in both changelogs. If the products need different summaries or bump levels, split the work into product-specific pull requests before merge. This is the main limitation to test during the pilot.
+
+### Contributor identity and roles
+
+The collector should use the GitHub pull request as the main identity source. It should record:
+
+- Pull request author
+- Human coauthors with known GitHub handles
+- Reporter of an issue closed by the pull request
+- Pull request number and linked issue numbers
+- Whether each contributor is external or a maintainer
+- Whether this is the person's first credited release for that product, when the system can prove it
+
+Each person can have one or more roles: `author`, `coauthor`, or `reporter`.
+
+The repository should have small configuration lists for known bots, automation accounts, and internal handles. Manual identity overrides should cover exceptional historical or salvaged work only.
+
+### Authorship preservation policy
+
+Cua should adopt this repository policy:
+
+> Contributor credit is preserved. When external code or design is incorporated into Cua, preserve the original git author or record the contributor as a coauthor, and link the source pull request. Do not reimplement submitted work solely to remove its authorship history.
+
+Apply the policy as follows:
+
+- Merge the contributor's pull request when it can land directly.
+- When moving an external commit to another branch or pull request, use `git cherry-pick -x <sha>`. This preserves the original `Author` field and records the source commit.
+- When a maintainer adapts an external commit but keeps most of its implementation, preserve the contributor as the commit author. Add the maintainer as a coauthor when that reflects the work.
+- When a maintainer uses a material part of an external implementation or design in a larger rewrite, add a standard `Co-authored-by: Name <email>` trailer for the contributor.
+- Link the original pull request in the landing pull request and commit body. Close the original pull request with a link to the commit or pull request that shipped the work.
+- Preserve all known human `Co-authored-by` trailers when rebasing, squashing, or moving the work.
+- Credit each person whose code or design materially shaped the shipped change. A bug report without contributed implementation uses the `reporter` role instead of git authorship.
+- Respect a contributor's request to omit public credit. Security reports may need private attribution until disclosure.
+
+Examples:
+
+```text
+# A contributor commit can land with little or no rewriting.
+git cherry-pick -x <contributor-sha>
+```
+
+```text
+# A maintainer commit incorporates material work from an external PR.
+fix(driver): preserve input across reconnects
+
+Adapted from #2345.
+
+Co-authored-by: Alice Example <[email protected]>
+```
+
+The attribution checker should resolve the original pull request reference, author, and coauthors before release. If a landing commit refers to an external source pull request, the corresponding contributor must appear in the release manifest unless the person opted out.
+
+Once the team approves this plan, copy the policy into `CONTRIBUTING.md` and add a repository-level `AGENTS.md` so both humans and coding agents follow the same rule.
+
+### Release manifest
+
+The attribution step writes a manifest after Release Please creates the tag:
+
+```json
+{
+ "schemaVersion": 1,
+ "product": "cua-driver-rs",
+ "displayName": "Cua Driver",
+ "version": "0.8.2",
+ "bump": "patch",
+ "tag": "cua-driver-rs-v0.8.2",
+ "sha": "<release-sha>",
+ "previousTag": "cua-driver-rs-v0.8.1",
+ "compareUrl": "https://github.com/trycua/cua/compare/cua-driver-rs-v0.8.1...cua-driver-rs-v0.8.2",
+ "changes": [
+ {
+ "type": "fix",
+ "summary": "Preserve keyboard input while the driver reconnects.",
+ "pr": 2345,
+ "issues": [2321],
+ "contributors": [
+ { "login": "alice", "role": "author", "external": true },
+ { "login": "bob", "role": "reporter", "external": true }
+ ]
+ }
+ ],
+ "contributors": [
+ { "login": "alice", "roles": ["author"], "external": true },
+ { "login": "bob", "roles": ["reporter"], "external": true }
+ ]
+}
+```
+
+The merged Release Please pull request contains the version and product changelog update, so the tag pins both. After tagging, the attribution step writes the manifest from the exact tag range and release SHA, then attaches it to the GitHub release. The manifest must record the tag and SHA so downstream consumers can reject data from another release.
+
+The release asset remains mutable because a repository writer can replace it or edit the release body. Binding it to the tag and SHA and publishing its checksum makes changes detectable. The first rollout should publish that checksum in the release workflow summary and verify it before publication. A later hardening step can anchor the checksum in an artifact attestation or another append-only record.
+
+Suggested paths and assets:
+
+```text
+libs/cua-driver/rust/CHANGELOG.md
+libs/lume/CHANGELOG.md
+GitHub release asset: release-manifest.json
+```
+
+### GitHub release format
+
+Every release should contain:
+
+```markdown
+# Cua Driver 0.8.2
+
+<optional release visual>
+
+## Summary
+
+One or two sentences about the user outcome.
+
+## Changes
+
+- Preserve keyboard input while the driver reconnects. ([#2345](...)) Thanks @alice; reported by @bob.
+
+## Contributors
+
+Thanks to @alice and @bob for contributing to this release.
+
+## Full changelog
+
+[cua-driver-rs-v0.8.1...cua-driver-rs-v0.8.2](...)
+```
+
+Major and minor releases may split changes into `Highlights`, `Features`, and `Fixes`. Patch releases can use `Fixes` and `Other changes`. Every release gets a contributor section. When there are no external contributors, the section should state that the release contains maintainer changes only.
+
+## Worked examples
+
+The pull request numbers and contributor handles below are illustrative.
+
+### Example 1: Cua Driver patch from an external contributor
+
+An external contributor fixes lost keyboard events during a driver reconnect.
+
+#### Contributor pull request
+
+```text
+Title: fix(driver): preserve keyboard input while the driver reconnects
+Author: @alice
+Files: libs/cua-driver/rust/**
+Closes: #2321, reported by @bob
+```
+
+The pull request is squash-merged. The resulting main-branch commit retains the conventional title and GitHub association with pull request `#2345`.
+
+#### Release Please pull request
+
+Release Please opens or updates:
+
+```text
+chore(main): release cua-driver-rs v0.8.2
+```
+
+The release pull request changes:
+
+```text
+.release-please-manifest.json 0.8.1 -> 0.8.2
+libs/cua-driver/rust/VERSION 0.8.1 -> 0.8.2
+libs/cua-driver/rust/Cargo.toml 0.8.1 -> 0.8.2
+libs/cua-driver/rust/Cargo.lock regenerated by cargo update --workspace
+libs/cua-driver/rust/CHANGELOG.md adds the 0.8.2 section
+```
+
+Its generated changelog section will resemble:
+
+```markdown
+## [0.8.2](https://github.com/trycua/cua/compare/cua-driver-rs-v0.8.1...cua-driver-rs-v0.8.2)
+
+### Bug Fixes
+
+* **driver:** preserve keyboard input while the driver reconnects ([#2345](https://github.com/trycua/cua/pull/2345))
+```
+
+Release Please owns the typed summary and pull request link. It does not prove that a git author name is a verified GitHub handle. The Cua attribution checker adds the verified `@alice` and reporter credit to the final body and manifest from GitHub pull request and issue data.
+
+#### Merge and publication
+
+Merging the release pull request causes Release Please to create:
+
+```text
+Tag: cua-driver-rs-v0.8.2
+GitHub release: draft
+Target SHA: the merged release pull request commit
+```
+
+The Cua Driver CD workflow starts from the tag, builds the platform artifacts, looks up the matching draft by release ID, and uploads assets without changing its body or publication state. The attribution check confirms `@alice` as the pull request author and `@bob` as the linked issue reporter.
+
+#### Final GitHub release body
+
+```markdown
+# Cua Driver 0.8.2
+
+## Summary
+
+This patch preserves keyboard input when the driver reconnects to a running session.
+
+## Fixes
+
+- Preserve keyboard input while the driver reconnects. ([#2345](https://github.com/trycua/cua/pull/2345)) Thanks @alice; reported by @bob in [#2321](https://github.com/trycua/cua/issues/2321).
+
+## Contributors
+
+Thanks to @alice and @bob for contributing to this release.
+
+## Full changelog
+
+[cua-driver-rs-v0.8.1...cua-driver-rs-v0.8.2](https://github.com/trycua/cua/compare/cua-driver-rs-v0.8.1...cua-driver-rs-v0.8.2)
+```
+
+#### Attached release manifest
+
+```json
+{
+ "schemaVersion": 1,
+ "product": "cua-driver-rs",
+ "version": "0.8.2",
+ "tag": "cua-driver-rs-v0.8.2",
+ "sha": "<release-sha>",
+ "changes": [
+ {
+ "type": "fix",
+ "summary": "Preserve keyboard input while the driver reconnects.",
+ "pr": 2345,
+ "issues": [2321],
+ "contributors": [
+ { "login": "alice", "role": "author" },
+ { "login": "bob", "role": "reporter" }
+ ]
+ }
+ ]
+}
+```
+
+#### Generated X draft
+
+```text
+Cua Driver 0.8.2 is out.
+
+This patch preserves keyboard input when the driver reconnects to a running session.
+
+Thanks @alice and @bob for the contribution and bug report.
+
+Release notes: <release-url>
+```
+
+### Example 2: Lume minor release with a release card
+
+A contributor adds resumable VM snapshots. The feature is large enough to warrant a release card.
+
+#### Contributor pull request
+
+```text
+Title: feat(lume): add resumable VM snapshots
+Author: @carol
+Files: libs/lume/**
+Label: release-visual
+```
+
+Release Please opens:
+
+```text
+chore(main): release lume v0.4.0
+```
+
+The release pull request changes:
+
+```text
+.release-please-manifest.json 0.3.16 -> 0.4.0
+libs/lume/VERSION 0.3.16 -> 0.4.0
+libs/lume/src/Main.swift 0.3.16 -> 0.4.0
+libs/lume/CHANGELOG.md adds the 0.4.0 section
+```
+
+The final release body could read:
+
+```markdown
+# Lume 0.4.0
+
+![Lume 0.4.0 release card](<release-card-url>)
+
+## Summary
+
+Lume can now capture a running VM and resume it from the same disk and machine state.
+
+## Features
+
+- Add commands to create, list, restore, and delete VM snapshots. ([#2410](https://github.com/trycua/cua/pull/2410)) Thanks @carol.
+
+## Fixes
+
+- Prevent snapshot restore from reusing a stale guest-agent connection. ([#2417](https://github.com/trycua/cua/pull/2417)) Thanks @dan.
+
+## Contributors
+
+Thanks to @carol and @dan for contributing to Lume 0.4.0.
+
+## Full changelog
+
+[lume-v0.3.16...lume-v0.4.0](https://github.com/trycua/cua/compare/lume-v0.3.16...lume-v0.4.0)
+```
+
+The deterministic release-card template could render this layout:
+
+```text
++------------------------------------------------------+
+| LUME 0.4.0 SNAPSHOT RELEASE |
+| |
+| [ VM ] ----------> [ SAVED SNAPSHOT ] |
+| ^ | |
+| +--------- RESTORE -------+ |
+| |
+| Create and resume snapshots |
+| Safer guest-agent reconnection |
+| |
+| 2 pull requests | 2 contributors | trycua/cua |
++------------------------------------------------------+
+```
+
+The workflow renders the final 1600 by 1600 PNG from the manifest, uploads it to the draft release, inserts the asset URL into the body, and waits for approval before publication.
+
+An X draft could read:
+
+```text
+Lume 0.4.0 adds resumable VM snapshots.
+
+Capture a running VM, restore it later, and keep the same disk and machine state.
+
+Thanks @carol and @dan for the work.
+
+Release notes: <release-url>
+```
+
+### Example 3: One pull request touches both products
+
+Suppose one pull request changes readiness handling in both Cua Driver and Lume:
+
+```text
+Title: fix: wait for guest readiness before accepting commands
+Files:
+ libs/cua-driver/rust/**
+ libs/lume/**
+```
+
+Release Please sees the squash commit in both component paths. It proposes:
+
+```text
+Cua Driver: 0.8.1 -> 0.8.2
+Lume: 0.3.16 -> 0.3.17
+```
+
+Both changelogs receive the same fix summary. The team may merge either release pull request first because they remain separate.
+
+If the Cua Driver change is a new feature while the Lume change is a small compatibility fix, one squash commit cannot express a minor bump for one component and a patch bump for the other. Split the work into two pull requests:
+
+```text
+feat(driver): expose guest readiness state
+fix(lume): wait for the driver readiness state
+```
+
+This keeps Release Please's standard path model accurate and avoids a custom per-product change format.
+
+## Release visuals
+
+### When to create one
+
+- Major release: required
+- Minor release with a release-defining feature: recommended
+- Patch release: omitted unless the patch has an important security, compatibility, or data-safety story
+- Feature launch between releases: allowed when it points to a shipped version
+
+The release owner makes the final call. A `release-visual` label or manifest flag can request one during release preparation.
+
+### Visual content
+
+A release card should include:
+
+- Product name and version
+- A short release title
+- Three to five user-facing changes
+- A product diagram, UI crop, or simple illustration
+- Contributor, pull request, or issue counts when those numbers add context
+- Cua branding and accessible alt text
+
+Use a square master image so the same asset works on GitHub and X. A 1600 by 1600 PNG gives enough resolution; the renderer can also emit a smaller preview.
+
+### Generation method
+
+The first version should use a deterministic SVG or HTML template. The release manifest supplies all text and numbers. Product-specific templates control colors, icons, and layout. This avoids misspelled product names, invented metrics, and distorted contributor handles.
+
+An image model may later create a background illustration or feature art. The template should add all text after image generation. A release owner must review the final image for accuracy, legibility, and brand fit.
+
+### Publishing the visual
+
+The workflow can:
+
+1. Render the image during release preparation.
+2. Save it as a workflow artifact for review.
+3. Create or update a draft GitHub release.
+4. Upload `release-card.png` as a release asset.
+5. Embed the stable asset URL in the release body.
+6. Publish the release after the release owner approves the notes and image.
+
+The X draft should reference the same asset rather than generating a second image.
+
+## Social announcement output
+
+The first social integration should generate a draft artifact. It should not post directly.
+
+The renderer can produce:
+
+- One short X post for patch releases
+- A lead post and optional thread for feature-heavy minor or major releases
+- A plain-text contributor list
+- The release URL and visual asset URL
+- Suggested alt text
+
+Example draft:
+
+```text
+Cua Driver 0.8.2 is out.
+
+This patch preserves keyboard input during driver reconnects.
+
+Thanks @alice and @bob for the contributions.
+
+Release notes: <url>
+```
+
+The draft must fit the platform's current character limits after links and contributor handles are inserted. Platform rules can change, so the posting integration should check them when we implement it.
+
+The cloud repository should consume the release manifest only after the core workflow is stable. Attribution discovery and identity resolution should remain in the core repository, where the pull requests, tags, and changelogs live.
+
+## Release workflow
+
+### Pull request time
+
+1. Detect changes under the two product paths.
+2. Require a Conventional Commit-style pull request title.
+3. Check that the type produces the intended SemVer effect.
+4. Enforce squash merge for these product paths so the pull request title becomes the main-branch commit title.
+5. Use `BEGIN_COMMIT_OVERRIDE` when one pull request needs several changelog entries or a corrected summary.
+6. Preview the future changelog entry in CI.
+
+### Release preparation
+
+1. Run Release Please on `main` with the Cua release GitHub App token.
+2. Let Release Please maintain one release pull request per component.
+3. Review the proposed version, changelog entries, pull requests, and tag name.
+4. Correct a merged pull request body with `BEGIN_COMMIT_OVERRIDE` if needed, then rerun Release Please.
+5. Merge only the component release pull request that is ready to ship.
+6. Let Release Please tag that merge commit and create the GitHub release.
+7. Build the attribution manifest from that exact tag, SHA, component path, and GitHub pull request data.
+8. Fail publication if an eligible human contributor is missing or a bot is thanked.
+9. Render the optional visual and social draft from the verified manifest.
+
+### Publication
+
+1. Let the existing tag-triggered CD workflow build and test the exact tagged commit.
+2. List GitHub releases, include drafts, and match the unique draft by `tag_name`; retain its release ID and upload URL.
+3. Upload packages and checksums by release ID without writing the body, changing the draft flag, or creating a second release. Remove `softprops/action-gh-release` from these two CD paths unless a pinned version is fixture-proven to reuse the same draft safely.
+4. Attach the attribution manifest and optional visual to the same release ID.
+5. Let the **release finalizer job** be the only writer of the final body and the only job allowed to change `draft: true` to published. It waits for all required product artifacts and attribution checks, marks Cua Driver as a prerelease, and allows Lume to become the latest release.
+6. Verify that the release body matches the tag-pinned changelog data and that the manifest tag and SHA match the release target.
+7. Publish the GitHub release and produce the non-blocking social draft artifact.
+
+All jobs that mutate a release use a per-tag concurrency group. During the
+pilot, rendering failures leave the release in draft along with artifact,
+checksum, manifest, attribution, and body-parity failures. We can split optional
+visual generation into a non-blocking job after the first live fixtures prove
+the shared renderer and publishing path.
+
+## Validation rules
+
+The pipeline should fail before publishing when:
+
+- A product-changing pull request title does not follow the agreed Conventional Commit form.
+- A release-producing title has an unsupported type or malformed breaking-change marker.
+- The Release Please version differs from Cua Driver's `rust/VERSION`, `[workspace.package].version`, any workspace-member version in `Cargo.lock`, Lume's `VERSION`, or Lume's source constant.
+- A human external pull request author is missing from the contribution record.
+- A known human coauthor is missing.
+- A landing commit incorporates an external source pull request without preserving its author, recording a coauthor, or carrying the contributor into the release manifest.
+- A bot appears in a contributor thank-you.
+- The same pull request appears more than once.
+- A pull request falls outside the selected tag range.
+- The changelog and manifest disagree.
+- The target tag already exists at a different SHA, or any step attempts to delete, overwrite, or move it. A rerun for the same tag and SHA must be idempotent.
+- Generated release notes exceed GitHub's body limit without a safe compact form.
+
+Tests should cover identity resolution, coauthor parsing, bot filtering, path matching, multi-product pull requests, bump selection, Markdown rendering, JSON schema stability, and deterministic output.
+
+### Required fixture matrix
+
+Run these scenarios in a fork or throwaway branch with the action pinned to the intended commit. Every row is a cutover gate.
+
+| Scenario | Fixture | Pass criteria |
+| --- | --- | --- |
+| Driver patch | Merge `fix(driver): ...` under the driver release scope | `0.8.3` becomes `0.8.4` in the manifest, `rust/VERSION`, Cargo workspace version, lockfile entries, and changelog. |
+| Lume minor | Merge `feat(lume): ...` | `0.3.16` becomes `0.4.0`; `VERSION` and `Main.swift` remain equal in the release pull request. |
+| Pre-1.0 breaking change | Merge `feat(driver)!: ...` | The resulting version matches the team's documented policy: `1.0.0` by default, or `0.9.0` only if `bump-minor-pre-major` is deliberately enabled. |
+| No release | Merge `docs`, `test`, or excluded-path-only changes | No product release pull request is opened or updated. |
+| Installer-only driver change | Change `libs/cua-driver/scripts/**` | The Cua Driver release history includes it; excluded Python/docs/test changes do not trigger the component alone. |
+| Cross-product change | One squash commit touches both component scopes | The entry and bump type appear in both release pull requests; merging either does not disturb the other. |
+| External author and coauthor | Use an external PR author, a human `Co-authored-by` trailer, and linked reporter | Verified handles and roles appear once; missing salvage credit or a thanked bot fails validation. |
+| Tag and draft integration | Merge a release pull request | The tag exists immediately at the release SHA, the release remains draft, and the App-token-created tag triggers CD. |
+| Draft asset upload | Complete CD against that tag | Assets land on the same release ID; no second release appears; the body and draft state remain unchanged. |
+| Failed artifact | Fail one required build | The release remains draft; a rerun uploads assets idempotently and does not duplicate the release. |
+| Publication | Complete every required job | The final body and manifest match the tag and SHA; Cua Driver is prerelease, Lume latest behavior is correct, and the finalizer publishes exactly once. |
+| Legacy coexistence | Merge a PR carrying an old `release:cua-driver-rs` or `release:lume` label during pilot | No legacy `bump2version` release is triggered. |
+
+## Rollout
+
+### Phase 0: Release safety
+
+- Add per-product and per-tag workflow concurrency to both CD workflows.
+- Remove remote tag deletion from `release-bump-version.yml`'s `clean_tag` function and API release path. Do not remove the local rebase-retry bookkeeping while the legacy workflow still exists.
+- Fail when a target tag exists at a different SHA; allow a same-tag/same-SHA rerun to resume safely.
+- Keep Cua Driver and Lume tags independent.
+- Add regression tests for tag behavior.
+
+**Exit condition:** A release tag points to one commit and cannot move through the supported workflow.
+
+### Phase 1: Attribution foundation
+
+- Add `release-please-config.json` and seed `.release-please-manifest.json` with the current versions.
+- Pin `googleapis/release-please-action` by commit SHA and validate the config with its embedded Release Please version.
+- Add `libs/cua-driver/rust/VERSION`, the targeted Cargo workspace update, and the release-PR precise lockfile sync.
+- Configure Lume's existing `VERSION` file and annotated `Main.swift` constant.
+- Add Conventional Commit pull request title validation and enforce squash merges for product-changing pull requests.
+- Add the authorship preservation policy to `CONTRIBUTING.md` and a repository-level `AGENTS.md` after team approval.
+- Run the complete fixture matrix with separate component release pull requests.
+- Prove that the Cua release GitHub App token triggers the existing tag workflows.
+- Build the GitHub attribution checker and JSON manifest renderer.
+- Replace the existing `git log` note generation in both CD workflows.
+
+**Exit condition:** Release Please produces correct release pull requests for both components, and a historical tag-range test produces complete notes with verified GitHub handles.
+
+### Phase 2: Ship through the new path
+
+- Remove Cua Driver and Lume from the service inputs in `release-bump-version.yml`.
+- Remove both path mappings and disable the old `release:lume` and `release:cua-driver-rs` triggers in `release-on-merge.yml`.
+- Update `ci-release-reminder.yml` and `release-unreleased-digest.yml` so neither points these products at the legacy release path.
+- Merge one Release Please release pull request for each component.
+- Replace each `softprops/action-gh-release` creation step with release-ID-based uploads to the Release Please draft.
+- Attach manifests and verify release-body parity.
+- Ship one patch release for each product.
+- Review attribution with the contributors named in those releases.
+
+**Exit condition:** Cua Driver and Lume each publish a release through the new pipeline with no manual identity correction after publication.
+
+### Phase 3: Visual and announcement drafts
+
+- Create one visual template for Cua Driver and one for Lume.
+- Render a release-card preview from the manifest.
+- Add review and approval before attaching the card.
+- Render an X post or thread draft with alt text.
+- Reuse the GitHub release asset in the social draft.
+
+**Exit condition:** A selected minor or major release publishes one reviewed card and produces an approved X draft from the same manifest.
+
+### Phase 4: Broader adoption
+
+- Review the first releases and contributor feedback.
+- Decide whether to include more packages.
+- Add cloud consumption only if another system needs the structured feed.
+- Consider approved posting automation after several successful draft-only releases.
+
+## Proposed defaults for team review
+
+- Use `cua-driver-rs` as the internal release key and `Cua Driver` as the public name.
+- Credit external authors, human coauthors, and directly linked issue reporters.
+- Preserve external authorship through direct merges, `git cherry-pick -x`, or `Co-authored-by` trailers for materially reused work.
+- Keep internal maintainer work in the change record; reserve the public thank-you sentence for external contributors.
+- Use Release Please manifest mode, Conventional Commit squash titles, and GitHub identities.
+- Generate a visual for major releases and selected minor releases.
+- Keep social posting manual during the first rollout.
+- Keep release identity logic in the core repository.
+- Let the release finalizer job publish only after required CD and attribution jobs succeed.
+
+## Decisions and remaining approvals
+
+The implementation records internal maintainers in the manifest and reserves
+the public thank-you sentence for external contributors. It credits reporters
+of explicitly closed same-repository issues. Major releases and pull requests
+with the `release-visual` label request a card. A pre-1.0 breaking change uses
+Release Please's default major bump and therefore advances to `1.0.0`.
+
+The team still needs to decide:
+
+1. Who approves the final release card and social copy?
+2. Where should editable visual templates live, and which team owns brand changes?
+3. Which X account and posting tool would a later approved automation use?
+
+## Success measures
+
+For the first three releases of each product, record:
+
+- Eligible external contributors found versus contributors credited
+- Manual identity corrections needed after generation
+- Pull requests omitted or duplicated
+- Time spent preparing notes
+- Time spent preparing the release visual and social draft
+- Contributor corrections requested after publication
+- Release-body or tag drift detected by validation
+
+The target is complete external contributor credit, zero moved release tags, zero omitted pull requests, and no post-publication identity fixes.
+
+## Definition of done for the initial project
+
+The initial project is complete when:
+
+- Cua Driver and Lume use Release Please manifest mode with separate component release pull requests.
+- Both products generate release notes through Release Please and attribution manifests from GitHub pull request data.
+- Both products publish immutable tags, tag-pinned changelogs, and tag/SHA-bound tamper-evident manifests.
+- Every eligible external author and known coauthor receives credit.
+- Salvaged external work preserves git authorship or an explicit coauthor record and source pull request link.
+- Both CD workflows consume the generated release body.
+- Renderer and validation tests pass in CI.
+- Each product has shipped one release through the new path.
+- One selected feature release has produced a reviewed GitHub release card and X draft.
+
+## References
+
+- [Hermes release script](https://github.com/NousResearch/hermes-agent/blob/main/scripts/release.py)
+- [Hermes v2026.6.5 Surface Release with infographic](https://github.com/NousResearch/hermes-agent/releases/tag/v2026.6.5)
+- [OpenClaw changelog update process](https://github.com/openclaw/openclaw/blob/main/.agents/skills/openclaw-changelog-update/SKILL.md)
+- [OpenClaw changelog attribution checker](https://github.com/openclaw/openclaw/blob/main/scripts/check-changelog-attributions.mjs)
+- [OpenClaw GitHub release-note renderer](https://github.com/openclaw/openclaw/blob/main/scripts/render-github-release-notes.mjs)
+- [Release Please manifest mode](https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md)
+- [Release Please customization and generic version updates](https://github.com/googleapis/release-please/blob/main/docs/customizing.md)
+- [Release Please GitHub Action](https://github.com/googleapis/release-please-action)
+- [GitHub generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes)
+- [Changesets monorepo configuration](https://github.com/changesets/changesets/blob/main/docs/config-file-options.md)
+- [dist release and distribution workflow](https://github.com/axodotdev/cargo-dist)
+- [Current Cua Driver release workflow](../.github/workflows/cd-rust-cua-driver.yml)
+- [Current Lume release workflow](../.github/workflows/cd-swift-lume.yml)
+- [Current version bump workflow](../.github/workflows/release-bump-version.yml)
diff --git a/libs/cua-driver/python/src/cua_driver/__init__.py b/libs/cua-driver/python/src/cua_driver/__init__.py
index 71fd3a2de1..511b52812b 100644
--- a/libs/cua-driver/python/src/cua_driver/__init__.py
+++ b/libs/cua-driver/python/src/cua_driver/__init__.py
@@ -4,7 +4,7 @@ This package provides a thin Python wrapper around the cua-driver Rust binary,
enabling pip-installable access to the MCP server for computer-use automation.
"""
-__version__ = "0.8.3"
+__version__ = "0.8.3" # x-release-please-version
from .wrapper import run_cua_driver, get_binary_path
diff --git a/libs/cua-driver/rust/.bumpversion.cfg b/libs/cua-driver/rust/.bumpversion.cfg
deleted file mode 100644
index c443f1a248..0000000000
--- a/libs/cua-driver/rust/.bumpversion.cfg
+++ /dev/null
@@ -1,18 +0,0 @@
-[bumpversion]
-current_version = 0.8.3
-commit = True
-tag = True
-tag_name = cua-driver-rs-v{new_version}
-message = Bump cua-driver-rs to v{new_version}
-
-[bumpversion:file:Cargo.toml]
-search = version = "{current_version}"
-replace = version = "{new_version}"
-
-[bumpversion:file:../python/pyproject.toml]
-search = version = "{current_version}"
-replace = version = "{new_version}"
-
-[bumpversion:file:../python/src/cua_driver/__init__.py]
-search = __version__ = "{current_version}"
-replace = __version__ = "{new_version}"
diff --git a/libs/cua-driver/rust/VERSION b/libs/cua-driver/rust/VERSION
new file mode 100644
index 0000000000..ee94dd834b
--- /dev/null
+++ b/libs/cua-driver/rust/VERSION
@@ -0,0 +1 @@
+0.8.3
diff --git a/libs/cua-driver/scripts/_install-rust.sh b/libs/cua-driver/scripts/_install-rust.sh
index bbfe24c8a9..4eef039442 100644
--- a/libs/cua-driver/scripts/_install-rust.sh
+++ b/libs/cua-driver/scripts/_install-rust.sh
@@ -501,8 +501,7 @@ done
#
# Version is resolved in priority order:
# 1. CUA_DRIVER_RS_VERSION env var (explicit pin)
-# 2. CUA_DRIVER_RS_BAKED_VERSION below (set automatically by CD after
-# each release — no API call needed)
+# 2. CUA_DRIVER_RS_BAKED_VERSION below (updated in the release PR)
# 3. GitHub Releases API (fallback for dev / un-baked checkouts;
# unauthenticated = 60 req/hr per IP)
#
@@ -512,8 +511,8 @@ done
# API fallback only fires when this script is run from a branch where
# the baked line hasn't been updated yet (dev / pre-release checkouts).
#
-# ~~~ BAKED_VERSION: auto-updated by CD workflow after each release — do not edit ~~~
-CUA_DRIVER_RS_BAKED_VERSION="0.8.3"
+# ~~~ BAKED_VERSION: auto-updated in the release PR — do not edit ~~~
+CUA_DRIVER_RS_BAKED_VERSION="0.8.3" # x-release-please-version
# ~~~ END_BAKED_VERSION ~~~
if [[ -n "${CUA_DRIVER_RS_VERSION:-}" ]]; then
diff --git a/libs/cua-driver/scripts/install.ps1 b/libs/cua-driver/scripts/install.ps1
index 357cd7995c..3bf912ba1d 100644
--- a/libs/cua-driver/scripts/install.ps1
+++ b/libs/cua-driver/scripts/install.ps1
@@ -102,10 +102,9 @@ $TagPrefix = "cua-driver-rs-v"
$BinaryName = "cua-driver.exe"
# Baked-version constant — kept in lock-step with the latest published
-# cua-driver-rs-v* release tag by the CD workflow's bake-version step
+# cua-driver-rs-v* release tag by the Release Please release pull request
# (see .github/workflows/cd-rust-cua-driver.yml). The sentinel-block
-# markers must stay byte-identical to the matching block in install.sh
-# so the CD `sed` command can update both files with one pattern.
+# markers identify this line for Release Please's generic version updater.
#
# Precedence at resolve time: $env:CUA_DRIVER_RS_VERSION > -Release arg >
# this baked value > GitHub Releases API. Baked means the `irm | iex`
@@ -113,8 +112,8 @@ $BinaryName = "cua-driver.exe"
# only consulted as a fallback when this script is run from a branch
# where the baked line hasn't been updated yet.
#
-# ~~~ BAKED_VERSION: auto-updated by CD workflow after each release — do not edit ~~~
-$Script:CuaDriverRsBakedVersion = "0.8.3"
+# ~~~ BAKED_VERSION: auto-updated in the release PR — do not edit ~~~
+$Script:CuaDriverRsBakedVersion = "0.8.3" # x-release-please-version
# ~~~ END_BAKED_VERSION ~~~
# ---------- Path resolution ------------------------------------------------
diff --git a/libs/lume/.bumpversion.cfg b/libs/lume/.bumpversion.cfg
deleted file mode 100644
index a0e8d796ca..0000000000
--- a/libs/lume/.bumpversion.cfg
+++ /dev/null
@@ -1,12 +0,0 @@
-[bumpversion]
-current_version = 0.3.16
-commit = True
-tag = True
-tag_name = lume-v{new_version}
-message = Bump lume to v{new_version}
-
-[bumpversion:file:VERSION]
-
-[bumpversion:file:src/Main.swift]
-search = static let current: String = "{current_version}"
-replace = static let current: String = "{new_version}"
diff --git a/libs/lume/scripts/install.sh b/libs/lume/scripts/install.sh
index 4f59512155..9307305a76 100755
--- a/libs/lume/scripts/install.sh
+++ b/libs/lume/scripts/install.sh
@@ -44,11 +44,11 @@ UPDATE_ON_LOGIN=false
# Release selection:
# LUME_VERSION=0.3.10 pins a specific `lume-v0.3.10` release.
-# LUME_BAKED_VERSION is updated by release automation so the default
+# LUME_BAKED_VERSION is updated in the release PR so the default
# installer path does not need a GitHub API call.
LUME_VERSION="${LUME_VERSION:-}"
-# ~~~ BAKED_VERSION: auto-updated by CD workflow after each release — do not edit ~~~
-LUME_BAKED_VERSION="0.3.16"
+# ~~~ BAKED_VERSION: auto-updated in the release PR — do not edit ~~~
+LUME_BAKED_VERSION="0.3.16" # x-release-please-version
# ~~~ END_BAKED_VERSION ~~~
# Default port for lume serve (default: 7777)
diff --git a/libs/lume/src/Main.swift b/libs/lume/src/Main.swift
index 2533f555e2..6ac85d579f 100644
--- a/libs/lume/src/Main.swift
+++ b/libs/lume/src/Main.swift
@@ -17,7 +17,7 @@ struct Lume: AsyncParsableCommand {
// MARK: - Version Management
extension Lume {
enum Version {
- static let current: String = "0.3.16"
+ static let current: String = "0.3.16" // x-release-please-version
}
}
diff --git a/libs/lume/tests/SipTests.swift b/libs/lume/tests/SipTests.swift
index aad4ef8f46..17f9f2fbbc 100644
--- a/libs/lume/tests/SipTests.swift
+++ b/libs/lume/tests/SipTests.swift
@@ -102,7 +102,8 @@ func sipRecoveryAutomation() async throws {
let verb = state == .off ? "disable" : "enable"
let result = state == .off ? "off" : "on"
#expect(driver.events.contains("type:csrutil \(verb)"))
- #expect(driver.events.contains("text:enter password for user lume:"))
+ let expectedPrompt = state == .off ? "text:enter password for user lume:" : "text:password"
+ #expect(driver.events.contains(expectedPrompt))
#expect(driver.events.contains("key:y") == (state == .off))
#expect(driver.events.contains("text:system integrity protection is \(result)."))
#expect(driver.events.contains("sensitive-input"))
diff --git a/release-please-config.json b/release-please-config.json
new file mode 100644
index 0000000000..bb0992a619
--- /dev/null
+++ b/release-please-config.json
@@ -0,0 +1,63 @@
+{
+ "separate-pull-requests": true,
+ "include-component-in-tag": true,
+ "include-v-in-tag": true,
+ "tag-separator": "-",
+ "draft": true,
+ "force-tag-creation": true,
+ "packages": {
+ "libs/cua-driver": {
+ "release-type": "simple",
+ "component": "cua-driver-rs",
+ "package-name": "cua-driver-rs",
+ "version-file": "rust/VERSION",
+ "changelog-path": "rust/CHANGELOG.md",
+ "exclude-paths": [
+ "libs/cua-driver/docs",
+ "libs/cua-driver/python",
+ "libs/cua-driver/tests"
+ ],
+ "extra-files": [
+ {
+ "type": "toml",
+ "path": "rust/Cargo.toml",
+ "jsonpath": "$.workspace.package.version"
+ },
+ {
+ "type": "toml",
+ "path": "python/pyproject.toml",
+ "jsonpath": "$.project.version"
+ },
+ {
+ "type": "generic",
+ "path": "python/src/cua_driver/__init__.py"
+ },
+ {
+ "type": "generic",
+ "path": "scripts/_install-rust.sh"
+ },
+ {
+ "type": "generic",
+ "path": "scripts/install.ps1"
+ }
+ ]
+ },
+ "libs/lume": {
+ "release-type": "simple",
+ "component": "lume",
+ "package-name": "lume",
+ "version-file": "VERSION",
+ "changelog-path": "CHANGELOG.md",
+ "extra-files": [
+ {
+ "type": "generic",
+ "path": "src/Main.swift"
+ },
+ {
+ "type": "generic",
+ "path": "scripts/install.sh"
+ }
+ ]
+ }
+ }
+}