Skip to content

Release 1.25.0

Choose a tag to compare

@reid-spencer reid-spencer released this 01 Jul 00:53

What's New

Features

  • JSON input method for RIDDL models — A new, correct-by-construction
    way to build a RIDDL model from a structured JSON document, as an
    alternative to parsing RIDDL surface text. RiddlLib.parseJson(json, origin) maps the JSON onto the RIDDL AST, applies RIDDL's required
    type-expression defaults, and returns a Root that the standard passes
    validate and PrettifyPass renders as guaranteed-valid .riddl text.
    A companion RiddlLib.validateRoot(root) validates an already-built
    Root without round-tripping through text. This is intended for
    programmatic and AI-assisted generation: a producer emits JSON (a format
    it handles reliably, and one that supports schema-constrained decoding)
    and RIDDL guarantees the model is well-formed.

    The JSON schema covers the entire RIDDL language — every definition
    (domains, contexts, entities, all processors: adaptors, streamlets with
    inlets/outlets/connectors, projectors, repositories with schemas,
    relationships; sagas, modules and subdomains, epics/use-cases with all
    twelve interaction kinds, and UI groups/inputs/outputs), every type
    expression, the full statement language, functions and methods, and rich
    metadata (descriptions, glossary terms, options, author references,
    attachments, comments). References are emitted as path identifiers and
    resolved by the standard passes, so undefined references surface as normal
    validation errors. The whole path is Native-safe (no I/O; upickle
    cross-compiled for JVM, JS, and Native).

    On the JavaScript/TypeScript side, RiddlAPI.parseJson(json, origin) is
    exposed and documented in index.d.ts. The JSON schema is documented in
    JSON_INPUT.md, with example models under riddlLib/json-examples/, and
    a coverage ledger (JSON_COVERAGE.md) enforced by an automated guard test
    that fails the build if a new AST construct lacks JSON support.

Bug Fixes

  • Prettify rendered outputs with a duplicated verbOutput UI
    elements were emitted as invalid RIDDL (e.g. output displays X displays "...") because the prettifier combined Output.identify (which already
    includes the verb alias) with the verb alias again. Outputs now render as
    output X displays "..." and re-parse correctly.

Internal

  • Deduplicated RiddlLib's validation-result handling (validateString,
    validateStringQuick, validateRoot, and validateIncremental now share
    common helpers). No behavior change.
  • All additions are backward-compatible: no public API was removed or
    changed; parseJson, validateRoot, and the JSON package are new.