Skip to content

Fix boolean pattern metrics after reload - #8

Open
SH1RLEYyang wants to merge 1 commit into
jackft:mainfrom
SH1RLEYyang:fix/boolean-pattern-metrics
Open

SH1RLEYyang wants to merge 1 commit into
jackft:mainfrom
SH1RLEYyang:fix/boolean-pattern-metrics

Conversation

@SH1RLEYyang

Copy link
Copy Markdown

No description provided.

Copilot AI lite review requested due to automatic review settings September 2, 2026 02:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is narrowly scoped, schema-driven, and covered by a targeted round-trip test that demonstrates the intended behavior.

Pull request overview

This PR fixes a type regression in MMEAF deserialization where pattern slot metric values (stored as XML attributes) were always decoded as strings after reload, causing boolean metrics (checkboxes) to come back as "true"/"false" instead of true/false.

Changes:

  • Add schema-aware decoding for mm:metric_value entries so boolean metrics are parsed as booleans based on their metric schema.
  • Build a metricTypes lookup map from parsed pattern schemas and reuse it when parsing patterns and pattern-related suggestions.
  • Add a round-trip test ensuring boolean metric values are restored as booleans while text metrics remain strings.
File summaries
File Description
packages/serialization/src/mmeaf-parse.ts Decode mm:metric_value attributes using the metric schema type (boolean vs string).
packages/serialization/tests/mmeaf-roundtrip.test.ts Add coverage proving boolean metrics survive emit→parse as booleans (and text "true" stays a string).
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants