Files
zooqueenandHanzo Dev fb2ed33d11 Regenerate the client and move the examples to the classes it has
The 09-06 regeneration renamed AgentsApi and ToolsApi to AgentApi and ToolApi
and the examples kept the old names, so examples-build failed on main. hanzoai/ci
gates a client-lane move on that same test, so every release dispatch since has
stopped before regenerating and the jar stayed at 8.5.156, a client with no
postDecisions.

The client is regenerated from the document api.hanzo.ai serves
(hanzo-inc/cloud 151878a3c, sha256 00564264), which now namespaces its schemas
(AgentAgentView, ProvisioningProvisionRequest, ToolToolList) and types chat
completions, so the examples are rewritten against it: agent, store and tools
use the new names and paths, and chat sends a prompt and prints the reply
instead of a status. .spec-lock is left to the lane, whose next move records the
ref it was handed.

hanzo.yml now names where the version lives, scripts/version, so the cut
rewrites build.gradle to the release number and the push to main publishes it
through release.yml; without it the cut tagged a build.gradle Central already
served and nothing published. The README names the 8.5 line (8.5.+, [8.5,8.6))
rather than a patch, because each release cuts a patch into build.gradle alone,
and scripts/readme checks the line instead of a number that goes stale.

Co-authored-by: Hanzo Dev <[email protected]>
2026-10-04 13:51:55 -07:00

35 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
# README.md prints the coordinate a reader pastes, so the version it names has
# to be one this build publishes. It named 8.5.89, which Maven Central never
# served, while Central served 8.5.156.
#
# It names the RELEASE LINE, not the patch: every cloud release cuts a patch
# into build.gradle and nothing else, so a README pinned to a patch is stale
# from the next release on. Gradle's `X.Y.+` and Maven's `[X.Y,X.Y+1)` both
# resolve the newest patch of the line build.gradle is on.
set -eu
cd "$(dirname "$0")/.."
want=$(./scripts/version)
[ -n "$want" ] || { echo "no version in hanzo-java-cloud/build.gradle" >&2; exit 1; }
line=${want%.*}
major=${line%.*}; minor=${line#*.}
gradle="$line.+"
maven="[$line,$major.$((minor + 1)))"
named=$(grep -oE 'ai\.hanzo:hanzo-java-cloud:[0-9][0-9A-Za-z.+-]*' README.md | sed 's/.*://' | sort -u)
[ "$named" = "$gradle" ] || { echo "README.md names ai.hanzo:hanzo-java-cloud:$(echo $named); this build publishes the $gradle line" >&2; exit 1; }
versions=$(grep -oE '<version>[^<]+</version>' README.md | sed -E 's#</?version>##g' | sort -u)
[ "$versions" = "$maven" ] || { echo "README.md's Maven <version> is $(echo $versions); this build publishes $maven" >&2; exit 1; }
echo "README.md names $gradle and $maven, the line of $want"
# Every API class a README snippet names is one this build generates. The
# quickstart called KeysApi and ModelsApi, which neither this tree nor any
# published jar has had, so the first thing a reader pasted did not compile.
api=hanzo-java-cloud/src/main/java/ai/hanzo/cloud/api
missing=$(grep -oE '\b[A-Z][A-Za-z0-9]*Api\b' README.md | sort -u | while read -r class; do
[ -f "$api/$class.java" ] || printf ' %s' "$class"
done)
[ -z "$missing" ] || { echo "README.md names$missing; $api has no such class" >&2; exit 1; }
echo "README.md names only generated API classes"