Skip to content

fix(oracle): verify OWNd's own gateway profiles and check F461 live traces against the oracle (#735) - #745

Merged
GreenGrassBlueOcean merged 2 commits into
v2-phase1-architecturefrom
arch/issue-735-v2-release-consolidation
Oct 21, 2026
Merged

GreenGrassBlueOcean merged 2 commits into
v2-phase1-architecturefrom
arch/issue-735-v2-release-consolidation

Conversation

@GreenGrassBlueOcean

@GreenGrassBlueOcean GreenGrassBlueOcean commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Part of #735

What is the problem

  1. The gateway profile oracle check could not fail for most profiles. scripts/update_gateway_profiles.py and custom_components/myhome/where_grammar.py each carried a shim that ran at import and rewrote OWNd's auth_measured, audio_measured and supported_who for F453, F453AV, F454, F461, MyHomeServer1, MH200 and MH200N with hard-coded values taken from the firmware oracle. verify_profiles_against_oracle() then compared those rewritten values with the same oracle, so a regression in OWNd for any of those seven models would pass test_gateway_profiles_match_oracle_verdicts and sync_documentation.py --check. The script also held a third, older copy of the shim.
  2. The live F461 2026-10-18 captures were not checked against the oracle. Their frames were only checked to parse, which OWNMessage.parse() does for any well-formed frame, including an unknown WHO.

How is it solved

  1. Shims removed. All three copies are gone. Every value they wrote is already OWNd's own value in 2.0.0b11 (the minimum in pyproject.toml and the manifest.json pin) and in OWNd master, checked profile by profile. The verification now reads OWNd's real profile data.
  2. Guard against a new shim. verify_profiles_against_oracle() reports any OWNd profile whose class __init__ was replaced, or whose registered instance no longer equals a fresh one. Two tests in tests/test_gateway_profiles.py patch an instance and a class and expect the violation.
  3. F461 traces tied to the oracle (test_f461_live_trace_agrees_with_oracle, one case per trace):
    • every event the capture recorded with an ownd_class must still decode to that class (73 + 58 events);
    • every command the gateway answered that the F461 020011 oracle also replayed must agree with it: live ACK when the oracle verdict is out, NACK when it is silent (6 frames per trace).

How is it tested

  • Full suite against OWNd 2.0.0b11: 4392 passed, 100.0 % statement coverage.
  • The changed test files also pass against OWNd master.
  • ruff, mypy, scripts/verify_ha_standards.py and scripts/sync_documentation.py --check pass.

Where are the traces

Both were already on v2-phase1-architecture; this PR adds no fixtures.

What does the oracle say

Frame Live F461 2.0.11 Oracle F461 020011 reply / verdict
*#13**15##, *#13**16##, *#13**23##, *#13**24## ACK ack / out
*#1*0##, *#18*51*113## ACK ack / out
*1*1*0##, *#2*0##, *#18*51*#1200#1*0## ACK nack / out
*#18*51*1200## NACK nack / silent

The live ACK/NACK follows the oracle's verdict in every case. Its reply field disagrees with the hardware on three frames, so the test does not compare it. That field is also what test_golden_corpus_against_firmware_oracle and KNOWN_GATEWAY_DISCREPANCIES rely on, which is worth a separate look.

Not in this PR

The earlier description also listed an oracle resync, README/docs calibration and the repair-issue catalog. None of that is in this diff (the base branch already passes the oracle integrity test and sync_documentation.py --check), so this PR no longer closes #735.

🤖 Generated with Claude Code

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@GreenGrassBlueOcean
GreenGrassBlueOcean force-pushed the arch/issue-732-modularize-monoliths branch from e99c6b4 to eb84a8e Compare October 17, 2026 10:16
@GreenGrassBlueOcean
GreenGrassBlueOcean force-pushed the arch/issue-735-v2-release-consolidation branch 2 times, most recently from 758fd05 to 5dab9f0 Compare October 17, 2026 10:28
@GreenGrassBlueOcean
GreenGrassBlueOcean force-pushed the arch/issue-732-modularize-monoliths branch from 08267ae to bbdcf40 Compare October 17, 2026 10:40
@GreenGrassBlueOcean
GreenGrassBlueOcean force-pushed the arch/issue-735-v2-release-consolidation branch from 5dab9f0 to 4160a82 Compare October 17, 2026 10:40
@GreenGrassBlueOcean
GreenGrassBlueOcean force-pushed the arch/issue-732-modularize-monoliths branch 2 times, most recently from aba7687 to 3ef903f Compare October 19, 2026 10:04
@GreenGrassBlueOcean
GreenGrassBlueOcean force-pushed the arch/issue-735-v2-release-consolidation branch from 4160a82 to 318f4e0 Compare October 19, 2026 10:26
@GreenGrassBlueOcean
GreenGrassBlueOcean force-pushed the arch/issue-732-modularize-monoliths branch from 3ef903f to 3acf978 Compare October 19, 2026 12:37
@GreenGrassBlueOcean
GreenGrassBlueOcean force-pushed the arch/issue-735-v2-release-consolidation branch from 318f4e0 to ac9d8a0 Compare October 19, 2026 12:37
@GreenGrassBlueOcean
GreenGrassBlueOcean force-pushed the arch/issue-732-modularize-monoliths branch from 3acf978 to b6966a6 Compare October 20, 2026 20:05
Base automatically changed from arch/issue-732-modularize-monoliths to v2-phase1-architecture October 20, 2026 20:16
….0.0 documentation (#735)

- Rebase onto #744 (3ef903f) and latest v2-phase1-architecture (fcdb507)
- Deduplicate _ensure_oracle_verified_profiles in scripts/update_gateway_profiles.py
- Add test_f461_live_traces_2026_10_18_conformance_with_oracle verifying physical BTicino F461 (2.0.11) live traces against OWNd parser and F461 oracle verdicts
@GreenGrassBlueOcean
GreenGrassBlueOcean force-pushed the arch/issue-735-v2-release-consolidation branch from ac9d8a0 to 0b02a95 Compare October 21, 2026 16:39
…e oracle (#735)

- Remove the import-time OWNd profile shim from scripts/update_gateway_profiles.py
  and custom_components/myhome/where_grammar.py. Every value it wrote already
  matches OWNd 2.0.0b11 (the minimum) and OWNd master, so its only effect was
  making verify_profiles_against_oracle() compare the oracle with itself.
- verify_profiles_against_oracle() now reports any OWNd profile changed after
  import, so a future shim fails the check instead of passing it.
- Replace the F461 2026-10-18 test: per trace, every recorded event must decode
  to the OWNd class the capture logged, and every answered command must match
  the F461 020011 oracle (ACK when the oracle saw it reach the bus, NACK when it
  was dropped). The oracle reply field is not compared; for three frames it
  says NACK where the hardware ACKed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GreenGrassBlueOcean GreenGrassBlueOcean changed the title chore(release): consolidate gateway profiles, firmware oracle, and v2.0.0 documentation (#735) fix(oracle): verify OWNd's own gateway profiles and check F461 live traces against the oracle (#735) Oct 21, 2026
@GreenGrassBlueOcean
GreenGrassBlueOcean merged commit 5d049f3 into v2-phase1-architecture Oct 21, 2026
16 checks passed
@GreenGrassBlueOcean
GreenGrassBlueOcean deleted the arch/issue-735-v2-release-consolidation branch October 21, 2026 19:35
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