Skip to content

feat(wasm): full Cube support — validate, translate, PyO3, CLI, WASM, docs#2282

Merged
PaulChen79 merged 13 commits into
mainfrom
feat/wasm-cube
May 15, 2026
Merged

feat(wasm): full Cube support — validate, translate, PyO3, CLI, WASM, docs#2282
PaulChen79 merged 13 commits into
mainfrom
feat/wasm-cube

Conversation

@goldmedal
Copy link
Copy Markdown
Collaborator

@goldmedal goldmedal commented May 15, 2026

Summary

This PR lands complete Cube support across the Wren Engine stack — from Rust core to Python CLI to WASM browser SDK — plus JSON Schema alignment and full user-facing documentation.

Phases included

PR Phase Description
#2264 A — Validation validate_cubes() in AnalyzedWrenMDL::analyze — cycle detection for derived measures (self-ref + transitive), orphaned baseObject, duplicate names
#2265 B — SQL Translator cube_query_to_sql() in wren-core — resolves measures (transitive closure), time-dimension granularity (DATE_TRUNC/DATE_FORMAT), filters, ORDER BY, LIMIT
#2276 C — Cleanup Phase B nit-fixes: regex::NoExpand for $ in SQL, pre-compiled patterns map, pub(crate) module visibility
#2277 D/E — PyO3 + CLI + Memory #[pyfunction] cube_query_to_sql binding; wren cube list/describe/query Typer CLI; LanceDB memory indexing for cubes/measures/dimensions
#2278 F — WASM Browser SDK WrenEngine.cubeQuery() + WrenEngine.listCubes() + TypeScript types; interactive HTML examples
#2280 G — Skills & Docs wren-usage skill v2.3 (cube workflow + aggregation decision tree); docs/core/guides/modeling/cube.md; CLI reference section; README quick-start
#2281 — Schema mdl.schema.json alignment: metricscubes, measure/cubeDimension/timeDimension $defs, layoutVersion, dual-case dataSource enum

Key capabilities shipped

  • wren cube list — table of cubes with measure/dimension counts
  • wren cube describe <name> — full measure/dimension/time-dimension details
  • wren cube query --cube … --measures … --dimensions … --time-dimension … --filter … — structured pre-aggregation query with granularity + filters, no manual GROUP BY
  • cubeQuery() / listCubes() — WASM browser API for the same functionality
  • Cycle detection — self-referential and transitive derived-measure cycles raise clear errors at load_mdl time
  • Memory indexingwren memory index now includes cubes for semantic schema retrieval

Breaking changes

  • mdl.schema.json: metrics array removed; replaced by cubes with measures, dimensions, timeDimensions, hierarchies. Consumers validating against the schema must migrate.
  • dataSource enum now accepts both UPPERCASE and lowercase aliases (backward-compatible in Rust via serde aliases; schema now reflects both).

Test plan

  • cargo test --lib --tests --bins in core/wren-core — 9 cube validation tests + 33 cube translator tests pass
  • just test-py in core/wren-core-py — PyO3 binding smoke tests pass
  • just test in core/wren — unit tests including cube CLI + context validation pass
  • wren cube list / describe / query against a real DuckDB project
  • Open core/wren-core-wasm/examples/cube-quickstart.html and cube-explorer.html in browser
  • Validate a cube YAML project with wren context validate

Related PRs (merged into feat/wasm-cube)

#2264 · #2265 · #2276 · #2277 · #2278 · #2280 · #2281


🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added Cube pre-aggregations and structured cube query APIs across CLI, Python bindings, and WASM SDK; CSV ingestion via registerCsv; new CLI commands to list/describe/query cubes; interactive browser demos and examples.
  • Documentation

    • New cube modeling guide, CLI reference, quickstarts, agent guidance, and README/skill updates covering cube workflows.
  • Tests

    • Expanded unit/integration tests for cube SQL generation, CLI, SDK, CSV ingestion, manifest validation, and error cases.
  • Chores

    • Manifest/schema extended and project scaffold updated to include cubes.

Review Change Stack

goldmedal and others added 7 commits May 14, 2026 09:25
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation python Pull requests that update Python code rust Pull requests that update rust code core wasm skills labels May 15, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds Browser/WebAssembly SDK docs and examples: updates SDK overview, introduces a full wasm SDK guide (install, Quickstart modes, API reference for registerCsv/cubeQuery/listCubes), integration patterns, demos, troubleshooting, compatibility, and limitations.

Changes

WASM SDK docs & examples

Layer / File(s) Summary
SDK overview entries
docs/core/sdk/overview.md
Adds Browser/WebAssembly and Pydantic AI entries to the SDK overview list.
WASM SDK intro & differences
docs/core/sdk/wasm.md
Introduces the wren-core-wasm SDK and a section comparing runtime/data-source/connection differences vs other SDKs.
Installation & Quickstart workflows
docs/core/sdk/wasm.md
Adds npm/CDN install instructions and documents three Quickstart workflows: URL (remote Parquet), inline registration (JSON/CSV/Parquet), and cube-query mode.
API reference (registerCsv, cubeQuery, listCubes)
docs/core/sdk/wasm.md
Documents WrenEngine API surface including registerCsv options/types, cubeQuery, listCubes, and behavior by profile.source.
Integration patterns & bundler guidance
docs/core/sdk/wasm.md
Describes bundler .wasm handling, multiple engines per page, and using listCubes/cubeQuery for agent integrations.
Examples, demos, and local serve commands
docs/core/sdk/wasm.md
Documents shipped browser demos and how to build/serve them locally.
Troubleshooting, compatibility, and limitations
docs/core/sdk/wasm.md
Adds troubleshooting symptom/cause/fix table, compatibility notes (packaging format and browser requirements), and lists SDK limitations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Canner/WrenAI#2281: Overlaps on MDL schema changes (cubes/layoutVersion/dataSource enum).
  • Canner/WrenAI#2277: Related end-to-end cube plumbing (translator bindings, CLI, memory indexing).
  • Canner/WrenAI#2264: Related MDL validation wiring (validate_cubes) and analysis integration.

Suggested reviewers

  • douenergy
  • onlyjackfrost

"I hopped through manifests, docs, and demos bright,
Registered CSVs and lit the wasm night,
I nudged the guide, the examples sing,
Cubes now bloom where metrics bring,
A rabbit cheers — docs polished just right."

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly describes the main feature: adding full Cube support across multiple components (validation, SQL translation, PyO3 bindings, CLI, WASM, and documentation).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/wasm-cube

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@goldmedal goldmedal changed the title feat(cube): full Cube support — validate, translate, PyO3, CLI, WASM, docs (Phases A–G) feat(cube): full Cube support — validate, translate, PyO3, CLI, WASM, docs May 15, 2026
@goldmedal goldmedal changed the title feat(cube): full Cube support — validate, translate, PyO3, CLI, WASM, docs feat(wasm): full Cube support — validate, translate, PyO3, CLI, WASM, docs May 15, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Nitpick comments (1)
core/wren-mdl/mdl.schema.json (1)

224-265: 💤 Low value

Verbose but explicit enum covers both uppercase and lowercase data sources.

The enum explicitly lists both uppercase canonical form and lowercase aliases for all 24 data sources (48 total values). While verbose, this ensures exact validation and clear documentation of accepted values. The duplication is a tradeoff for explicitness.

If JSON Schema supported case-insensitive enums, a single list would suffice. Given that limitation, the current approach is acceptable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/wren-mdl/mdl.schema.json` around lines 224 - 265, The enum under the
data source type currently duplicates each provider in both uppercase and
lowercase; remove the lowercase entries and keep only the canonical uppercase
names in the "enum" array, and add a single case-insensitive regex check to
allow lowercase inputs by adding a "pattern" (e.g.
"(?i)^(?:BIGQUERY|CLICKHOUSE|CANNER|TRINO|MSSQL|MYSQL|DORIS|POSTGRES|SNOWFLAKE|DATAFUSION|DUCKDB|LOCAL_FILE|S3_FILE|GCS_FILE|MINIO_FILE|ORACLE|ATHENA|REDSHIFT|DATABRICKS|SPARK)$")
alongside the enum (using "anyOf" or "allOf") so validation accepts any case
while keeping documentation and the canonical enum values intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/wren-core-wasm/examples/cube-explorer.html`:
- Around line 201-202: The code uses label.innerHTML to insert unescaped
cube/data-driven values (id, item.name, item.type) which risks XSS; replace the
innerHTML interpolation with safe DOM construction and textContent assignments:
create the checkbox input element with its id/value set via setAttribute or
element.id/value, append a text node for item.name and a span element for
item.type (setting span.textContent and style via style.*), then append those
nodes to container (keep using container.appendChild(label)). Apply the same
replacement pattern for the other occurrences that interpolate untrusted data
(the blocks at ~216-226, 295-297, 317, 386) so all dynamic values use
textContent/element properties instead of innerHTML.

In `@core/wren-core-wasm/examples/cube-quickstart.html`:
- Around line 50-55: The renderTable function and the nearby error/result
rendering inject unescaped HTML into the page; update renderTable to build DOM
elements or escape all cell values before concatenating (use
document.createElement for table/thead/tbody/tr/th/td and set textContent) and
change the error/result rendering (the code around the current error/result
innerHTML assignments) to assign user-provided strings via textContent or
escaped text rather than innerHTML so table cell values and error strings cannot
inject scripts.

In `@core/wren-core-wasm/README.md`:
- Line 106: Update the README table row for "CDN smoke test" to replace the term
"published wheel" with a more accurate npm/browser term such as "published
package" or "published bundle"; locate the table row containing "CDN smoke test
| http://localhost:8787/examples/test-cdn.html | Loading the published wheel
from unpkg" and change the trailing cell to read "Loading the published package
from unpkg" (or "published bundle") so the artifact terminology reflects the
JavaScript/npm distribution rather than a Python wheel.

In `@core/wren-core/core/src/mdl/cube.rs`:
- Around line 162-200: The validate_query function currently only checks that
referenced measures/dimensions exist but doesn't ensure the query projects
anything; if query.measures, query.dimensions, and query.time_dimensions are all
empty it will produce invalid SQL like "SELECT  FROM ...". Update validate_query
(taking CubeQuery as input) to check that at least one of query.measures,
query.dimensions, or query.time_dimensions is non-empty and return a
plan_err!("Query must select at least one measure, dimension, or timeDimension
in cube '{}'", query.cube) (or similar) when all three are empty so invalid
SELECTs are rejected early.
- Around line 353-357: The date_range bounds (td_filter.date_range -> start/end)
are interpolated directly into SQL via col and where_parts, allowing
quote-breaking input; change this to avoid raw interpolation by either using
parameterized query placeholders or escaping the bounds before embedding:
replace the direct format!() uses that push "{col} >= '{start}'" / "{col} <
'{end}'" with code that binds start/end as SQL parameters or runs a safe escape
function on start/end (e.g., replace single quote with doubled single quote) so
the values cannot break the SQL string while still using the same
time_dim_map[col].expression and where_parts push locations.
- Around line 398-427: In filter_to_sql, add explicit validation for
operator/value shapes: for operators that require a scalar value
(FilterOperator::Eq, Neq, Gt, Gte, Lt, Lte) return plan_err! when f.value is
None instead of generating e.g. "col = NULL"; check the
Some(FilterValue::Scalar(_)) shape (or equivalent) before calling quote_value;
for FilterOperator::In and FilterOperator::NotIn ensure f.value is
Some(FilterValue::List(items)) and that items is non-empty, returning plan_err!
on missing or empty lists rather than emitting "IN ()"/"NOT IN ()"; keep using
quote_value when mapping item values and preserve existing match arms in
filter_to_sql to locate changes.

In `@docs/core/guides/modeling/cube.md`:
- Around line 117-121: The two statements conflict: the phrase "Only the
transitive closure of measures actually requested by the query is resolved"
should be clarified to distinguish runtime substitution behavior from schema
validation during MDL analysis; update the text to explicitly say that while
substitution and resolution at query time only walk the transitive closure of
requested measures, cycle detection for measures is performed earlier during MDL
analysis and will cause the cube to be rejected/validated as invalid even if the
cycle is not referenced by a particular query. Replace or augment the phrases
"transitive closure of measures actually requested by the query" and "cycle
validation happens during MDL analysis" with a single clear sentence that
describes both behaviors and their order (MDL validation first, query-time
resolution second).

---

Nitpick comments:
In `@core/wren-mdl/mdl.schema.json`:
- Around line 224-265: The enum under the data source type currently duplicates
each provider in both uppercase and lowercase; remove the lowercase entries and
keep only the canonical uppercase names in the "enum" array, and add a single
case-insensitive regex check to allow lowercase inputs by adding a "pattern"
(e.g.
"(?i)^(?:BIGQUERY|CLICKHOUSE|CANNER|TRINO|MSSQL|MYSQL|DORIS|POSTGRES|SNOWFLAKE|DATAFUSION|DUCKDB|LOCAL_FILE|S3_FILE|GCS_FILE|MINIO_FILE|ORACLE|ATHENA|REDSHIFT|DATABRICKS|SPARK)$")
alongside the enum (using "anyOf" or "allOf") so validation accepts any case
while keeping documentation and the canonical enum values intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 36bdc201-308a-49ea-ae3f-6aadfdf890ae

📥 Commits

Reviewing files that changed from the base of the PR and between 6732d97 and a11179b.

📒 Files selected for processing (36)
  • README.md
  • core/wren-core-py/src/cube.rs
  • core/wren-core-py/src/lib.rs
  • core/wren-core-py/tests/test_cube.py
  • core/wren-core-wasm/AGENT_GUIDE.md
  • core/wren-core-wasm/README.md
  • core/wren-core-wasm/examples/cube-explorer.html
  • core/wren-core-wasm/examples/cube-quickstart.html
  • core/wren-core-wasm/examples/serve.mjs
  • core/wren-core-wasm/sdk/src/index.ts
  • core/wren-core-wasm/sdk/src/wren_core_wasm.d.ts
  • core/wren-core-wasm/sdk/tests/index.test.mjs
  • core/wren-core-wasm/src/lib.rs
  • core/wren-core/core/src/mdl/cube.rs
  • core/wren-core/core/src/mdl/lineage.rs
  • core/wren-core/core/src/mdl/mod.rs
  • core/wren-mdl/mdl.schema.json
  • core/wren/README.md
  • core/wren/src/wren/cli.py
  • core/wren/src/wren/context.py
  • core/wren/src/wren/context_cli.py
  • core/wren/src/wren/cube_cli.py
  • core/wren/src/wren/memory/schema_indexer.py
  • core/wren/tests/unit/test_context.py
  • core/wren/tests/unit/test_cube_cli.py
  • core/wren/tests/unit/test_memory.py
  • docs/core/get_started/quickstart.md
  • docs/core/guides/modeling/cube.md
  • docs/core/guides/modeling/overview.md
  • docs/core/reference/cli.md
  • skills/index.json
  • skills/versions.json
  • skills/wren-generate-mdl/SKILL.md
  • skills/wren-usage/SKILL.md
  • skills/wren-usage/references/memory.md
  • skills/wren-usage/references/wren-sql.md

Comment thread core/wren-core-wasm/examples/cube-explorer.html Outdated
Comment thread core/wren-core-wasm/examples/cube-quickstart.html
Comment thread core/wren-core-wasm/README.md Outdated
Comment thread core/wren-core/core/src/mdl/cube.rs
Comment thread core/wren-core/core/src/mdl/cube.rs
Comment thread core/wren-core/core/src/mdl/cube.rs
Comment thread docs/core/guides/modeling/cube.md Outdated
- Escape dateRange bounds via quote_string() to defeat SQL injection
  (wren-core/cube.rs).
- Reject empty CubeQuery projections (no measures/dimensions/timeDimensions)
  that would emit invalid SELECT.
- Reject invalid filter shapes per operator: scalar ops require a scalar
  value (not None, not list); in/not_in require a non-empty list.
- Escape dynamic HTML in cube-quickstart.html and cube-explorer.html
  to prevent XSS in the WASM demo pages.
- README: "published wheel" → "published package" (npm artifact, not Python).
- docs/cube.md: clarify cycle detection runs at MDL analyze time even though
  runtime substitution walks only the requested measures' closure.

Adds 6 new tests covering the validation paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@goldmedal goldmedal requested a review from PaulChen79 May 15, 2026 02:00
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label May 15, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/wren-core-wasm/src/lib.rs`:
- Around line 244-249: register_csv currently proceeds to create a MemTable from
the collected `batches` without validating they contain data; add the same
empty-batches guard used in `register_json` and `register_parquet` by checking
the collected `batches` (and/or that all batches have zero rows) after
`reader.collect::<Result<Vec<_>, _>>()` and return a `JsError::new("Empty CSV:
no batches found")` (or similar) before calling `MemTable::try_new` so empty
CSVs are rejected early; reference `register_csv`, the `batches` variable, and
`MemTable::try_new` when making the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7f2ec492-92d1-4d9c-bd51-60671d5b4aa4

📥 Commits

Reviewing files that changed from the base of the PR and between 15a5950 and d189a79.

⛔ Files ignored due to path filters (3)
  • core/wren-core-wasm/examples/data/orders.csv is excluded by !**/*.csv
  • core/wren-core-wasm/examples/data/products.tsv is excluded by !**/*.tsv
  • core/wren-core-wasm/examples/data/region_targets.csv is excluded by !**/*.csv
📒 Files selected for processing (9)
  • core/wren-core-wasm/AGENT_GUIDE.md
  • core/wren-core-wasm/Cargo.toml
  • core/wren-core-wasm/README.md
  • core/wren-core-wasm/examples/csv-quickstart.html
  • core/wren-core-wasm/examples/serve.mjs
  • core/wren-core-wasm/sdk/src/index.ts
  • core/wren-core-wasm/sdk/src/wren_core_wasm.d.ts
  • core/wren-core-wasm/sdk/tests/index.test.mjs
  • core/wren-core-wasm/src/lib.rs
✅ Files skipped from review due to trivial changes (2)
  • core/wren-core-wasm/Cargo.toml
  • core/wren-core-wasm/AGENT_GUIDE.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/wren-core-wasm/sdk/src/wren_core_wasm.d.ts

Comment thread core/wren-core-wasm/src/lib.rs
goldmedal and others added 3 commits May 15, 2026 11:06
Mirror the empty-batches guard already in register_json (line 107) and
register_parquet (line 145). A header-only CSV or a blank file would
otherwise create a MemTable with zero batches, which leads to confusing
downstream behaviour. Caught by CodeRabbit on PR #2282.

Adds a Rust wasm-bindgen test plus a Node SDK test covering the
header-only case.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts:
#	docs/core/sdk/overview.md
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/core/sdk/wasm.md (1)

49-49: 💤 Low value

Consider using a version placeholder or latest.

The hardcoded version @0.3.0 will become outdated as new releases are published. Consider using @latest or a placeholder like @VERSION, and add a note directing users to check npm for the current version.

📝 Suggested alternatives

Option 1 - Use latest:

-  import { WrenEngine } from 'https://unpkg.com/@wrenai/wren-core-wasm@0.3.0/dist/index.js';
+  import { WrenEngine } from 'https://unpkg.com/@wrenai/wren-core-wasm@latest/dist/index.js';

Option 2 - Add a note:

   import { WrenEngine } from 'https://unpkg.com/@wrenai/wren-core-wasm@0.3.0/dist/index.js';
+  // Check https://www.npmjs.com/package/@wrenai/wren-core-wasm for the latest version
 </script>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/core/sdk/wasm.md` at line 49, The import line using a hardcoded version
for WrenEngine (import { WrenEngine } from
'https://unpkg.com/@wrenai/wren-core-wasm@0.3.0/dist/index.js';) should be
updated to use a version placeholder or `@latest` to avoid becoming outdated;
change the module specifier to use '@latest' or a template like '@VERSION' and
add a short note below explaining users should check npm (or the package
changelog) for the current release and replace the placeholder accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/core/sdk/wasm.md`:
- Line 85: The MDL example includes an invalid field "metrics" which isn't
defined in mdl.schema.json (schema uses additionalProperties: false); remove the
"metrics: []" entry from the example so the object only contains allowed keys
(e.g., keep relationships and views but drop metrics) to prevent validation
errors.

---

Nitpick comments:
In `@docs/core/sdk/wasm.md`:
- Line 49: The import line using a hardcoded version for WrenEngine (import {
WrenEngine } from
'https://unpkg.com/@wrenai/wren-core-wasm@0.3.0/dist/index.js';) should be
updated to use a version placeholder or `@latest` to avoid becoming outdated;
change the module specifier to use '@latest' or a template like '@VERSION' and
add a short note below explaining users should check npm (or the package
changelog) for the current release and replace the placeholder accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 191b22a2-abaf-4cc0-8708-3f0364072250

📥 Commits

Reviewing files that changed from the base of the PR and between afeea29 and 1eba023.

📒 Files selected for processing (3)
  • docs/core/guides/modeling/cube.md
  • docs/core/sdk/overview.md
  • docs/core/sdk/wasm.md
✅ Files skipped from review due to trivial changes (1)
  • docs/core/guides/modeling/cube.md

Comment thread docs/core/sdk/wasm.md Outdated
PR #2281 renamed the top-level `metrics` array to `cubes` and the JSON
schema is `additionalProperties: false`, so a stray `metrics: []` fails
schema validation (the Rust deserializer silently ignores unknown
fields, which is why nothing broke at runtime). Sweep every MDL example
in docs, examples/, README, AGENT_GUIDE, and test fixtures to match the
current schema. CodeRabbit on PR #2282.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@PaulChen79 PaulChen79 merged commit 026111e into main May 15, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation python Pull requests that update Python code rust Pull requests that update rust code skills wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants