Skip to content

Classify widget BSON drift after .mpk upgrade #570

@ako

Description

@ako

Parent: #540 (v0.11.0 workflow integration)

Goal

When a project's `.mpk` widget package is upgraded, classify the BSON-level impact of the schema change so authors know whether they need to open Studio Pro to repair widgets or whether mxcli can patch them automatically.

Background

#540 listed this as work:

Classify widget BSON drift after a `.mpk` upgrade (additive-safe vs needs Studio Pro intervention)

It wasn't delivered with #540's diagnostics/completion work — this is closer to a migration command than to an authoring-time validator, and probably overlaps with the planned `mxcli widget upgrade` work (out of scope for v0.11 per the issue body).

Work

  • Build a diff between the previously-cached `.def.json` and the freshly-extracted one
  • Classify each property change:
    • Additive-safe: new property with a default → no project changes needed
    • Default changed: existing widgets keep their old value, new widgets get new default → informational
    • Type changed: existing widgets may have BSON inconsistent with new schema → needs Studio Pro intervention
    • Property removed: existing widget BSON has orphan keys → needs Studio Pro intervention
  • Surface a summary in `mxcli refresh catalog` output (next to the current `✓ datagrid: v2.22.0 → v2.30.1 (4 new properties, 1 default changed)` line, which is currently mocked rather than computed)
  • Optional: `mxcli widget upgrade --dry-run` command listing affected pages/snippets

Acceptance criteria

  • `mxcli refresh catalog` accurately reports additive vs breaking schema changes
  • Breaking changes name the affected pages/snippets in the project so the author can locate them in Studio Pro

Out of scope

  • Auto-patching widget BSON in MPR files (likely never — Studio Pro should own that)
  • Per-property semver tracking — comparison is between local cache and current `.mpk`, not against a remote catalog

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions