Skip to content

fix(validation): remove false positives from config validate/check - #25

Open
s31teg wants to merge 1 commit into
eisber:mainfrom
s31teg:fix/validate-check-false-positives
Open

s31teg wants to merge 1 commit into
eisber:mainfrom
s31teg:fix/validate-check-false-positives

Conversation

@s31teg

@s31teg s31teg commented Oct 12, 2026

Copy link
Copy Markdown

Summary

On a real 2.4 MB house project, lox config validate and lox config check produced about 15,000 UUID warnings and about 750 wiring and layout findings. Almost all of it was noise, and it hid the few real problems. On the 41 sample configs in tests/eval/golden/configs, check failed on 40 of them for the same reasons. This PR removes those false positives and keeps the genuine cases.

Changes

validate

  • Drop "UUID missing serial suffix". The last UUID group identifies the Loxone Config installation that created the element, not the Miniserver serial, and real projects mix dozens of suffixes. It is replaced by a shape check (8-4-4-16 hex; a shorter last group is allowed for system/mode UUIDs).
  • Wiring-direction check: ignore links that Config manages itself (<In FLG="1">) and API connectors (API, OutputAPI). An API connector takes command text in, e.g. from a virtual text input, and reports status out.

check

  • Missing canvas layout: only reported for direct children of a Page. Hidden InputRef / OutputRef / OutputRefLM without the 0x20000 "placed" bit are skipped. Nested elements (Keycodes in an NfcCodeTouch, meters in an EFM) never have coordinates. A normal block on a page without coordinates is still reported.
  • Unwired inputs: no longer reported one by one. Most inputs are optional, and the schemas have no required-input data.
  • "No inputs wired": only reported for pure logic blocks (And, Or, comparators, math, timers…). Controllers (LightController2, PushButton2, AutoJalousie, Central*, EFM…) are legitimately driven from the app, by time or by device binding.
  • Skipped blocks: wiring checks now skip blocks that aren't on a Page, InputRef / OutputRef (fed by Ref, not by page wires) and AutoPilot / AutopilotRule (their conditions live in the APC JSON; their inputs are managed by Config).
  • Comparator Input2: counts as set when it has a Def or at least one <In> wire. An empty GreaterEqual / Less threshold compares against 0, which can be intended (e.g. Loxone's own SG Ready sample tests "price below 0"), so it is now a warning instead of an error.

Results

Real project:

Command Message Before After
validate UUID missing serial suffix 14,802 0
validate wired TO an Output connector 1 0
check no inputs wired 493 0
check unwired inputs 139 0
check missing canvas layout 114 0
check Input2 not set 3 (✗) 1 (⚠)

41 sample configs:

Command Message Before After
validate UUID missing serial suffix 20,627 0
validate wired TO an Output connector 21 2 (Var1 / Var2, left as is)
check no inputs wired 1,785 0
check unwired inputs 144 0
check missing canvas layout 135 0
check files where check exits 0 1 / 41 41 / 41

Testing

  • New unit tests, one per rule. Each covers the false-positive case and confirms the genuine case is still reported:

    • an unplaced block on a page;
    • an empty comparator threshold;
    • a malformed UUID.

    The tests for the original six fixes fail on main.

  • cargo fmt --check, cargo clippy -- -D warnings, cargo build --release and cargo test pass.

Known gap

A controller with nothing wired at all (e.g. a forgotten LightController2) is no longer reported. A narrower warning for that case was tried, but nearly all of its hits on real data were legitimate, so it was left out.

Reviewing a real 2.4 MB project, validate/check produced ~15k UUID
warnings and ~500 wiring/layout findings that were almost all noise.

validate:
- Drop the "UUID missing serial suffix" rule. The last UUID group
  identifies the Loxone Config installation that created the element,
  not the Miniserver serial; projects mix many suffixes. Replace it
  with a shape check (8-4-4-16 hex, short last group allowed for
  system/mode UUIDs).
- Ignore Config-managed links (<In FLG="1">) and API connectors (API,
  OutputAPI: they take command text in) in the wiring-direction check.

check:
- Only report missing canvas layout for direct Page children, and skip
  hidden InputRef/OutputRef whose WF lacks the 0x20000 placed bit;
  nested elements (Keycode in NfcCodeTouch, meters in EFM) never have
  coordinates.
- Stop reporting individually unwired inputs: most inputs are optional
  and the schemas carry no required-input data.
- Only report "no inputs wired" for pure logic blocks; controllers are
  legitimately driven from the app, by time or by device binding.
- Skip wiring checks for blocks not on a Page, for InputRef/OutputRef
  (fed by Ref) and for AutoPilot/AutopilotRule (conditions live in APC,
  inputs are Config-managed).
- A parameter such as comparator Input2 counts as set when it has a
  Def or at least one <In> wire.
- An empty GreaterEqual/Less threshold compares against 0, which can be
  intended (e.g. a price below 0), so report it as a warning, not an
  error.

This branch has not been deployed

No deployments
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.

1 participant