Skip to content

v0.5.2 - Recursive Schema and Runtime Foundation

Latest

Choose a tag to compare

@lmingzhi618 lmingzhi618 released this 04 Aug 03:26
· 46 commits to main since this release

CJM v0.5.2 Release Notes

CJM v0.5.2 is the Recursive Schema and Runtime Foundation release.

This release extends the JSON Schema backend over recursive Metadata IR type
shapes and completes the design/test foundation needed before high-performance
runtime backend implementation begins.

It remains part of the v0.5 line because it does not add a new JSON runtime
backend. The next runtime implementation work can now start from documented
semantics, conformance shape, and static backend selection rules.

Highlights

  • Adds recursive JSON Schema fragment generation for supported schema(T)
    combinations
  • Represents std::optional<T> in JSON Schema through anyOf with schema(T)
    and null
  • Verifies recursive type closure across Metadata IR, nlohmann generated
    mappings, generated model-contract descriptors, and JSON Schema output
  • Verifies supported multiline field declarations through the Tree-sitter
    frontend and semantic pipeline
  • Adds the runtime JSON semantic profile for future runtime backends
  • Adds the decode error and structured path model
  • Sketches the runtime conformance fixture layout
  • Adds static backend selection design for future CLI/CMake runtime backend
    selection

Schema Coverage

JSON Schema output now supports recursive schema fragments for the existing
supported type surface:

  • std::vector<T> and std::array<T, N> using recursive schema(T)
  • std::optional<T> using anyOf with recursive schema(T) and null
  • std::map<std::string, T> and std::unordered_map<std::string, T> when T
    has a supported recursive schema mapping
  • enum and enum class fields nested inside supported containers
  • generated struct fields nested inside supported containers
  • optional enum, generated struct, and container fields

This keeps JSON Schema generation aligned with Metadata IR instead of treating
containers, optionals, enums, and generated structs as isolated one-level cases.

Runtime Foundation

The release adds design contracts for future runtime backends:

  • runtime JSON semantic profile
  • decode error and structured path model
  • conformance fixture layout
  • static backend selection

The key backend-selection decision is static selection:

generation time or build time

not dynamic runtime plugin dispatch.

Future runtime C++ backend selection should use a dedicated JSON backend concept
such as:

cjm_generate(
    TARGET app
    HEADERS user.hpp
    JSON_BACKEND simdjson
)

Artifact requests such as JSON Schema generation remain separate from runtime
backend selection.

Known Limitations

Not yet supported:

  • simdjson, Glaze, yyjson, or other high-performance runtime backends
  • runtime JSON Schema validation
  • automatic header discovery
  • arbitrary dynamic JSON values
  • std::variant
  • std::any
  • pointer fields
  • polymorphism
  • custom converters
  • custom enum string mapping policies
  • default-value metadata
  • time and datetime mappings
  • private fields
  • native JSON backend
  • install/package distribution

Verification

The v0.5.2 release was verified locally with:

ctest --test-dir build --output-on-failure

Expected result:

100% tests passed, 0 tests failed out of 32

Coverage includes:

  • recursive schema backend golden tests
  • recursive nlohmann generated compile tests
  • recursive generated model-contract tests
  • multiline Tree-sitter frontend and semantic tests
  • runtime conformance fixture skeleton checks
  • existing CLI, CMake, parser, semantic, schema, contract, and generated compile
    tests

Tag

Release tag:

v0.5.2