Skip to content

CJM v0.3.0

Choose a tag to compare

@lmingzhi618 lmingzhi618 released this 22 Jul 02:38

CJM v0.3.0 Release Notes

CJM v0.3.0 is the Practical Type Coverage release.

This release extends the v0.2 Practical Models surface with common JSON object
shapes, fixed-width numeric spellings, and stronger end-to-end verification.

Highlights

  • Adds language-neutral Metadata IR support for string-keyed map fields
  • Supports std::map<std::string, T> and
    std::unordered_map<std::string, T> where T is already in the supported
    practical mapping surface
  • Rejects unsupported map key types before generation
  • Preserves backend independence: the nlohmann backend consumes Metadata IR
    only and does not inspect C++ parser syntax
  • Covers common fixed-width numeric spellings from <cstdint>
  • Adds generated-code compile/run tests for expanded practical types
  • Adds pipeline golden coverage for parser -> semantic -> Metadata IR ->
    nlohmann generation
  • Adds CLI golden coverage for the v0.3 practical fixture

Supported v0.3 Additions

v0.3 builds on the v0.2 model surface.

Newly covered in v0.3:

  • std::map<std::string, T>
  • std::unordered_map<std::string, T>
  • nested supported map value types
  • std::int8_t
  • std::int16_t
  • std::int32_t
  • std::int64_t
  • std::uint8_t
  • std::uint16_t
  • std::uint32_t
  • std::uint64_t
  • composed supported practical types across maps, vectors, optionals, enums,
    aliases, and generated structs

Example:

namespace company::model {

using Sequence = std::uint64_t;

struct Detail {
    std::string source;  // json:"source"
    std::uint32_t shard; // json:"shard"
};

struct Event {
    Sequence sequence; // json:"sequence"
    std::int64_t timestamp_ns; // json:"timestamp_ns"
    Detail detail; // json:"detail"
    std::vector<std::string> tags; // json:"tags"
    std::map<std::string, std::vector<std::uint64_t>> buckets; // json:"buckets"
    std::optional<std::unordered_map<std::string, std::string>> attributes; // json:"attributes,omitempty"
};

} // namespace company::model

Map Semantics

CJM maps supported string-keyed C++ maps to JSON objects with dynamic string
keys.

Supported:

std::map<std::string, int>
std::unordered_map<std::string, std::string>
std::map<std::string, std::vector<std::uint64_t>>
std::optional<std::map<std::string, int>>

Unsupported map key types fail during semantic analysis:

std::map<int, std::string>

Map values must still be part of the documented practical mapping subset.

Verification

v0.3.0 was verified with both the normal build directory and a clean build
directory.

Normal test run:

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

Expected result:

100% tests passed, 0 tests failed out of 19

Clean verification:

cmake -S . -B build-v03-verify
cmake --build build-v03-verify
ctest --test-dir build-v03-verify --output-on-failure

Expected result:

100% tests passed, 0 tests failed out of 19

Architecture dependency checks were also run:

rg -n "frontends/|backends/" src/core
rg -n "frontends/cxx" src/backends
rg -n "backends/nlohmann" src/frontends

These searches produced no architecture violations.

Known Limitations

v0.3.0 remains a documented practical subset.

Not yet supported:

  • arbitrary JSON values
  • std::variant
  • std::any
  • pointer fields
  • polymorphism
  • custom converters
  • enum string mapping policies
  • time and datetime mappings
  • automatic header discovery
  • full C++ grammar support
  • multiline field declarations in the current handwritten parser
  • production parser replacement
  • install/package distribution
  • cross-platform CI release gates

Frontend parser research, including Tree-sitter evaluation, is planned for
v0.3.5.

Dogfooding and adoption documentation are planned after v0.3.0 so that
downstream projects can consume a real release tag.

Tag

Release tag:

v0.3.0

The tag should point to the v0.3.0 release commit on main.