Skip to content

feat(wren-mdl): loosen manifest schema and bump layout version to 4 - #2501

Merged
douenergy merged 2 commits into
mainfrom
feat/mdl-schema-loosen-properties
Jul 15, 2026
Merged

feat(wren-mdl): loosen manifest schema and bump layout version to 4#2501
douenergy merged 2 commits into
mainfrom
feat/mdl-schema-loosen-properties

Conversation

@goldmedal

@goldmedal goldmedal commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

What

A new MDL layout revision (v4): additive, backward-compatible annotation fields on the manifest schema, plus the matching supported-layout-version bump.

Schema (core/wren-mdl/mdl.schema.json)

  1. Widen column.properties value types to string | number | boolean | object | array | null, matching model / relationship / view (column was string-only — an inconsistency).
  2. Add optional manifest-level description + properties.
  3. Add model.uniqueKeys (a column or list of columns, like primaryKey).
  4. Add optional description + properties to cube measure / cubeDimension / timeDimension.

Layout version (core/wren-core-base)

  • Bump MAX_SUPPORTED_LAYOUT_VERSION 3 → 4 and add the no-op migrate_v3_to_v4 step — matching the precedent of v2 (optional dialect) and v3 (composite primaryKey), both additive no-op migrations.

Why

Give natively-typed homes for human/agent descriptions, business context, and uniqueness metadata — useful for knowledge annotations and semantic-layer interop — instead of forcing everything through opaque string bags.

Compatibility

All changes are additive or validation-widenings; existing manifests stay valid and v3→v4 is a no-op. No query-engine / semantic-logic changes: the manifest structs don't set #[serde(deny_unknown_fields)], so unknown fields were already ignored — the only Rust delta is the version const + the no-op migration + tests. wren-core-base: 46 tests + clippy + fmt clean locally.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for descriptions on measures, cube dimensions, and time dimensions.
    • Added model-level description plus flexible model properties and expanded custom property value types.
    • Added uniqueKeys support for both single-column and composite uniqueness definitions.
  • Compatibility / Maintenance
    • Extended manifest layout version support to version 4 and added migration handling for 3 → 4.
    • Updated tests to verify the 3 → 4 layout version migration behavior.

Widen column.properties value types to match model/relationship/view, and
add optional annotation fields: manifest-level description + properties,
model.uniqueKeys, and description + properties on cube
measure/cubeDimension/timeDimension. All additive and backward-compatible.

These give natively-typed homes for descriptions, business context, and
uniqueness metadata (e.g. semantic-layer interop and knowledge annotations)
without touching the Rust engine: the manifest structs don't set
deny_unknown_fields, so unknown fields are ignored on deserialization.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the core label Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The MDL schema now supports richer custom-property values, adds descriptions and root metadata, defines single-column or composite model unique keys, and introduces layout version 4 validation with a no-op migration from version 3.

Changes

MDL schema and versioning

Layer / File(s) Summary
Metadata fields and flexible properties
core/wren-mdl/mdl.schema.json
Column, measure, cube dimension, time dimension, and root manifest properties accept multiple JSON value types; descriptions, root metadata, and single-column or composite model unique keys are added.
Layout version 4 validation and migration
core/wren-core-base/src/mdl/manifest.rs, core/wren-core-base/src/mdl/migration.rs
Manifest validation accepts layout version 4, and migration from version 3 to 4 updates the version without transforming manifest content; a unit test covers the transition.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: wwwy3y3, douenergy

Poem

I’m a rabbit with schema keys,
Hopping through richer metadata trees.
Version four joins the burrow bright,
Old manifests change their tag just right.
With flexible fields and unique keys,
MDL grows among the trees.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main changes: schema loosening and a layout version bump to 4.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mdl-schema-loosen-properties

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.

The schema loosening in the previous commit is a new MDL layout revision,
matching the precedent of v2 (optional dialect) and v3 (composite primaryKey),
both additive no-op migrations. Bump MAX_SUPPORTED_LAYOUT_VERSION to 4 and add
the no-op v3->v4 migration step so migrate_manifest stamps it correctly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the rust Pull requests that update rust code label Jul 14, 2026
@goldmedal goldmedal changed the title feat(wren-mdl): loosen manifest schema for optional annotations feat(wren-mdl): loosen manifest schema and bump layout version to 4 Jul 14, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
core/wren-core-base/src/mdl/migration.rs (1)

145-151: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Exercise representative v4 fields in the migration test.

The test currently verifies only layoutVersion; include descriptions, nested properties, and composite uniqueKeys to ensure the no-op migration preserves the new metadata and richer JSON values.

🤖 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-core-base/src/mdl/migration.rs` around lines 145 - 151, Expand
test_migrate_v3_to_v4 with representative v4 input fields, including a
description, nested properties, and composite uniqueKeys. After
migrate_manifest, assert these metadata and nested JSON values remain unchanged
alongside the existing layoutVersion assertion, verifying the no-op migration
preserves richer v4 content.
🤖 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.

Nitpick comments:
In `@core/wren-core-base/src/mdl/migration.rs`:
- Around line 145-151: Expand test_migrate_v3_to_v4 with representative v4 input
fields, including a description, nested properties, and composite uniqueKeys.
After migrate_manifest, assert these metadata and nested JSON values remain
unchanged alongside the existing layoutVersion assertion, verifying the no-op
migration preserves richer v4 content.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d9e5685d-017f-4666-bd3d-356720127414

📥 Commits

Reviewing files that changed from the base of the PR and between b215a87 and 0cc7608.

📒 Files selected for processing (2)
  • core/wren-core-base/src/mdl/manifest.rs
  • core/wren-core-base/src/mdl/migration.rs

@goldmedal
goldmedal requested a review from douenergy July 15, 2026 02:38
@douenergy
douenergy merged commit 283d089 into main Jul 15, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants