Skip to content

Upgrade Core and Blaze#24

Merged
jviotti merged 2 commits intomainfrom
new-canonicalizer
Apr 16, 2026
Merged

Upgrade Core and Blaze#24
jviotti merged 2 commits intomainfrom
new-canonicalizer

Conversation

@jviotti
Copy link
Copy Markdown
Member

@jviotti jviotti commented Apr 16, 2026

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

@jviotti jviotti force-pushed the new-canonicalizer branch from 218af55 to f29d924 Compare April 16, 2026 19:07
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti force-pushed the new-canonicalizer branch from f29d924 to 3b823fa Compare April 16, 2026 19:11
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti marked this pull request as ready for review April 16, 2026 19:49
@jviotti jviotti merged commit 8ea705e into main Apr 16, 2026
13 checks passed
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 252 files

Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed. cubic prioritises the most important files to review.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/ir/ir.cc">

<violation number="1" location="src/ir/ir.cc:113">
P1: Skipping all descendants under `contains`/`propertyNames` can drop schemas that are still referenced via `$ref`, leading to generated aliases that reference non-emitted types.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/ir/ir.cc

// Skip subschemas under validation-only keywords that do not contribute
// to the type structure (like `contains`)
if (is_validation_subschema(frame, location, walker, resolver)) {
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Skipping all descendants under contains/propertyNames can drop schemas that are still referenced via $ref, leading to generated aliases that reference non-emitted types.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/ir/ir.cc, line 113:

<comment>Skipping all descendants under `contains`/`propertyNames` can drop schemas that are still referenced via `$ref`, leading to generated aliases that reference non-emitted types.</comment>

<file context>
@@ -67,6 +108,12 @@ auto compile(const sourcemeta::core::JSON &input,
 
+    // Skip subschemas under validation-only keywords that do not contribute
+    // to the type structure (like `contains`)
+    if (is_validation_subschema(frame, location, walker, resolver)) {
+      continue;
+    }
</file context>
Fix with Cubic

@jviotti jviotti deleted the new-canonicalizer branch April 16, 2026 19:54
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Apr 16, 2026

🤖 Augment PR Summary

Summary: This PR upgrades the vendored Sourcemeta Core dependency and introduces Sourcemeta Blaze as a new dependency, updating Codegen’s build/packaging and IR pipeline accordingly.

Changes:

  • Updated DEPENDENCIES to a newer Core revision and added a new Blaze dependency (vendored under vendor/blaze).
  • Extended CI and the local Makefile install flow to install Blaze runtime/dev components alongside Core and Codegen.
  • Switched schema canonicalization from sourcemeta::core::alterschema to sourcemeta::blaze::alterschema, and updated CMake packaging to require Blaze’s alterschema component.
  • Added IR support for allOf via a new IRIntersection node and updated the TypeScript generator to emit intersection type aliases.
  • Improved IR compilation by skipping subschemas that are under validation-only keywords (e.g. contains), reducing generation of non-structural types.
  • Updated IR and TypeScript E2E tests to reflect the new allOf/reference behavior and symbol emission.

Technical Notes: This upgrade notably changes the dependency graph (Core no longer provides alterschema here), and introduces a large vendored Blaze subtree that must be compatible with the project’s distribution/licensing expectations.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread cmake/FindBlaze.cmake
@@ -0,0 +1,11 @@
if(NOT Blaze_FOUND)
if(CODEGEN_INSTALL)
set(SOURCEMETA_BLAZE_INSTALL ON CACHE BOOL "enable installation")
Copy link
Copy Markdown

@augmentcode augmentcode bot Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FindBlaze.cmake sets SOURCEMETA_BLAZE_INSTALL, but the vendored Blaze CMake uses BLAZE_INSTALL to gate install rules/components; this looks like CODEGEN_INSTALL may not actually control Blaze’s install behavior as intended.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

"allOf", "title", "description", "default", "deprecated", "readOnly",
"writeOnly", "examples", "unevaluatedProperties", "unevaluatedItems"});

const auto &all_of{subschema.at("allOf")};
Copy link
Copy Markdown

@augmentcode augmentcode bot Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handle_allof doesn’t guard against an empty allOf array; in that case it would return an IRIntersection with no branches, which then causes the TypeScript generator to emit an invalid export type X =\n; definition.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread vendor/blaze/LICENSE
@@ -0,0 +1,12 @@
This software is dual-licensed: you can redistribute it and/or modify it under
Copy link
Copy Markdown

@augmentcode augmentcode bot Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR vendors Blaze under an AGPLv3-or-later / commercial dual license; can you confirm the intended licensing/compliance story for distributing Codegen (and any CI artifacts) with this new vendored dependency?

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant