Repository navigation
feat(kb,parser): support Machine KB schema 2.0.0 and align WHO 6/8 with Encyclopedia - #19
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates
openwebnet-mcpto support the OpenWebNet Encyclopedia Machine KB schema2.0.0(machine-kb-v0.2.0/2026.05.0), enriches the WHO 6 (Video Door Entry System) and WHO 8 (Voice / Video Intercom & Call Management) catalog entries, and adds dedicated WHO 6 and WHO 8 semantic frame validation inframe_parser.py.Changes
1. Machine KB Schema
2.0.0Compatibility (kb.py,kb_format.py)SUPPORTED_SCHEMA_MAJOR: Accept both schema major versions(1, 2)insrc/openwebnet_mcp/kb.pysoopenwebnet-mcploads both legacy1.0.0snapshots and the current2.0.0OpenWebNet Encyclopedia Machine KB (../OpenWebNet-Encyclopedia/knowledge).2.0.0Provenance Formatting: Update_format_source_lineinsrc/openwebnet_mcp/kb_format.pyto support theprovenance.sources[]object layout (source_id,tier,title,section,page,locus) alongside the v1 string-ID +sources_by_idlookup, while also surfacingprovenance.firmware_oracle(suite,verdict,evidence_path).2. WHO 6 & WHO 8 Catalog Alignment (
src/openwebnet_mcp/data/who_catalog.json)0–12,22–24,32–35), including10(Open door Lock 1),11(Reset external unit (#2riser required)),12(Door lock release notification),22/23/24(Open door Locks 2/3/4).0General,1–99Entrance panel (EP),4000–4099Camera endpoint (40xx),4100Broadcast, and#2riser suffix).*6*WHAT*WHERE##) and status-request (*#6*WHERE##) only (DIMENSIONframes are NACKed across all 7 gateway firmwares).1#KCall request kinds1–7,2#1/2#2Audio/Video answer,3End call / hang up,4#1–4#5Call completion status,5Paging / general announcement,6Answer call / pick up,10Open primary door lock,11/12Open auxiliary locks 2/3,21Turn on camera / cycle video,22Turn off camera).0General / broadcast,1–99Internal unit (IU) / handset ID,101–199External unit / entrance panel ID) and DIMENSION1(*#8*WHERE*1##Read call / handset state).3. Semantic Frame Validation for WHO 6 & WHO 8 (
src/openwebnet_mcp/frame_parser.py)_validate_who6&_validate_who6_where:DIMENSION_READ/DIMENSION_WRITEframes on WHO 6 (consistent with Firmware Oracleall_nackverdicts across all 7 firmwares).WHEREranges (0,1–99,4000–4099,4100) and#2riser suffix rules (rejecting invalid suffixes such as#1/#3and0#2/4100#2).WHAT=11requires a#2riser suffix (*6*11*WHERE#2##; bare*6*11*1##is NACKed on all gateways)._validate_who8&_validate_who8_where:1#1..1#7,2#1..2#2,4#1..4#5), WHERE ranges (0,1–99,101–199), and DIMENSION1.4. Tests & Golden Set (
tests/)tests/golden/kb_golden.jsonandtests/kb_eval.pyformachine-kb-v0.2.0(2026.05.0) record IDs (WHO-0016-SPEC,WHO-0001-DIM-0001).tests/test_frame_parser.pycovering WHO 6 (WHAT=10,WHAT=11with/without#2, invalid WHERE/DIMENSION) and WHO 8 (1#1..1#7,2#1..2#2,4#1..4#5, DIMENSION 1, invalid call kinds/WHERE/DIMENSION).tests/test_kb.pycovering schema2.0.0loading andprovenance.sources[]/firmware_oracleformatting.Verification
pytest -q: 165 passedpytest -q -m kb_eval tests/test_kb_golden.py: 1 passed (Recall@1 ≥ 0.72, Recall@3 ≥ 0.90, MRR ≥ 0.82, 0 rank regressions)