Skip to content

The agent that grows with you

feat(version): main carries 0.0.0 and dev distance counts from release tags

ethernet9cc319f9a13f
diff --git a/apps/bootstrap-installer/package.json b/apps/bootstrap-installer/package.json
index 3330a894bf3..8817727e290 100644
--- a/apps/bootstrap-installer/package.json
+++ b/apps/bootstrap-installer/package.json
@@ -1,7 +1,7 @@
{
"name": "@hermes/bootstrap-installer",
"private": true,
- "version": "1.0.0",
+ "version": "0.0.0",
"description": "Hermes Setup — signed installer that drives scripts/install.ps1 with a polished native UI.",
"type": "module",
"scripts": {
diff --git a/apps/bootstrap-installer/src-tauri/Cargo.toml b/apps/bootstrap-installer/src-tauri/Cargo.toml
index 834390fb23e..6586140e652 100644
--- a/apps/bootstrap-installer/src-tauri/Cargo.toml
+++ b/apps/bootstrap-installer/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "hermes-bootstrap"
-version = "1.0.0"
+version = "0.0.0"
description = "Hermes Setup — signed installer that drives scripts/install.ps1"
authors = ["Nous Research <[email protected]>"]
edition = "2021"
diff --git a/apps/bootstrap-installer/src-tauri/tauri.conf.json b/apps/bootstrap-installer/src-tauri/tauri.conf.json
index fffa5168261..2dd8379e33d 100644
--- a/apps/bootstrap-installer/src-tauri/tauri.conf.json
+++ b/apps/bootstrap-installer/src-tauri/tauri.conf.json
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Hermes",
- "version": "1.0.0",
+ "version": "0.0.0",
"identifier": "com.nousresearch.hermes.setup",
"build": {
"beforeDevCommand": "npm run dev",
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index af30da8b66b..5676296c5e9 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -2,7 +2,7 @@
"name": "hermes",
"productName": "Hermes",
"private": true,
- "version": "1.0.0",
+ "version": "0.0.0",
"description": "Native desktop shell for Hermes Agent.",
"author": "Nous Research",
"repository": {
diff --git a/package-lock.json b/package-lock.json
index 7d4c852902f..0ceb9e289ff 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -69,7 +69,7 @@
},
"apps/desktop": {
"name": "hermes",
- "version": "1.0.0",
+ "version": "0.0.0",
"dependencies": {
"@assistant-ui/core": "0.2.23",
"@assistant-ui/react": "0.14.24",
diff --git a/pyproject.toml b/pyproject.toml
index a9353b1c3e8..ef617c7a66b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@
[project]
name = "hermes-agent"
-version = "1.0.0"
+version = "0.0.0"
description = "The self-improving AI agent — creates skills from experience, improves them during use, and runs anywhere"
readme = "README.md"
# 3.14 is the newest python we know we have wheels for.
diff --git a/scripts/releases/distance.py b/scripts/releases/distance.py
new file mode 100644
index 00000000000..f9bf51aad48
--- /dev/null
+++ b/scripts/releases/distance.py
@@ -0,0 +1,29 @@
+"""Dev-install version distance, counted from a release tag rather than a claim.
+
+``git describe`` with two tags on one commit is ambiguous: which name it
+returns depends on tagger dates, so the selection here never asks it to
+choose. It lists the reachable tags and keeps the highest final release.
+"""
+from __future__ import annotations
+
+import subprocess
+from pathlib import Path
+
+from scripts.releases.versioning import version_from_tag
+
+
+def _git(repo: Path, *args: str) -> str:
+ return subprocess.check_output(["git", *args], cwd=repo, text=True, encoding="utf-8").strip()
+
+
+def dev_version(repo: Path) -> str:
+ """``<release>+<distance>.g<short>`` from the highest reachable release tag."""
+ tags = [line for line in _git(repo, "tag", "--merged", "HEAD", "--list", "v[0-9]*").splitlines() if line]
+ releases = [version for version in (version_from_tag(tag) for tag in tags) if version]
+ if not releases:
+ raise ValueError("no reachable release tag")
+ version = max(releases, key=lambda value: [int(part) for part in value.split(".")])
+ distance = _git(repo, "rev-list", "--count", f"v{version}..HEAD")
+ if distance == "0":
+ return version
+ return f"{version}+{distance}.g{_git(repo, 'rev-parse', '--short=7', 'HEAD')}"
diff --git a/scripts/releases/stamping.py b/scripts/releases/stamping.py
index 1ae6846af80..bae65b44f1b 100644
--- a/scripts/releases/stamping.py
+++ b/scripts/releases/stamping.py
@@ -14,8 +14,10 @@ from pathlib import Path
def _rewrite(path: Path, pattern: str, replacement: str, *, count: int = 0, flags: int = 0) -> None:
if not path.exists():
return
- text = path.read_text(encoding="utf-8-sig")
- path.write_text(re.sub(pattern, replacement, text, count=count, flags=flags), encoding="utf-8")
+ raw = path.read_bytes()
+ newline = "\r\n" if b"\r\n" in raw else "\n"
+ text = raw.decode("utf-8-sig").replace("\r\n", "\n")
+ path.write_bytes(re.sub(pattern, replacement, text, count=count, flags=flags).replace("\n", newline).encode("utf-8"))
def stamp(tree: Path, version: str, release_date: str) -> list[Path]:
diff --git a/tests/scripts/test_install_stamp_distance.py b/tests/scripts/test_install_stamp_distance.py
new file mode 100644
index 00000000000..1638a093473
--- /dev/null
+++ b/tests/scripts/test_install_stamp_distance.py
@@ -0,0 +1,44 @@
+"""A dev install's distance counts from the highest reachable release, not a prerelease.
+
+Two tags on one commit make plain ``git describe`` ambiguous: it can return the
+``-rc`` name. The distance must come from the highest non-prerelease tag
+reachable from HEAD, so ``v1.4.0-rc`` beside ``v1.4.0`` still reads as ``1.4.0``.
+"""
+import subprocess
+
+import pytest
+
+
+def git(repo, *args):
+ return subprocess.check_output(["git", *args], cwd=repo, text=True, encoding="utf-8").strip()
+
+
+def repo(tmp_path):
+ git(tmp_path, "init", "--initial-branch=main", "--quiet")
+ git(tmp_path, "config", "user.name", "Test")
+ git(tmp_path, "config", "user.email", "[email protected]")
+ (tmp_path / "README").write_text("x\n", encoding="utf-8")
+ git(tmp_path, "add", "README")
+ git(tmp_path, "commit", "--quiet", "-m", "released")
+ released = git(tmp_path, "rev-parse", "HEAD")
+ git(tmp_path, "tag", "-a", "v1.4.0", released, "-m", "release")
+ # The claim is tagged later, so it is the newest tag on the commit and a
+ # plain describe returns its name. The distance must not.
+ git(tmp_path, "tag", "-a", "v1.4.0-rc", released, "-m", "claim")
+ git(tmp_path, "commit", "--allow-empty", "--quiet", "-m", "one")
+ git(tmp_path, "commit", "--allow-empty", "--quiet", "-m", "two")
+ return tmp_path
+
+
+def test_distance_ignores_the_prerelease_tag_on_the_same_commit(repo):
+ from scripts.releases.distance import dev_version
+
+ assert dev_version(repo) == "1.4.0+2.g" + git(repo, "rev-parse", "--short=7", "HEAD")
+
+
+def test_distance_is_zero_on_the_release_commit(repo):
+ from scripts.releases.distance import dev_version
+
+ git(repo, "checkout", "--quiet", "v1.4.0")
+ assert dev_version(repo) == "1.4.0"
diff --git a/uv.lock b/uv.lock
index 08c428d9c99..af1b84427e1 100644
--- a/uv.lock
+++ b/uv.lock
@@ -2009,7 +2009,7 @@ wheels = [
[[package]]
name = "hermes-agent"
-version = "1.0.0"
+version = "0.0.0"
source = { editable = "." }
dependencies = [
{ name = "certifi" },