Skip to content

fix: Remove X-conformance attributes from bridged_device_basic_information validation#15

Merged
espressif-bot merged 1 commit intoespressif:mainfrom
jonsmirl:fix/bridged-device-basic-info-conformance
Feb 20, 2026
Merged

fix: Remove X-conformance attributes from bridged_device_basic_information validation#15
espressif-bot merged 1 commit intoespressif:mainfrom
jonsmirl:fix/bridged-device-basic-info-conformance

Conversation

@jonsmirl
Copy link
Contributor

Summary

Fixes #14

Removes attributes with conformance "X" (SHALL NOT be present) from the bridged_device_basic_information cluster requirements in all validation data files.

Changes

Per Matter Specification section 9.13.5, the following attributes have conformance X and should NOT be listed as required:

Attribute ID Conformance
DataModelRevision 0x0000 X (SHALL NOT)
Location 0x0006 X (SHALL NOT)
CapabilityMinima 0x0013 X (SHALL NOT)
SpecificationVersion 0x0015 X (SHALL NOT)
MaxPathsPerInvoke 0x0016 X (SHALL NOT)

These attributes exist in BasicInformation (endpoint 0) but are explicitly prohibited from BridgedDeviceBasicInformation per the Matter spec.

Files Modified

  • dmv_tool/data/validation_data_1.2.json - Removed 3 attributes
  • dmv_tool/data/validation_data_1.3.json - Removed 5 attributes
  • dmv_tool/data/validation_data_1.4.json - Removed 5 attributes
  • dmv_tool/data/validation_data_1.4.2.json - Removed 5 attributes
  • dmv_tool/data/validation_data_1.5.json - Removed 5 attributes

Testing

After this fix, devices implementing BridgedDeviceBasicInformation with only the mandatory attributes (Reachable, UniqueID) will pass validation instead of incorrectly failing due to "missing" prohibited attributes.

@pimpalemahesh
Copy link
Contributor

@jonsmirl These JSON files are generated using this command, so we shouldn’t edit them manually.
Any changes will need to be handled by updating the parsing logic instead.

@jonsmirl
Copy link
Contributor Author

jonsmirl commented Feb 3, 2026

Addressed review feedback - completely reworked the approach:

Previous approach (rejected): Manually edited the auto-generated JSON validation files

New approach: Updated the parsing logic in dmv_tool/generators/datamodel.py to exclude X-conformance attributes when inheriting from base clusters.

Changes made:

  • Added an exclusion list for bridged_device_basic_information cluster that prevents inheriting these attributes from BasicInformation:
    • data_model_revision (0x0000)
    • location (0x0006)
    • capability_minima (0x0013)
    • specification_version (0x0015)
    • max_paths_per_invoke (0x0016)

Per Matter spec section 9.13.5, these attributes have conformance "X" (SHALL NOT be present) for BridgedDeviceBasicInformation.

Verification: Tested with esp-matter-dm-validator generate-reference-json - the generated JSON now correctly excludes these attributes without manual editing.

All 79 tests pass.

@jonsmirl jonsmirl force-pushed the fix/bridged-device-basic-info-conformance branch from 625a6f9 to 6b0ddff Compare February 4, 2026 15:50
@jonsmirl
Copy link
Contributor Author

jonsmirl commented Feb 4, 2026

Addressed the review feedback - implemented a generic solution as requested.

Changes:

  1. No more manual JSON edits - Reverted all changes to validation_data_*.json files

  2. Generic solution in parsing logic - Updated dmv_tool/generators/datamodel.py:

    • AttributeParser, CommandParser, and EventParser now track elements with disallowConform in the derived cluster's XML
    • When inheriting from base cluster, elements that have disallowConform in the derived cluster are excluded
    • Uses consistent snake_case comparison for element names

How it works:

When parsing a derived cluster (like BridgedDeviceBasicInformation):

  1. First pass: Collect all elements with <disallowConform/> from the derived cluster's XML
  2. When inheriting from base cluster: Skip any elements that were marked as disallowed in step 1

This approach:

  • Works for any derived cluster, not just BridgedDeviceBasicInformation
  • Reads the conformance directly from the XML specification
  • Requires no manual maintenance of exclusion lists

Verification:

  • All 79 tests pass
  • Tested with esp-matter-dm-validator generate-reference-json - correctly excludes X-conformance attributes from BridgedDeviceBasicInformation

@jonsmirl
Copy link
Contributor Author

jonsmirl commented Feb 5, 2026

Addressed review feedback:

  • Removed unnecessary comments and skip_list from all three parsers (AttributeParser, CommandParser, EventParser)
  • Reused check_conformance_restrictions from should_process_element instead of calling it separately — should_process_element already adds element names to processed_attrs before checking conformance restrictions (disallowed, deprecated, provisional), so the snake_case comparison against processed_attrs in the base inheritance loop is sufficient to prevent inheriting restricted elements

All 79 tests pass.

@pimpalemahesh
Copy link
Contributor

@jonsmirl I don’t see any changes in the JSON files from this fix. The X-conformance attributes are still present; only the script was updated.
The script update should remove the required X-conformance attributes from the data/*.json files.
If those JSONs weren’t regenerated, please re-run the script to generate them for all spec versions.

@jonsmirl
Copy link
Contributor Author

jonsmirl commented Feb 9, 2026

Regenerated all data/*.json files for spec versions 1.2, 1.3, 1.4, 1.4.1, 1.4.2, and 1.5. The X-conformance attributes are now removed from the JSON output (582 lines removed across all files).

Copy link
Contributor

@pimpalemahesh pimpalemahesh left a comment

Choose a reason for hiding this comment

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

LGTM!

@pimpalemahesh
Copy link
Contributor

@jonsmirl Please consider squashing the commits into an appropriate message and bumping the version in setup.py

@jonsmirl jonsmirl force-pushed the fix/bridged-device-basic-info-conformance branch from ebd0684 to e841b9a Compare February 11, 2026 19:34
@jonsmirl
Copy link
Contributor Author

Squashed the 4 commits into a single commit and bumped version to 1.0.2 in setup.py.

@shubhamdp
Copy link
Collaborator

@jonsmirl After merging #16 this ran into conflicts, can you please rebase and fix the conflicts.

…itance

When copying attributes from a base cluster to a derived cluster, the
tool was not checking whether attributes have disallowed/deprecated/
provisional conformance in the derived cluster. This caused attributes
with X-conformance (e.g. Bridged Device Basic Information inheriting
from Basic Information) to incorrectly appear in the validation data.

- Reuse check_conformance_restrictions from should_process_element to
  build a skip_list for inherited attributes
- Regenerate all validation JSON data files for spec versions 1.2,
  1.3, 1.4, 1.4.1, 1.4.2, and 1.5
- Bump version to 1.0.2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jonsmirl jonsmirl force-pushed the fix/bridged-device-basic-info-conformance branch from e841b9a to 8e8c64d Compare February 19, 2026 13:24
@jonsmirl
Copy link
Contributor Author

Rebased onto main to resolve conflicts from #16. The only conflict was the version number in setup.py — kept it at 1.0.2.

@espressif-bot espressif-bot merged commit b106bf7 into espressif:main Feb 20, 2026
13 checks passed
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.

DMV incorrectly requires X-conformance attributes for BridgedDeviceBasicInformation

4 participants