chore(release): bump ACP Registry assets in lockstep with pyproject
Some checks failed
Deploy Site / deploy-vercel (push) Waiting to run
Deploy Site / deploy-docs (push) Waiting to run
Docker Build and Publish / build-amd64 (push) Waiting to run
Docker Build and Publish / build-arm64 (push) Waiting to run
Docker Build and Publish / merge (push) Blocked by required conditions
Docker Build and Publish / move-main (push) Blocked by required conditions
Docker Build and Publish / move-latest (push) Blocked by required conditions
Lint (ruff + ty) / ruff + ty diff (push) Waiting to run
Lint (ruff + ty) / ruff enforcement (blocking) (push) Waiting to run
Lint (ruff + ty) / Windows footguns (blocking) (push) Waiting to run
Nix / nix (macos-latest) (push) Waiting to run
Nix / nix (ubuntu-latest) (push) Waiting to run
OSV-Scanner / Scan lockfiles (push) Waiting to run
Tests / test (push) Waiting to run
Tests / e2e (push) Waiting to run
uv.lock check / uv lock --check (push) Waiting to run
Nix Lockfile Fix / auto-fix-main (push) Has been cancelled
Nix Lockfile Fix / fix (push) Has been cancelled

The ACP Registry manifest (acp_registry/agent.json), the npm launcher
package.json, and the launcher's HERMES_AGENT_VERSION constant must all
match pyproject.toml exactly — tests/acp/test_registry_manifest.py
enforces this lockstep.

Without a release-script hook, the next weekly version bump fails that
test until someone hand-edits four files. Extend update_version_files()
to drive the ACP bump alongside __init__.py and pyproject.toml, and
add tests covering the lockstep and the missing-files no-op path.

Also map adam.manning@gmail.com -> am423 for the salvage commit.
This commit is contained in:
teknium1 2026-05-14 20:15:37 -07:00 committed by Teknium
parent 4c94396206
commit d364132114
2 changed files with 206 additions and 0 deletions

View file

@ -21,6 +21,7 @@ Usage:
"""
import argparse
import json
import re
import shutil
import subprocess
@ -33,6 +34,13 @@ REPO_ROOT = Path(__file__).resolve().parent.parent
VERSION_FILE = REPO_ROOT / "hermes_cli" / "__init__.py"
PYPROJECT_FILE = REPO_ROOT / "pyproject.toml"
# ACP Registry assets that must stay version-locked with pyproject.toml.
# tests/acp/test_registry_manifest.py enforces this lockstep, so the release
# bump touches all four files atomically.
ACP_REGISTRY_MANIFEST = REPO_ROOT / "acp_registry" / "agent.json"
ACP_NPM_PACKAGE_JSON = REPO_ROOT / "packages" / "hermes-agent-acp" / "package.json"
ACP_NPM_LAUNCHER = REPO_ROOT / "packages" / "hermes-agent-acp" / "bin" / "hermes-agent-acp.js"
# ──────────────────────────────────────────────────────────────────────
# Git email → GitHub username mapping
# ──────────────────────────────────────────────────────────────────────
@ -56,6 +64,7 @@ AUTHOR_MAP = {
"jeremy@geocaching.com": "outdoorsea",
"leone.parise@gmail.com": "leoneparise",
"mr@shu.io": "mrshu",
"adam.manning@gmail.com": "am423",
"buraysandro9@gmail.com": "ygd58",
"yanglongwei06@gmail.com": "Alex-yang00",
"teknium@nousresearch.com": "teknium1",
@ -1153,6 +1162,44 @@ def update_version_files(semver: str, calver_date: str):
)
PYPROJECT_FILE.write_text(pyproject)
# Update ACP Registry manifest + npm launcher (must stay version-locked
# with pyproject — enforced by tests/acp/test_registry_manifest.py).
_update_acp_registry_versions(semver)
def _update_acp_registry_versions(semver: str) -> None:
"""Bump the ACP Registry manifest, npm package, and launcher in lockstep.
Skips silently if any of the files are missing the ACP Registry assets
landed mid-cycle and older release branches may not have them.
"""
if ACP_REGISTRY_MANIFEST.exists():
manifest = json.loads(ACP_REGISTRY_MANIFEST.read_text(encoding="utf-8"))
manifest["version"] = semver
npx = manifest.get("distribution", {}).get("npx", {})
if "package" in npx:
npx["package"] = f"@nousresearch/hermes-agent-acp@{semver}"
# Preserve trailing newline + 2-space indent the file already uses.
ACP_REGISTRY_MANIFEST.write_text(
json.dumps(manifest, indent=2) + "\n", encoding="utf-8"
)
if ACP_NPM_PACKAGE_JSON.exists():
package = json.loads(ACP_NPM_PACKAGE_JSON.read_text(encoding="utf-8"))
package["version"] = semver
ACP_NPM_PACKAGE_JSON.write_text(
json.dumps(package, indent=2) + "\n", encoding="utf-8"
)
if ACP_NPM_LAUNCHER.exists():
launcher = ACP_NPM_LAUNCHER.read_text(encoding="utf-8")
launcher = re.sub(
r"const HERMES_AGENT_VERSION\s*=\s*'[^']+';",
f"const HERMES_AGENT_VERSION = '{semver}';",
launcher,
)
ACP_NPM_LAUNCHER.write_text(launcher, encoding="utf-8")
def build_release_artifacts(semver: str) -> list[Path]:
"""Build sdist/wheel artifacts for the current release.