Files
openapi/hanzo.yml
T
zeekayandHanzo Dev 80ab4245c3 flows: name the six canonical example flows, and gate them
Every Hanzo SDK is supposed to ship the SAME six examples — hello, chat, money,
store, agent, tools. Until now that was six repos independently remembering to
agree, and nothing checked. Nothing could: the flows existed in no manifest, in
no repo, in any language. The TypeScript and Python sets are the first two, and
writing them is what made the gap obvious.

flows.yaml is data only, like sdks.yaml beside it: per flow, the operationIds in
hanzo.yaml in call order, plus why THAT route and not a neighbour. Those choices
are the part worth writing down —

  hello  ai_getAccount, not bot_authMe (bot-service scoped) and not the IAM OIDC
         userinfo endpoint, which is on a different ORIGIN; using it would force
         every example set to know two base URLs, and IAM answers 200 text/html
         for an unregistered path, so a typo there is silent breakage, not a 404.
  tools  automations_mcp, not tasks_tasksMcp: only the former has typed
         request/response schemas, so `method` is a checked enum in every
         generated client instead of a free string.
  store  the data plane (/v1/kv/keys/*), not the provisioning plane (/v1/kv,
         which creates stores) — the two are easy to confuse by name alone.

test_flows.py asserts every id named here still exists in hanzo.yaml. Verified it
fails on a typo, not just passes on the truth:

    FAIL test_every_operation_exists_in_the_spec: flows.yaml names operations
         hanzo.yaml does not have: [('hello', 'ai_getAccount_TYPO')]

So deleting a route breaks ONE gate here rather than six SDKs' examples quietly
and separately.

Also gives this repo a `test:` block, which it did not have. 25 tests lived here
and not one had ever gated a commit — and that is not academic: hanzo.yaml spent
this entire period unable to generate a client in ANY language, because 35
/v1/platform operations carried no `responses` and openapi-generator refuses the
whole document over it. Nothing here noticed, because nothing here ever tried.
hanzo.yaml is the single input to seven language SDKs; a defect merged here is a
defect merged into all seven at once.

    25 passed in 19.99s

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-30 23:13:29 -07:00

42 lines
1.9 KiB
YAML

# Canonical CI config for hanzoai/openapi — read by the hanzoai/ci reusable
# (.hanzo/workflows/cicd.yml) and platform.hanzo.ai.
#
# Publishes the agent-skills catalog (/.well-known/agent-skills, skills.py
# --no-services) as a versioned immutable image whose rootfs is /catalog.
# hanzoai/cloud consumes it via `FROM ... AS skills` + `COPY --from=skills
# /catalog/`, so it never re-runs skills.py inside a cloud release. hanzoai/ci
# pushes to `repo:` (GHCR) and auto-mirrors to registry.hanzo.ai.
images:
- name: agent-skills
context: .
dockerfile: Dockerfile.skills
repo: ghcr.io/hanzoai/agent-skills
test:
- name: spec
# This repo had 25 tests and no `test:` block, so none of them had ever
# gated a commit. They matter more here than in most repos: hanzo.yaml is
# the single input to SEVEN language SDKs, so a defect merged here is a
# defect merged into all seven at once, discovered seven separate times.
#
# It is not hypothetical. hanzo.yaml spent this whole period unable to
# generate ANY client in ANY language — 35 /v1/platform operations carried
# no `responses`, which OAS 3.x requires and openapi-generator refuses the
# entire document over. Nothing in this repo noticed, because nothing in
# this repo ever tried.
#
# test_flows.py is the new one: it asserts every operationId named in
# flows.yaml still exists in hanzo.yaml, so deleting a route breaks one gate
# here instead of six SDKs' examples quietly and separately.
#
# uv rather than a bare python3 — the arc runner image promises no
# interpreter, let alone one with PyYAML.
run: |
set -e
if command -v uv >/dev/null 2>&1; then UV=uv; else
curl -fsSL https://astral.sh/uv/install.sh | sh
UV="$HOME/.local/bin/uv"
fi
"$UV" run --no-project --python 3.12 --with pyyaml --with pytest \
python -m pytest test_audit.py test_skills.py test_flows.py -q