aaif-goose/goose · error · SystemExit

rust_version must look like 0.1.0 or 0.1.0-alpha.0

Error message

rust_version must look like 0.1.0 or 0.1.0-alpha.0

What it means

SystemExit raised by the bump-version recipe in crates/goose-sdk/justfile when the rust_version argument fails the regex ^(\d+)\.(\d+)\.(\d+)(-alpha\.(\d+))?$ . The recipe validates before rewriting version lines across the SDK crates, because the version string is also converted to a Python-style version (0.1.0-alpha.3 -> 0.1.0a3).

Source

Thrown at crates/goose-sdk/justfile:124

        goose-providers \
        goose-agent \
        goose-context-management \
        goose-sdk; do \
        cargo publish -p "$crate" $dry_run_flag --allow-dirty; \
    done

bump-version rust_version:
    #!/usr/bin/env bash
    set -euo pipefail
    python3 - "{{rust_version}}" <<'PY'
    import re
    import sys
    from pathlib import Path

    rust_version = sys.argv[1]
    match = re.fullmatch(r"(\d+)\.(\d+)\.(\d+)(?:-alpha\.(\d+))?", rust_version)
    if not match:
        raise SystemExit("rust_version must look like 0.1.0 or 0.1.0-alpha.0")

    major, minor, patch, alpha = match.groups()
    python_version = f"{major}.{minor}.{patch}" if alpha is None else f"{major}.{minor}.{patch}a{alpha}"

    crate_names = [
        "goose-provider-types",
        "goose-sdk-types",
        "goose-download-manager",
        "goose-local-inference",
        "goose-providers",
        "goose-agent",
        "goose-context-management",
        "goose-sdk",
    ]
    crate_paths = {name: Path("crates") / name / "Cargo.toml" for name in crate_names}

    def replace_unique(path: Path, pattern: str, replacement: str) -> None:
        text = path.read_text()

View on GitHub (pinned to 3810898a74)

Solutions

  1. Use exactly MAJOR.MINOR.PATCH, e.g. just bump-version 0.2.0
  2. For pre-release use only the alpha form: just bump-version 0.2.0-alpha.0
  3. Strip any 'v' prefix or whitespace before passing the argument
  4. If you need -beta/-rc releases, extend the regex in the justfile first

Example fix

# before
just bump-version v0.2.0
just bump-version 0.2.0-rc.1

# after
just bump-version 0.2.0
just bump-version 0.2.0-alpha.0
Defensive patterns

Strategy: validation

Validate before calling

import re, sys
if not re.fullmatch(r"(\d+)\.(\d+)\.(\d+)(-alpha\.(\d+))?", sys.argv[1] if len(sys.argv) > 1 else ""):
    raise SystemExit("version must be X.Y.Z or X.Y.Z-alpha.N")

Type guard

def is_valid_rust_version(v: str) -> bool:
    import re
    return re.fullmatch(r"\d+\.\d+\.\d+(-alpha\.\d+)?", v) is not None

Prevention

When it happens

Trigger: Running 'just bump-version <version>' from crates/goose-sdk with a malformed version: 'v1.2.3' (v prefix), '1.2' (missing patch), '1.2.3-beta.1' (beta not supported), '1.2.3-alpha' (missing alpha number), or trailing whitespace/garbage.

Common situations: Copy-pasting a git tag (v-prefix) into the command; using -dev or -rc suffixes that the recipe never supported; assuming arbitrary semver prerelease strings are allowed.

Related errors


AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16). Data as JSON: /api/errors/5347f3a4a0cd510c. Report an issue: GitHub.