mirror of
https://github.com/hanzo-cpp/sdk.git
synced 2026-11-20 19:55:32 +00:00
This repo carried a refusal — the seam, the CI gates and the template overrides,
but no client, because no openapi-generator 7.14.0 C++ generator emitted a tree
that compiled from hanzo.yaml. That was true and is no longer.
WHAT CHANGED, in the order it mattered:
* openapi-generator 7.24.0 instead of 7.14.0. The 10 translation units the
previous measurement could not fix were two defects in the generator's own
Java type resolution, and mustache cannot reach either — it interpolates the
strings resolution produces, it cannot recompute a type. 9 TUs were
`additionalProperties: {$ref: <array-typed schema>}` dropping the aliased
array's element type (`std::map<utility::string_t, std::vector>`, never
valid C++); 1 was an integer-backed enum declared over utility::string_t and
defined over int32_t. Both are fixed upstream in 7.24.0. The floor is stated
once, in scripts/generate.sh, with the measurement — a row in sdks.yaml says
one version for EVERY language, and raising the fleet pin would rewrite
every other client's committed output.
* The four template overrides re-derived from 7.24.0 stock rather than merged
onto it, so a future bump re-derives them again. 7.24.0 fixed two of the
five defect classes the 7.14.0 overrides carried; it also has two of its own
in the enum path, both template-shaped: isPrimitiveType and isEnum are not
exclusive, so an integer-backed enum declared its setter twice and defined
it once, and the conversion helpers disagreed between header and source.
* -DmaxYamlCodePoints. hanzo.yaml crossed snakeyaml's 3145728 code-point
ceiling (3,654,449 at spec 1bac13f) and the failure does not say so: the
parser logs SnakeException, silently falls through to the SWAGGER 2.0 compat
reader, and dies with "Issues with the OpenAPI input", which reads like a
malformed spec. The document validates at 0 errors and 0 warnings. This is
fleet-wide, so it is also set in hanzoai/openapi's generate.py, once, where
every language picks it up.
WHAT IS HERE NOW: include/hanzo (2377 headers, 264 API classes, 2103 models) and
src (2376 sources), the hanzo::hanzo CMake target with its install/export set,
and the six canonical flows from hanzoai/openapi's flows.yaml — hello, chat,
money, store, agent, tools — each compiled by the examples gate, resolving
HANZO_API_KEY / HANZO_BASE_URL / HANZO_ORG_ID in ONE place rather than six.
The generator's CMakeLists.txt and Config.cmake.in are dropped before the tree
lands: the target name, the export set and HANZO_BUILD_EXAMPLES are this repo's
contract with a consumer, not a generator artifact.
CI is wired and UNEXERCISED — hanzoai/ci defaults to the hanzo-build-linux-amd64
arc pool, which has zero registered runners, so a run queues rather than
executes. Every number above is from a clean-clone local build on aarch64
Ubuntu 24.04, g++ 13.3, cmake 3.28.3, cpprestsdk 2.10.19, against
hanzoai/openapi@1bac13fb75.
16 lines
747 B
CMake
16 lines
747 B
CMake
# The six canonical flows — the same journeys in every Hanzo SDK, named and
|
|
# ordered by hanzoai/openapi's flows.yaml. An example that does not compile is
|
|
# worse than no example, so CI builds all six; what they print is this
|
|
# language's business, which routes they call is not.
|
|
#
|
|
# hanzo_examples is the ONE place the environment resolves — key, base URL, org
|
|
# — so no flow reads getenv itself.
|
|
add_library(hanzo_examples STATIC hanzo.cpp)
|
|
target_include_directories(hanzo_examples PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
target_link_libraries(hanzo_examples PUBLIC hanzo::hanzo)
|
|
|
|
foreach(flow hello chat money store agent tools)
|
|
add_executable(${flow} ${flow}/main.cpp)
|
|
target_link_libraries(${flow} PRIVATE hanzo_examples)
|
|
endforeach()
|