Skip to content

Resolve inherited conformance for blank derived cluster entries in dm - #110

Merged
hasty merged 1 commit into
project-chip:mainfrom
AryaHassanli:fix-dm-derived-conformance
Dec 2, 2026
Merged

hasty merged 1 commit into
project-chip:mainfrom
AryaHassanli:fix-dm-derived-conformance

Conversation

@AryaHassanli

Copy link
Copy Markdown
Contributor

Summary

When a derived cluster in the Matter specification leaves the Conformance cell blank on an inherited element (to indicate no change from the base cluster), alchemy dm previously emitted no conformance element in the generated Data Model XML. Downstream consumers such as connectedhomeip's spec_parsing.py treat missing conformance tags as optionalConform, which causes derived cluster overrides to overwrite the base cluster's mandatoryConform with optionalConform (for example in the derived Mode_* clusters after connectedhomeip-spec PR #13292 and in OperationalState_Oven / OperationalState_RVC).

Approach

  • Added resolveConformance in dm/inherit.go to resolve blank conformances on derived cluster elements by walking cluster.ParentCluster read-only without mutating the derived overlay entity (following the same pattern as commandAccessDirection in dm/command.go).
  • Returns both the inherited conformance and its owning base parent entity so relative field references inside inherited conformances render cleanly.
  • Wired resolveConformance into derived cluster DM renderers for attributes, struct/command/event fields, commands, events, features, enum items, and bitmap bitfields.
  • Added unit tests in dm/inherit_test.go covering multi-level inheritance, explicit override preservation, non-mutation of overlays, sibling field references, and all element types.

Testing

  • go test ./... and go vet ./... pass.
  • Verified with an A/B alchemy dm run against the Matter specification (including spec_sha 8bbc51199e3fa2bcbc84d35ee05dfb5102eff425): only the 11 derived Mode_* clusters and OperationalState_Oven / OperationalState_RVC change, restoring the expected inherited conformance tags with zero new warnings.

@AryaHassanli
AryaHassanli requested a review from a team as a code owner November 27, 2026 21:23
@mergify

mergify Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

This pull request is merged.

@cecille cecille 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.

I know nothing about go, but I asked my bot to take a look and then interrogated it about a bunch of stuff I didn't understand (aka a lot of things) and it seemed pretty confident this was OK.

@hasty
hasty merged commit 12c2b9b into project-chip:main Dec 2, 2026
4 checks passed
@hasty
hasty self-requested a review December 2, 2026 21:58
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.

3 participants