Skip to content

Prepare v2.0.8 release candidate#76

Merged
senyo888 merged 13 commits into
developfrom
senyo888-patch-1
Jul 4, 2026
Merged

Prepare v2.0.8 release candidate#76
senyo888 merged 13 commits into
developfrom
senyo888-patch-1

Conversation

@senyo888

@senyo888 senyo888 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Prepares Humidity Intelligence v2.0.8 for review on develop.

This promotes the v2.0.8 release-candidate package from senyo888-patch-1, including setup guidance improvements, telemetry setup assistance, safer generated dashboards, passive Stability preview UI, admin-gated global pause/resume behavior, diagnostics/support-output hardening, release-governance updates, and matching tests/docs.

Scope

Release-candidate promotion from senyo888-patch-1 to develop.

Primary surfaces:

  • Integration metadata and release docs
  • Config flow/setup guidance
  • Setup-assist helper logic
  • Diagnostics/support export behavior
  • Services and service schemas
  • Issue-triage report confinement
  • Generated V2 card templates and UI Gallery examples
  • Runtime/card/config-flow regression tests
  • Release governance and PR checklist wording

site/index.html may appear in branch history, but the dry merge leaves it unchanged against current develop because the prior main -> develop sync already landed that content.

Reason

v2.0.8 is ready for develop review after the pre-release main -> develop sync.

This PR keeps the release candidate separate from stable-branch housekeeping and gives reviewers one focused v2.0.8 package to validate before any later develop -> main, tag, or GitHub Release step.

Files affected

Main affected files/folders:

  • .github/pull_request_template.md
  • ARCHITECTURE.md
  • CHANGELOG.md
  • CONTRIBUTING.md
  • README.md
  • manifest.json
  • config_flow.py
  • const.py
  • diagnostics.py
  • sensor.py
  • services.py
  • services.yaml
  • strings.json
  • translations/en.json
  • helpers/setup_assist.py
  • helpers/zone_validation.py
  • scripts/issue_triage.py
  • scripts/security/scan_secrets.sh
  • docs/
  • legacy/
  • ui/
  • ui-gallery/default-v2-mobile-aq/
  • ui-gallery/default-v2-tablet-zone-2/
  • tests 2/

Runtime impact

Deterministic lane ordering is preserved.

Runtime impact:

  • No approved change to lane priority ordering.
  • No new hidden automation path.
  • No new parallel output writer.
  • No migration shape change.
  • No change to public entity semantics.
  • Global all-entry pause_control / resume_control now require admin user context.
  • Scoped entry_id pause/resume remains available for the supplied config entry.
  • v205_release_check keeps its service name and accepts the v2.0.8 beta/rc/stable line.
  • Diagnostics/support exports are more conservative and sanitized by default.
  • Home Assistant Area/Label setup assistance is advisory only; saved HI telemetry config remains authoritative.

UI impact

Generated UI changes are included.

UI impact:

  • Default V2 generated cards move away from runtime mutation controls as default dashboard surfaces.
  • The old Pause LIVE default tile is replaced by a passive compact Stability preview badge.
  • Stability preview reads diagnostics when present; and is yet to calculate a score, create an entity, select a lane, call services, or write outputs.
  • Stability shimmer cadence is guarded at 10 BPM / 6 seconds.
  • Existing UI Gallery examples for default V2 mobile AQ and tablet Zone 2 are updated.
  • Users with pasted Manual-card YAML need to re-export or refresh generated YAML after installing.

Migration impact

None.

No Home Assistant storage migration is required. Users should restart Home Assistant after installing/updating so HA reloads the manifest version and service code. Config-entry reload is only appropriate after the updated code is already loaded and options change.

Users relying on generated dashboard YAML or pasted Manual cards should run humidity_intelligence.dump_cards or humidity_intelligence.refresh_ui as appropriate, then refresh dashboard/browser cache.

Rollback safety

Rollback is a normal Git revert of this PR before release promotion.

Runtime rollback safety:

  • No HA Lab mutation was performed during this PR validation pass.
  • No stable-instance mutation was performed by Codex.
  • No helper, dashboard, output, restart, reload, tag, release, or merge action was performed by Codex.
  • If reverted after install, users should restart Home Assistant so HA reloads the previous integration code/manifest.
  • If generated YAML was pasted manually, users may need to re-paste the previous generated card YAML.

Validation performed

Branch and merge checks:

  • git fetch origin --prune
  • Confirmed no existing open senyo888-patch-1 -> develop PR.
  • Confirmed origin/develop...origin/senyo888-patch-1 is 9 10.
  • Dry-merged origin/senyo888-patch-1 into current origin/develop; merge completed cleanly with no conflicts.
  • Confirmed dry-merge result affects 36 files.

Release and code checks run against the dry-merge result:

  • git diff --cached --check
  • git diff --check
  • python3 -m py_compile config_flow.py sensor.py diagnostics.py services.py helpers/setup_assist.py helpers/zone_validation.py scripts/issue_triage.py
  • python3 -m compileall -q .
  • bash -n scripts/security/scan_secrets.sh
  • scripts/security/scan_secrets.sh tracked
  • VERSION_GOVERNANCE_BRANCH=develop python3 scripts/check_version_governance.py
    • Result: Version governance OK: branch=develop version=2.0.8 state=stable
  • python3 scripts/check_proposal_links.py
  • python3 -m unittest "tests 2/test_proposal_links.py"
  • python3 "tests 2/test_diagnostics.py"
  • python3 "tests 2/test_issue_triage.py"
  • python3 "tests 2/test_workflows.py"
  • python3 "tests 2/test_runtime_card_sanity.py"
    • Result: 75 direct sanity checks passed
  • python3 "tests 2/test_config_flow_sanity.py"
    • Result: 39 config-flow sanity checks passed
  • python3 "tests 2/test_setup_assist.py"
    • Result: 3 setup-assist sanity checks passed
  • python3 "tests 2/test_doc_banners.py"
  • Ruby JSON/YAML parse check for manifest.json, hacs.json, services.yaml, strings.json, and translations/en.json

Read-only Home Assistant / HA Lab checks:

  • scripts/local/bella_hi_health_check.sh --pre-release
    • Result: pass
    • Boundary: read-only inspection; no Home Assistant services, reloads, restarts, state writes, helper changes, dashboard changes, or output writes.
    • Aetherwing handoff required: no
  • scripts/local/ha_validate_hi.sh
    • Result: pass
    • Required HI services present: 11
    • Required runtime entity groups present: 14
    • Dashboard anchor entity groups present
    • No required HI entities unknown/unavailable
    • Active alert context idle
    • Registered/live calculated slope entities available: 9

Privacy/security checks:

  • Tracked secret scan passed with no leaks found.
  • Private-marker scan reviewed; matches were limited to sanitization logic/test fixtures and expected token-scanning code, not live private credentials or public runtime docs.
  • No private HA URLs, bearer tokens, device IDs, machine paths, raw diagnostics payloads, or stable-instance details are included in this PR body.

Not run:

  • No live humidity_intelligence.refresh_ui call was made during PR validation.
  • No HA restart/reload was performed by Codex.
  • No HACS VS Code preflight was run from this terminal session; manifest/HACS metadata was parsed and version-governance passed.

HA Lab advisory evidence

Status: pass with notes.

Advisory evidence only. HA Lab does not approve release, merge, tag, GitHub Release publication, or main promotion.

  • Stage A: prior package-deploy evidence exists for the beta lane, but no Stage A deploy was performed during this PR validation pass.
  • Activation/restart/reload: not performed by Codex during this PR validation pass.
  • Soak: not run in this PR validation pass.
  • Stage 3/runtime readiness: previous beta-lane read-only runtime readiness existed; current read-only HI validation passed with required services/entities present.
  • Card/entity-map evidence: local runtime-card sanity passed; prior support evidence reported generated-card availability clean, but final stable 2.0.8 live loaded-state proof still belongs to post-install/restart validation.
  • Rollback evidence: no current HA Lab mutation was performed, so no rollback action was needed for this PR validation pass.

Current advisory interpretation:

  • Good enough for develop review.
  • Not enough by itself for tag, GitHub Release publication, or develop -> main.
  • Final release promotion still needs maintainer approval and the normal release gates.

Type

  • Fix
  • Feature
  • Documentation
  • UI Gallery
  • Maintenance

Checks

  • PR targets develop.
  • Tested in Home Assistant, or testing notes explain why not.
  • Restart/config flow checked where relevant.
  • Ran humidity_intelligence.refresh_ui or refreshed dashboards where UI output changed.
  • Docs/changelog updated where needed.
  • Support docs, diagnostics guidance, and issue templates updated where support flow changed.
  • Wiki update status recorded as no-op for this PR body; public repo docs carry the release-facing changes.
  • HA Lab advisory evidence recorded, or explicitly marked not applicable.
  • No private entity IDs, secrets, addresses, or personal data included.
  • HACS/custom integration metadata still looks correct.
  • Deterministic lane ordering is preserved, or the PR explicitly explains an approved semantic change.
  • UI truth consistency is preserved; generated UI does not invent backend state.
  • Migration impact is documented, including "none" when no migration is required.
  • Release/readiness impact is stated, including whether Bella/Aetherwing/AetherCore review is needed.

UI Gallery submissions

Existing UI Gallery examples were updated, not added as new community submissions.

  • Uses /ui-gallery/<card-id>/.
  • Includes README.md, preview.png, and card.yaml or dashboard.yaml.
  • Top-level ui-gallery/README.md is updated.
  • Example follows ui-gallery/reference.txt format.
  • Required custom cards are documented.
  • Preserves canonical Humidity Intelligence backend entities/helpers.
  • Screenshots and YAML contain no private entity IDs, secrets, addresses, device IDs, tokens, internal URLs, or personal data.

Review gates

Bella: PASS for develop review.

  • Source-of-truth alignment, release docs, README/changelog messaging, UI truth wording, and support guidance are coherent enough for PR review.

Aetherwing: PASS for develop review.

  • Runtime safety checks passed.
  • Deterministic lane ordering remains preserved.
  • Generated-card/runtime-card sanity passed.
  • Current read-only HA health check says no constrained Aetherwing implementation handoff is required.

AetherCore: WARN / conditional.

  • Governance metadata and version policy allow stable 2.0.8 on develop.
  • This PR may proceed to human review, but release promotion is still blocked until explicit maintainer approval.
  • Do not tag, publish a GitHub Release, merge/promote to main, or treat HA Lab evidence as release authority without the final gates.

Release authority:

  • This PR is appropriate for develop review.
  • It is not approval for main.
  • It is not approval for a tag.
  • It is not approval for GitHub Release publication.
  • It is not a substitute for maintainer approval, Bella release coherence, Aetherwing runtime/release validation, AetherCore governance consistency, and final README/release approval.

Summary by CodeRabbit

  • New Features
    • Added a guided welcome step plus “setup assistance” previews for telemetry configuration, and improved telemetry display (using friendly area name).
    • Introduced a passive Stability Score badge on default V2 dashboards (with safer fallback behavior).
  • Bug Fixes
    • Improved temperature-slope setup when advanced/collapsed inputs submit empty values.
    • Default V2 dashboards are now safer/read-only; global pause/resume requires admin context.
  • Security
    • Further sanitized/redacted support and diagnostics exports.
    • Secret scanning now fails closed when no tracked files are found.
  • Documentation
    • Updated README/support and v2.0.8 release/governance guidance, including restart/refresh and regenerate-card instructions.
    • Expanded issue-triage “external advisory queue” reporting as advisory-only.

senyo888 added 10 commits June 23, 2026 20:01
Adds report-only Maintenance Review Queue parsing and rendering to the issue triage helper.

Documents the official proposal and maintainer-facing usage while preserving no GitHub mutation, no runtime authority, no entity semantics changes, and no generated dashboard impact.

Validation: python3 -m unittest 'tests 2/test_issue_triage.py'; python3 scripts/check_proposal_links.py; python3 -m unittest 'tests 2/test_proposal_links.py'; python3 scripts/check_version_governance.py; python3 -m py_compile scripts/issue_triage.py; git diff --check.
Preserve manifest version at 2.0.7 pending explicit beta adoption gate.

Includes default-safe V2 dashboard updates, admin-gated pause/resume services, sanitized diagnostics/reporting, fail-closed tracked secret scanning, and targeted regression coverage.
Bump manifest to 2.0.8-beta.1 and extend the existing v205_release_check contract to cover the v2.0.8 beta/rc/stable line.
Match the generated V2 Stability Score badge outer frame to the passive Ready/Zone/AQ badge treatment while keeping the inner 2.1 gauge and 10 BPM shimmer unchanged.

Validation: runtime card sanity, diff check, py_compile, version governance, and tracked secret scan.
Scope: update the GitHub Pages intro heading and environmental context copy only.

Reason: make the public project page more human, current, and clear about why humidity stability matters without changing runtime behavior.

Validation: git diff --check -- site/index.html; python3 -m unittest "tests 2/test_pages_site.py".
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

Humidity Intelligence

Thanks for opening your first Humidity Intelligence pull request. Contributions help improve the project, and your time here is appreciated.

Humidity Intelligence values deterministic behaviour, runtime truthfulness, stability over time, and maintainable changes. Review will focus on preserving those principles as much as on the code itself.

A strong PR usually:

  • keeps the change focused
  • updates documentation where behaviour, setup, support flow, or user-facing text changes
  • preserves canonical runtime behaviour unless an approved proposal says otherwise
  • includes validation notes, commands, screenshots, or Home Assistant checks where relevant

Community discussion, proposal submissions, and constructive feedback are welcome, especially when a change touches runtime semantics, generated UI truth, diagnostics, or long-term project direction.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7a1505c7-29d8-42fc-abd4-d8ccd9d3844f

📥 Commits

Reviewing files that changed from the base of the PR and between f9658c4 and e0ea3e7.

📒 Files selected for processing (2)
  • helpers/setup_assist.py
  • tests 2/test_setup_assist.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests 2/test_setup_assist.py
  • helpers/setup_assist.py

📝 Walkthrough

Walkthrough

This PR bumps the integration to v2.0.8, adds Setup Assist config-flow guidance and telemetry defaults, reshapes diagnostics and support exports into summary-based sanitized payloads, gates entry-less pause/resume on admin context, replaces the Pause dashboard tile with a passive Stability Score badge, hardens issue-triage and secret-scan tooling, and updates release/governance documentation.

Changes

Setup Assist Config Flow Feature

Layer / File(s) Summary
Setup Assist helper module and tests
helpers/setup_assist.py, tests 2/test_setup_assist.py
New helpers derive room/level/label suggestions and advisory text/warnings from HA registries, with sanitized diagnostics summary/warning helpers, validated by a standalone test suite.
Config flow welcome and telemetry wiring
config_flow.py, const.py, strings.json, translations/en.json
Adds a welcome step before dependency checks, removes the friendly_name field in favor of computed room/display values, and integrates Setup Assist previews/advisory text into telemetry add/edit steps and slope sanitization for both setup and options flows.
Config flow Setup Assist tests
tests 2/test_config_flow_sanity.py
Expands registry stubs and adds tests for welcome-step ordering, Setup Assist defaults, room dropdowns, and slope fallback behavior.

Diagnostics and Support Export Sanitization

Layer / File(s) Summary
Zone duplicate count helpers
helpers/zone_validation.py
Adds count-based and privacy-safe warning summarizers for duplicate zone mappings.
Diagnostics summary refactor
diagnostics.py
Replaces raw entity/config lists with presence booleans, counts, and status summaries across multiple diagnostics sections, with new aggregation helpers.
Support summaries and admin-gated pause/resume
services.py, sensor.py, services.yaml
Replaces raw dump_diagnostics export with summary helpers, enforces admin-user context for entry-less pause_control/resume_control, updates the manifest version regex, and switches to count-based duplicate reporting.
Diagnostics and support test coverage
tests 2/test_diagnostics.py, tests 2/test_runtime_card_sanity.py
Adds registry stubs and assertions covering sanitized summaries, redaction, duplicate evidence, and admin-gated pause/resume behavior.

Stability Score Badge and Dashboard Card Export Changes

Layer / File(s) Summary
Stability Score card replacement
ui-gallery/*/card.yaml, ui/cards/v2_mobile.yaml, ui/cards/v2_tablet.yaml, ui/cards/view_cards_button.yaml
Replaces the Pause timer tile with a passive Stability Score gauge badge driven by sensor.hi_diagnostics and updates card export instructions.
UI contract documentation
ui/README.md
Clarifies UI-only responsibility, passive badge behavior, and output-details toggle gating.
UI card safety tests
tests 2/test_runtime_card_sanity.py
Verifies default surfaces block unsafe controls, use v207 toggle actions, and render the Stability Score badge instead of the Pause tile.

v2.0.8 Release, Governance and Support Documentation

Layer / File(s) Summary
Release notes and README updates
manifest.json, CHANGELOG.md, README.md
Bumps version to 2.0.8 and documents new features, upgrade notes, and configuration flow.
Governance, support, and proposal docs
.github/pull_request_template.md, ARCHITECTURE.md, CONTRIBUTING.md, legacy/README.md, docs/release-governance.md, docs/runtime-simulation-validation.md, docs/support.md, docs/issue-triage.md, docs/proposals/*
Refines wording around advisory evidence boundaries, release gates, and proposal scope.

Issue Triage Maintenance Queue and Secret Scan Hardening

Layer / File(s) Summary
Maintenance advisory queue and safe report writing
scripts/issue_triage.py, tests 2/test_issue_triage.py
Adds a validated maintenance-action queue, Markdown rendering, CLI flags, and atomic path-confined report writing.
Secret scan fail-closed hardening
scripts/security/scan_secrets.sh, tests 2/test_workflows.py
Counts scanned tracked files and exits with error when none are found, verified by new regression tests.

Estimated code review effort: 4 (Complex) | ~75 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the release-candidate promotion in this PR.
Description check ✅ Passed The description follows the template closely and fills the required sections with specific, relevant release details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch senyo888-patch-1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
ui/cards/v2_tablet.yaml (2)

1733-1764: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Manual card also missing box-shadow vs. mobile equivalent.

Same pattern as ui-gallery/default-v2-tablet-zone-2/card.yaml's Manual card.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/cards/v2_tablet.yaml` around lines 1733 - 1764, The Manual button-card in
the tablet YAML is missing the same box-shadow styling used by the mobile
equivalent, so align this card’s `styles.card` block with the matching Manual
card pattern from the other tablet card definition. Update the
`custom:button-card` for `input_boolean.air_control_manual_override` to include
the missing shadow styling while keeping the existing layout, state text, and
label behavior unchanged.

1541-1550: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

System card loses box-shadow present in ui/cards/v2_mobile.yaml.

Same visual regression as ui-gallery/default-v2-tablet-zone-2/card.yaml: the box-shadow glow present on the mobile "System" card is absent here after the min-height edit.

🎨 Proposed fix
             card:
               - border-radius: 20px
               - padding: 14px
               - min-height: 132px
               - background: rgba(2,6,23,0.35)
               - border: 1px solid rgba(148,163,184,0.22)
+              - box-shadow: 0 0 18px rgba(148,163,184,0.12)
               - backdrop-filter: blur(12px)
               - "-webkit-backdrop-filter": blur(12px)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/cards/v2_tablet.yaml` around lines 1541 - 1550, The System card style in
the custom:button-card block is missing the box-shadow glow that exists in the
mobile version, causing a visual regression. Update the card styles for this
System card to include the same box-shadow used in ui/cards/v2_mobile.yaml and
the matching v2 tablet card variant, keeping the existing border-radius,
padding, min-height, and backdrop-filter settings intact. Locate the affected
custom:button-card definition by its card styles section and restore the shadow
there.
ui-gallery/default-v2-tablet-zone-2/card.yaml (1)

1734-1764: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Manual card also lacks box-shadow compared to mobile.

Same visual-consistency gap as the System card above; the mobile "Manual" card has box-shadow: 0 0 18px rgba(148,163,184,0.12) in its style block while this tablet version does not.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui-gallery/default-v2-tablet-zone-2/card.yaml` around lines 1734 - 1764, The
tablet Manual custom:button-card is missing the same box-shadow used in the
mobile version, creating a visual inconsistency. Update the styles block in the
Manual card definition to include the matching shadow value already used on the
mobile “Manual” card, keeping the rest of the card styling unchanged.
diagnostics.py (1)

355-385: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Bucket entity status before adding it to diagnostics. _entity_status returns the raw Home Assistant state string, so mapped_runtime_entities can expose sensor readings or tracker zones in the diagnostics payload. Map non-unknown/unavailable states to a privacy-safe bucket here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@diagnostics.py` around lines 355 - 385, The entity state reporting in
_entity_status is leaking raw Home Assistant values into diagnostics; bucket the
state before returning it so mapped_runtime_entities only exposes privacy-safe
categories. Update _entity_status (and any callers like
_mapped_entity_states/_entity_state) to map states to generic buckets instead of
str(state), while preserving missing/configured handling and keeping attributes
filtered through _SAFE_STATE_ATTRIBUTES.

Source: Coding guidelines

🧹 Nitpick comments (7)
scripts/issue_triage.py (1)

317-362: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

"public_safety" special-cased container key appears unused.

_parse_simple_action_yaml special-cases key in {"source", "public_safety"} to initialize a dict, but no code path reads data.get("public_safety") (required fields, _action_from_data, etc. never reference it). Looks like dead code from an earlier design.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/issue_triage.py` around lines 317 - 362, The special-cased container
initialization in _parse_simple_action_yaml for "public_safety" appears unused,
so clean up the dead branch by removing it from the set of keys that create a
dict. Keep the existing "source" handling intact, and ensure
_parse_simple_action_yaml still parses nested values correctly for the remaining
supported keys without changing any callers such as _action_from_data.
config_flow.py (2)

3637-3651: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Dead fallback branch: friendly_name can never be reached.

In both _render_existing_telemetry and _telemetry_label, room is computed as item.get("room") or ent (never falsy since ent itself falls back to "unknown"), so the subsequent display = room or item.get("friendly_name") or ent can never actually fall through to friendly_name. Since telemetry entries no longer collect a distinct friendly_name from the user (it's now always set equal to the computed room/display value), this is harmless today but is confusing dead code.

♻️ Suggested simplification
-        room = item.get("room") or ent
-        display = room or item.get("friendly_name") or ent
+        display = item.get("room") or ent

Also applies to: 3661-3666

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config_flow.py` around lines 3637 - 3651, Simplify the dead fallback logic in
_render_existing_telemetry and _telemetry_label by removing the unreachable
friendly_name branch. Since room already falls back to ent (and ent to
"unknown"), update the display selection to use the computed room/display value
directly and keep the formatting consistent with the telemetry entries that now
mirror room/display.

737-810: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Slope "required" error for calculated mode is now effectively unreachable.

slope_sources = _sanitize_entity_ids(user_input.get("slope_sources") or temp_entities) (and the options-flow equivalent using default_sources) means slope_sources can only be empty if temp_entities/default_sources is also empty — but the function already returns/skips earlier when there are no temperature entities. So errors["slope_sources"] = "required" for SLOPE_MODE_CALCULATED can no longer trigger in practice. This looks like an intentional trade-off (per the PR's "empty advanced inputs fall back to temperature sensors" behavior), but it silently removes the ability for a user to see a validation error if they intentionally clear all sources — worth a quick sanity check that this fallback-over-validation behavior is the desired UX.

Also applies to: 3102-3181

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config_flow.py` around lines 737 - 810, The validation for calculated slope
mode in async_step_slope is now unreachable because slope_sources always falls
back to temp_entities after _sanitize_entity_ids, so the required error can
never fire once temperature sensors exist. Confirm the intended UX and either
remove the dead validation or change the fallback so an empty user-provided
slope_sources still triggers the existing errors["slope_sources"] path in
async_step_slope (and the matching options-flow logic).
helpers/setup_assist.py (1)

85-96: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider logging on swallowed registry-lookup exceptions.

Lines 90, 95, and 242 catch blind Exception and silently degrade to "unsupported"/None with no log line. This is reasonable defensive coding to keep the config flow HA-version-tolerant, but a silent swallow makes it hard to diagnose why Setup Assist stopped working on a given HA install. Consider a _LOGGER.debug(...) call in these except blocks (module currently has no logger).

♻️ Suggested addition
+import logging
+
+_LOGGER = logging.getLogger(__name__)
+
 ...
     try:
         entity_reg = er.async_get(hass)
         area_reg = ar.async_get(hass)
         device_reg = dr.async_get(hass) if dr is not None else None
         label_reg = lr.async_get(hass) if lr is not None else None
     except Exception:
+        _LOGGER.debug("Setup Assist registry lookup failed", exc_info=True)
         return unsupported_setup_assist_suggestion("registry_lookup_failed", clean_entity_id)

Static analysis also flags these as blind-exception catches (BLE001); logging addresses the maintainability concern without changing the fail-safe behavior.

Also applies to: 240-243

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@helpers/setup_assist.py` around lines 85 - 96, Add debug logging to the
swallowed exception paths in setup_assist.py so registry lookup failures are
visible without changing the fail-safe behavior. Introduce a module logger and,
in the exception handlers around er.async_get/hass registry access and the
entity_entry lookup (and the other related catch block near the suggested
lines), emit _LOGGER.debug with the relevant context such as clean_entity_id
before returning unsupported_setup_assist_suggestion or None. Keep the defensive
fallback logic in place, but avoid silently swallowing Exception in these
registry lookup paths.

Source: Linters/SAST tools

diagnostics.py (3)

257-286: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Redundant _unavailable_configured_entities computation.

_runtime_summary recomputes _unavailable_configured_entities(hass, config, entity_map) and re-wraps it via _unavailable_entity_summary, even though diagnostics_summary (passed in as a parameter) already contains the exact same summarized value under unavailable_or_unknown_entities. This duplicates a full hass.states.get() sweep over every configured/mapped entity for no functional benefit.

♻️ Reuse the already-computed summary
-        "unavailable_or_unknown_entities": _unavailable_entity_summary(
-            _unavailable_configured_entities(hass, config, entity_map)
-        ),
+        "unavailable_or_unknown_entities": diagnostics_summary.get("unavailable_or_unknown_entities", {}),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@diagnostics.py` around lines 257 - 286, The _runtime_summary function is
recomputing unavailable entity data instead of reusing the already-built
diagnostics_summary value. Update _runtime_summary to read
unavailable_or_unknown_entities directly from diagnostics_summary and pass that
through, avoiding the extra _unavailable_configured_entities and
_unavailable_entity_summary work. Keep the change scoped to _runtime_summary and
use the existing diagnostics_summary parameter as the source of truth.

601-653: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Count/summary helpers are duplicated between diagnostics.py and services.py.

_pm25_normalization_status (here) vs. services.py's _pm25_normalization_status + _support_pm25_normalization_summary, _unavailable_entity_summary vs. _support_unavailable_summary, and _count_by vs. _count_config_rows implement effectively the same aggregation logic independently in both files. This PR already demonstrates a real divergence risk (the raw-vs-bucketed _entity_status inconsistency noted above), so consolidating these into a shared module (similar to the existing helpers/zone_validation.py pattern already used by both files) would reduce future drift.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@diagnostics.py` around lines 601 - 653, The count/summary aggregation logic
is duplicated across diagnostics.py and services.py, which risks behavior drift
between matching helpers like _pm25_normalization_status,
_support_pm25_normalization_summary, _unavailable_entity_summary,
_support_unavailable_summary, _count_by, and _count_config_rows. Extract the
shared summarization functions into a common module following the existing
helpers/zone_validation.py pattern, then update both diagnostics.py and
services.py to call the shared implementations instead of maintaining separate
copies.

364-376: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the unused _entity_state helper. _mapped_entity_states now calls _entity_status directly, and nothing else references this function.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@diagnostics.py` around lines 364 - 376, Remove the unused _entity_state
helper from diagnostics.py, since _mapped_entity_states now uses _entity_status
directly and there are no remaining call sites. Delete the entire
_entity_state(hass, entity_id) function and make sure no imports or nearby code
still depend on it after the removal.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config_flow.py`:
- Around line 3732-3743: The setup-assist preview detection in
_is_setup_assist_preview_input is matching a partial payload that does not occur
in the normal Home Assistant form submit path, so the preview branch is
effectively unreachable. Update the telemetry save flow around
_is_setup_assist_preview_input and the telemetry add handlers to either move
entity selection into a separate step or wire this logic into the actual HA
preview flow, rather than relying on a partial payload check on the normal save
path.

In `@scripts/issue_triage.py`:
- Around line 120-126: The public-safety path filter in
MAINTENANCE_QUEUE_PUBLIC_SAFETY_PATTERNS only detects macOS /Users paths, so
extend the regex set in scripts/issue_triage.py to catch Linux absolute paths
like /home/... and Windows absolute paths like C:\Users\... as well. Update the
pattern list used by issue triage rendering so private local paths are redacted
consistently across platforms, and keep the existing token/secret patterns
intact.

In `@ui-gallery/default-v2-tablet-zone-2/card.yaml`:
- Around line 1543-1550: The System card styling in the tablet variant is
missing the glow effect used in the mobile variant. Update the card definition
in the tablet layout’s card block to include the same box-shadow value as the
mobile “System” card, alongside the existing border-radius, padding, min-height,
and backdrop-filter settings, so the two layouts stay visually consistent.

In `@ui/cards/v2_tablet.yaml`:
- Around line 1551-1616: The Stability Score gauge in the card template is
treating a null display_score as a real numeric value because Number(rawValue)
converts null to 0. Update the gauge logic in the entity card template to
explicitly guard rawValue before converting it, so null/undefined falls back to
the existing future/default state instead of being rendered as score 0. Use the
gauge custom_fields block and the rawValue/value/hasValue logic as the place to
adjust the fallback handling.

---

Outside diff comments:
In `@diagnostics.py`:
- Around line 355-385: The entity state reporting in _entity_status is leaking
raw Home Assistant values into diagnostics; bucket the state before returning it
so mapped_runtime_entities only exposes privacy-safe categories. Update
_entity_status (and any callers like _mapped_entity_states/_entity_state) to map
states to generic buckets instead of str(state), while preserving
missing/configured handling and keeping attributes filtered through
_SAFE_STATE_ATTRIBUTES.

In `@ui-gallery/default-v2-tablet-zone-2/card.yaml`:
- Around line 1734-1764: The tablet Manual custom:button-card is missing the
same box-shadow used in the mobile version, creating a visual inconsistency.
Update the styles block in the Manual card definition to include the matching
shadow value already used on the mobile “Manual” card, keeping the rest of the
card styling unchanged.

In `@ui/cards/v2_tablet.yaml`:
- Around line 1733-1764: The Manual button-card in the tablet YAML is missing
the same box-shadow styling used by the mobile equivalent, so align this card’s
`styles.card` block with the matching Manual card pattern from the other tablet
card definition. Update the `custom:button-card` for
`input_boolean.air_control_manual_override` to include the missing shadow
styling while keeping the existing layout, state text, and label behavior
unchanged.
- Around line 1541-1550: The System card style in the custom:button-card block
is missing the box-shadow glow that exists in the mobile version, causing a
visual regression. Update the card styles for this System card to include the
same box-shadow used in ui/cards/v2_mobile.yaml and the matching v2 tablet card
variant, keeping the existing border-radius, padding, min-height, and
backdrop-filter settings intact. Locate the affected custom:button-card
definition by its card styles section and restore the shadow there.

---

Nitpick comments:
In `@config_flow.py`:
- Around line 3637-3651: Simplify the dead fallback logic in
_render_existing_telemetry and _telemetry_label by removing the unreachable
friendly_name branch. Since room already falls back to ent (and ent to
"unknown"), update the display selection to use the computed room/display value
directly and keep the formatting consistent with the telemetry entries that now
mirror room/display.
- Around line 737-810: The validation for calculated slope mode in
async_step_slope is now unreachable because slope_sources always falls back to
temp_entities after _sanitize_entity_ids, so the required error can never fire
once temperature sensors exist. Confirm the intended UX and either remove the
dead validation or change the fallback so an empty user-provided slope_sources
still triggers the existing errors["slope_sources"] path in async_step_slope
(and the matching options-flow logic).

In `@diagnostics.py`:
- Around line 257-286: The _runtime_summary function is recomputing unavailable
entity data instead of reusing the already-built diagnostics_summary value.
Update _runtime_summary to read unavailable_or_unknown_entities directly from
diagnostics_summary and pass that through, avoiding the extra
_unavailable_configured_entities and _unavailable_entity_summary work. Keep the
change scoped to _runtime_summary and use the existing diagnostics_summary
parameter as the source of truth.
- Around line 601-653: The count/summary aggregation logic is duplicated across
diagnostics.py and services.py, which risks behavior drift between matching
helpers like _pm25_normalization_status, _support_pm25_normalization_summary,
_unavailable_entity_summary, _support_unavailable_summary, _count_by, and
_count_config_rows. Extract the shared summarization functions into a common
module following the existing helpers/zone_validation.py pattern, then update
both diagnostics.py and services.py to call the shared implementations instead
of maintaining separate copies.
- Around line 364-376: Remove the unused _entity_state helper from
diagnostics.py, since _mapped_entity_states now uses _entity_status directly and
there are no remaining call sites. Delete the entire _entity_state(hass,
entity_id) function and make sure no imports or nearby code still depend on it
after the removal.

In `@helpers/setup_assist.py`:
- Around line 85-96: Add debug logging to the swallowed exception paths in
setup_assist.py so registry lookup failures are visible without changing the
fail-safe behavior. Introduce a module logger and, in the exception handlers
around er.async_get/hass registry access and the entity_entry lookup (and the
other related catch block near the suggested lines), emit _LOGGER.debug with the
relevant context such as clean_entity_id before returning
unsupported_setup_assist_suggestion or None. Keep the defensive fallback logic
in place, but avoid silently swallowing Exception in these registry lookup
paths.

In `@scripts/issue_triage.py`:
- Around line 317-362: The special-cased container initialization in
_parse_simple_action_yaml for "public_safety" appears unused, so clean up the
dead branch by removing it from the set of keys that create a dict. Keep the
existing "source" handling intact, and ensure _parse_simple_action_yaml still
parses nested values correctly for the remaining supported keys without changing
any callers such as _action_from_data.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6bf23c53-2efb-4cdb-8126-0064fd73b84d

📥 Commits

Reviewing files that changed from the base of the PR and between a4ea3a2 and 7c0d798.

📒 Files selected for processing (36)
  • .github/pull_request_template.md
  • ARCHITECTURE.md
  • CHANGELOG.md
  • CONTRIBUTING.md
  • README.md
  • config_flow.py
  • const.py
  • diagnostics.py
  • docs/issue-triage.md
  • docs/proposals/2026-06-08-v207-degraded-alert-ui-truth-separation.md
  • docs/release-governance.md
  • docs/runtime-simulation-validation.md
  • docs/support.md
  • helpers/setup_assist.py
  • helpers/zone_validation.py
  • legacy/README.md
  • manifest.json
  • scripts/issue_triage.py
  • scripts/security/scan_secrets.sh
  • sensor.py
  • services.py
  • services.yaml
  • strings.json
  • tests 2/test_config_flow_sanity.py
  • tests 2/test_diagnostics.py
  • tests 2/test_issue_triage.py
  • tests 2/test_runtime_card_sanity.py
  • tests 2/test_setup_assist.py
  • tests 2/test_workflows.py
  • translations/en.json
  • ui-gallery/default-v2-mobile-aq/card.yaml
  • ui-gallery/default-v2-tablet-zone-2/card.yaml
  • ui/README.md
  • ui/cards/v2_mobile.yaml
  • ui/cards/v2_tablet.yaml
  • ui/cards/view_cards_button.yaml

Comment thread config_flow.py
Comment thread scripts/issue_triage.py
Comment thread ui-gallery/default-v2-tablet-zone-2/card.yaml
Comment thread ui/cards/v2_tablet.yaml
@senyo888

senyo888 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@senyo888

senyo888 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@helpers/setup_assist.py`:
- Around line 101-111: The entity lookup in SetupAssistSuggestion is swallowing
exceptions from entity_reg.async_get and incorrectly falling through to
status="not_found". Update the try/except around async_get in setup_assist.py so
lookup failures are treated like the registry-acquisition failure path in the
same function and return status="unsupported" (or an equivalent failure status),
while keeping genuine missing entities as "not_found". Make the change in the
SetupAssistSuggestion construction flow and preserve the debug logging for the
caught exception.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 50a066d5-df7f-4627-9cba-46357a44c7a4

📥 Commits

Reviewing files that changed from the base of the PR and between 7c0d798 and f9658c4.

📒 Files selected for processing (16)
  • CHANGELOG.md
  • README.md
  • config_flow.py
  • diagnostics.py
  • docs/release-governance.md
  • helpers/setup_assist.py
  • scripts/issue_triage.py
  • tests 2/test_config_flow_sanity.py
  • tests 2/test_diagnostics.py
  • tests 2/test_issue_triage.py
  • tests 2/test_runtime_card_sanity.py
  • tests 2/test_setup_assist.py
  • ui-gallery/default-v2-mobile-aq/card.yaml
  • ui-gallery/default-v2-tablet-zone-2/card.yaml
  • ui/cards/v2_mobile.yaml
  • ui/cards/v2_tablet.yaml
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (12)
  • ui-gallery/default-v2-tablet-zone-2/card.yaml
  • docs/release-governance.md
  • tests 2/test_issue_triage.py
  • ui/cards/v2_mobile.yaml
  • tests 2/test_setup_assist.py
  • ui/cards/v2_tablet.yaml
  • ui-gallery/default-v2-mobile-aq/card.yaml
  • diagnostics.py
  • tests 2/test_config_flow_sanity.py
  • README.md
  • tests 2/test_runtime_card_sanity.py
  • config_flow.py

Comment thread helpers/setup_assist.py
@senyo888

senyo888 commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

Follow-up pushed in e0ea3e7.

Resolved the setup-assist entity lookup finding by returning unsupported with entity_lookup_failed when entity_reg.async_get raises, while preserving not_found for genuinely unregistered entities.

Validation:

  • python3 "tests 2/test_setup_assist.py" -> 5 setup-assist sanity checks passed
  • git diff --check -> pass
  • python3 -m py_compile helpers/setup_assist.py config_flow.py diagnostics.py -> pass
  • python3 "tests 2/test_config_flow_sanity.py" -> 39 config-flow sanity checks passed
  • python3 "tests 2/test_diagnostics.py" -> 15 diagnostics sanity checks passed
  • scripts/security/scan_secrets.sh tracked -> no leaks found

Runtime/UI impact: advisory setup-assist error classification only. No deterministic lane-ordering, entity semantics, generated UI, migration, restart, or reload impact.

Current PR state: CI is green and CodeRabbit reports no new actionable comments. Ready for merge to develop. No tag, GitHub Release, or main promotion is implied by this PR.

@senyo888
senyo888 merged commit ff5f443 into develop Jul 4, 2026
9 checks passed
senyo888 added a commit that referenced this pull request Jul 4, 2026
Scope: correct release-facing wording now that PR #76 has merged and develop is the v2.0.8 release-review source.

Rationale: remove stale senyo888-patch-1-to-develop language before the later develop-to-main handoff.

Validation: git diff --check; VERSION_GOVERNANCE_BRANCH=develop python3 scripts/check_version_governance.py; python3 scripts/check_proposal_links.py.
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