Skip to content

Promote Humidity Intelligence v2.0.8 to main#77

Merged
senyo888 merged 17 commits into
mainfrom
develop
Jul 4, 2026
Merged

Promote Humidity Intelligence v2.0.8 to main#77
senyo888 merged 17 commits into
mainfrom
develop

Conversation

@senyo888

@senyo888 senyo888 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Promotes Humidity Intelligence v2.0.8 release-candidate work from develop toward main, including Bella’s final release-state wording correction after PR #76 merged.

Scope

Release-promotion PR covering the already-reviewed v2.0.8 candidate on develop: setup guidance, generated dashboard hardening, diagnostics/support sanitization, setup-assist diagnostics, service-boundary hardening, UI Gallery/card updates, tests, and release documentation.

Reason

develop now contains the v2.0.8 candidate and the stale senyo888-patch-1 -> develop release wording has been corrected. This PR prepares the stable release source for main review without publishing a tag or GitHub Release.

Files affected

  • Runtime/config/support code: config_flow.py, sensor.py, services.py, diagnostics.py, const.py, helpers/
  • Services/metadata/translations: manifest.json, services.yaml, strings.json, translations/en.json
  • Docs/release material: README.md, CHANGELOG.md, ARCHITECTURE.md, docs/
  • Generated UI/card surfaces: ui/cards/, ui-gallery/
  • Validation/tests: tests 2/, scripts/

Runtime impact

Deterministic lane ordering is preserved. Entity semantics, output-writer boundaries, AQ priority, CO emergency priority, humidifier independence, and migration shape remain aligned with the existing backend contract.

Global all-entry pause/resume now requires admin context; scoped entry_id calls remain available.

UI impact

Generated V2 dashboards are safer default status/review surfaces. Pause/resume and standalone View Cards workflows remain explicit service/admin paths. The passive Stability preview badge is display-only and does not create sensors, calculate scores, select lanes, or write outputs.

Generated cards and UI Gallery examples were updated.

Migration impact

No breaking migration.

Users should restart Home Assistant after updating package code, then refresh/re-export generated cards or update pasted Manual-card YAML if they use generated V2 card surfaces.

Rollback safety

Rollback is a normal revert to the previous stable release source. No hidden automation path, new output writer, or entity semantic migration is introduced.

Validation performed

  • GitHub PR Prepare v2.0.8 release candidate #76 merged to develop; CI/checks were green.
  • Bella docs slice pushed to develop: 016685f
  • 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
  • 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"
  • python3 "tests 2/test_config_flow_sanity.py"
  • python3 "tests 2/test_setup_assist.py"
  • JSON parse checks for manifest/HACS/strings/translations
  • YAML parse checks for services, ui/cards/, and ui-gallery/

HA Lab advisory evidence

Pass with notes.

Sanitized HA/export evidence showed self_check passing, v205_release_check passing, generated-card entity availability passing with no missing or unknown/unavailable generated entities, diagnostics warnings empty, setup-assist diagnostics available, and diagnostics continuity stable apart from normal telemetry value drift.

HA Lab evidence is advisory only. It does not replace Bella, Aetherwing, AetherCore, Aetherbite, maintainer approval, main promotion review, tag approval, or GitHub Release approval.

Type

  • Fix
  • Feature
  • Documentation
  • UI Gallery
  • Maintenance

Checks

  • PR targets main: this is a develop -> main release-promotion PR.
  • 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. Not performed by Codex; users should refresh/re-export generated cards after update.
  • Docs/changelog updated where needed.
  • Support docs, diagnostics guidance, and issue templates updated where support flow changed.
  • Wiki update status recorded as updated, no-op, or blocked where public support/manual guidance is affected.
  • 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

  • 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.

Summary by CodeRabbit

  • New Features
    • Added read-only setup assistance for telemetry “friendly area name” selection (including preview support) in setup and options flows.
    • Added an updated Stability Score tile to dashboard cards (replacing the prior Pause tile behavior).
    • Added an “External Advisory Queue” section to the issue triage report (advisory-only).
  • Bug Fixes
    • Secret scanning now fails closed when no tracked files are found.
    • Global pause/resume now requires an admin context when applying across all entries.
    • Diagnostics and support/dump outputs are now more compact and sanitized.
  • Documentation
    • Refreshed release/support/contribution guidance for the v2.0.8 line, including clearer upgrade, restart, and generated-dashboard refresh instructions.

senyo888 added 16 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".
Sync main into develop before v2.0.8 release candidate
Prepare v2.0.8 release candidate
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.
@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: a135aa7f-2c5d-48ad-939c-866b58d0d89c

📥 Commits

Reviewing files that changed from the base of the PR and between 016685f and a35f10b.

📒 Files selected for processing (7)
  • diagnostics.py
  • docs/runtime-simulation-validation.md
  • scripts/issue_triage.py
  • services.py
  • tests 2/test_diagnostics.py
  • tests 2/test_issue_triage.py
  • tests 2/test_runtime_card_sanity.py
✅ Files skipped from review due to trivial changes (1)
  • docs/runtime-simulation-validation.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • tests 2/test_issue_triage.py
  • tests 2/test_diagnostics.py
  • services.py
  • scripts/issue_triage.py
  • tests 2/test_runtime_card_sanity.py
  • diagnostics.py

📝 Walkthrough

Walkthrough

This PR ships v2.0.8: Setup Assist onboarding and telemetry flow changes, sanitized diagnostics and services output with admin-gated pause/resume, Stability Score dashboard cards replacing Pause tiles, an advisory maintenance queue for issue triage, and broad documentation and release-metadata updates.

Changes

Documentation, Governance, and Release Metadata

Layer / File(s) Summary
PR template and boundary wording
".github/pull_request_template.md", ARCHITECTURE.md, CONTRIBUTING.md
Rewords advisory evidence, UI-truth, release-boundary, and maintainer-review guidance.
Changelog and manifest version bump
CHANGELOG.md, manifest.json
Adds the v2.0.8 changelog section, updates the v2.0.6 warm-boundary entry, and bumps the integration manifest version to 2.0.8.
README release-line refresh
README.md
Updates README contents, setup guidance, service notes, support/export wording, and release notes for the v2.0.8 line.
Release governance and proposal docs
docs/release-governance.md, docs/proposals/*.md
Reworks release-governance version boundaries, branch responsibilities, and hard gates, and revises the degraded-alert UI proposal scope, privacy, runtime-impact, migration, and approval wording.
Support, runtime-simulation, and legacy docs
docs/support.md, docs/runtime-simulation-validation.md, legacy/README.md
Updates support-redaction guidance, runtime-simulation scope wording, and legacy installation/YAML-warning explanations.

Setup Assist Onboarding Feature

Layer / File(s) Summary
Setup Assist helper module and unit tests
helpers/setup_assist.py, tests 2/test_setup_assist.py
Introduces the helper module for setup-assist suggestions, advisory text, diagnostics summaries, and the dedicated unit tests that exercise registry lookups and fallback behavior.
Config and options flow wiring
config_flow.py, const.py
Adds welcome-first flow ordering, preview actions, Setup Assist-driven telemetry add/edit behavior, slope-source sanitization, and expanded common room selection support.
Setup Assist UI copy
strings.json, translations/en.json
Updates setup-flow and options-flow welcome and telemetry copy, including the friendly area label and staged setup guidance.
Config flow sanity tests
tests 2/test_config_flow_sanity.py
Extends the Home Assistant stubs and adds tests for welcome-first flow ordering, advisory defaults, room dropdown content, and slope-source fallback handling.

Diagnostics and Services Sanitization

Layer / File(s) Summary
Zone mapping duplicate count helpers
helpers/zone_validation.py
Adds privacy-preserving duplicate-count and warning helpers for zone mapping summaries.
diagnostics.py aggregated summary rewrite
diagnostics.py
Replaces raw entity, state, and config exports with aggregated counts, compact summary objects, and new support-oriented helper functions.
services.py support summaries and admin gating
services.py
Adds admin-user enforcement for entry-less pause/resume, replaces dump-diagnostics output with condensed support summaries, broadens release-check version handling, and updates duplicate-summary usage.
sensor.py wiring and services.yaml descriptions
sensor.py, services.yaml
Switches sensor duplicate summaries to the count-based helper and updates service descriptions for sanitized diagnostics, release-check range, and admin-context pause/resume handling.
Diagnostics and services test coverage
tests 2/test_diagnostics.py, tests 2/test_runtime_card_sanity.py
Extends diagnostics and runtime tests with registry stubs, sanitized count assertions, duplicate-zone redaction checks, setup-assist warnings, and admin pause/resume coverage.

Dashboard Stability Score UI Update

Layer / File(s) Summary
UI contract documentation for passive Stability Score
ui/README.md
Updates the UI README to keep control logic in the backend engine and describe Stability Score and output-details behavior as UI-only.
Stability Score card replacing Pause tile
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, ui/cards/view_cards_button.yaml
Replaces the Pause tile with a sensor.hi_diagnostics Stability Score gauge card, adjusts styling, updates export instructions, and disables the view-cards button tap action.
Card sanity tests for Stability badge and public surfaces
tests 2/test_runtime_card_sanity.py
Adds YAML extraction helpers and tests that the public card surfaces stay passive, use the expected toggle actions, and reflect the updated export and release-visibility wording.

Issue Triage Advisory Queue and Secret Scan Hardening

Layer / File(s) Summary
Issue triage documentation updates
docs/issue-triage.md
Updates issue-triage documentation to describe report-only behavior, the external advisory queue, and advisory-only community idea wording.
Maintenance advisory queue parser and report rendering
scripts/issue_triage.py
Adds queue dataclasses, restricted YAML parsing and validation, report rendering, atomic confined output writes, and CLI wiring for the optional maintenance queue.
Secret scan fail-closed guard
scripts/security/scan_secrets.sh
Adds the tracked-mode scanned-files guard and exits before gitleaks runs when no tracked files are found.
Issue triage and workflow regression tests
tests 2/test_issue_triage.py, tests 2/test_workflows.py
Adds tests for advisory-queue rendering, malformed queue warnings, path safety, atomic writes, and tracked secret-scan behavior.

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

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ConfigFlow
  participant SetupAssist as helpers/setup_assist.py
  participant HARegistries

  User->>ConfigFlow: Add telemetry sensor
  ConfigFlow->>SetupAssist: setup_assist_suggestion(hass, entity_id)
  SetupAssist->>HARegistries: async_get(entity/area/device/label)
  HARegistries-->>SetupAssist: metadata or failure
  SetupAssist-->>ConfigFlow: SetupAssistSuggestion(room, level, labels, warnings)
  ConfigFlow-->>User: Show advisory defaults (Save/Preview/Cancel)
  User->>ConfigFlow: Save
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the release-promotion change to move Humidity Intelligence v2.0.8 to main.
Description check ✅ Passed The description follows the template and includes concrete content for scope, impact, validation, HA Lab evidence, and UI gallery changes.
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 develop

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: 5

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

1428-1456: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

main() only catches OSError, not the ValueError raised by _resolve_report_path.

If --output resolves outside the repo, _write_report raises ValueError, which propagates uncaught out of main() (only OSError is handled around the call), producing a raw traceback instead of the clean error path used for other write failures.

♻️ Proposed fix
     try:
         _write_report(output_path, report)
-    except OSError as exc:
+    except (OSError, ValueError) as exc:
         print(f"Could not write triage report: {exc}", file=sys.stderr)
         return 1
🤖 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 1428 - 1456, The report write path
validation in _resolve_report_path can raise ValueError for paths outside the
repository, but main() only handles OSError around _write_report. Update the
error handling at the call site in main() so the same clean failure path is used
for both OSError and ValueError, or normalize the exception type raised by
_resolve_report_path/_write_report so invalid --output paths are reported
without a raw traceback.

405-483: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

No duplicate-id detection across queue files.

_action_from_data validates id format per-file but load_maintenance_action_queue never checks for duplicate ids across multiple files in the directory, so two files with the same HI-MRQ-... id would both render as separate actions with no warning.

♻️ Proposed fix
     actions: list[MaintenanceAction] = []
     warnings: list[str] = []
+    seen_ids: set[str] = set()
     action_files = sorted({*queue_dir.glob("*.yaml"), *queue_dir.glob("*.yml")})
     for path in action_files:
         try:
             data = _parse_simple_action_yaml(path.read_text(encoding="utf-8"))
             action, action_warnings = _action_from_data(path, data)
         except (OSError, ValueError) as exc:
             warnings.append(f"{path.name}: could not parse action file: {exc}")
             continue
         warnings.extend(action_warnings)
-        if action is not None:
+        if action is not None and action.id in seen_ids:
+            warnings.append(f"{path.name}: duplicate action id: {action.id}")
+        elif action is not None:
+            seen_ids.add(action.id)
             actions.append(action)
🤖 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 405 - 483, Add cross-file duplicate ID
detection to the maintenance queue loading flow: `_action_from_data` only
validates the per-file `id` format, so extend `load_maintenance_action_queue` to
track seen `MaintenanceAction.id` values while iterating files and emit a
warning when the same `HI-MRQ-...` id appears more than once. Keep the existing
`_action_from_data` validation as-is, but ensure duplicate IDs are rejected or
warned before returning the final queue so only one action per id is accepted.

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

Inline list parsing splits naively on , and won't handle quoted values containing commas.

_parse_yaml_scalar's [...] branch does inner.split(","), so a value like ["a, b", "c"] would be incorrectly split into three items. Given this is a documented minimal YAML subset for maintainer-authored files, low risk, but worth a comment noting the limitation.

🤖 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 301 - 317, The inline-list parsing in
_parse_yaml_scalar currently splits on commas with inner.split(",") and cannot
handle quoted items containing commas. Update the [..] branch to either
implement proper tokenization for quoted list items or, if you keep the current
minimal parser, add an explicit comment/documentation near _parse_yaml_scalar
explaining that quoted commas are unsupported; reference _parse_yaml_scalar and
its inline-list handling so the limitation is clear.
diagnostics.py (2)

246-276: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor DRY nit: active_alert_resolution is recomputed instead of reused from diagnostics_summary.

_runtime_summary recomputes _alert_resolution_summary(runtime_data.get("alert_telemetry", [])) on Line 262 even though the identical value is already available at diagnostics_summary["active_alert_resolution"] (computed in _diagnostics_summary, Line 451) and is already reused for unavailable_or_unknown_entities a few lines below. Pulling from diagnostics_summary here would remove the duplicate computation.

🤖 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 246 - 276, In _runtime_summary,
active_alert_resolution is being recomputed from runtime_data instead of reusing
the value already assembled in diagnostics_summary. Update the _runtime_summary
return payload to read active_alert_resolution from
diagnostics_summary["active_alert_resolution"] the same way
unavailable_or_unknown_entities and warnings are reused, so the summary stays
DRY and uses the existing _diagnostics_summary output.

578-583: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the unused _lane_outputs helper
_output_states and _lane_output_summary now cover this path, and _lane_outputs no longer has any callers. Dropping it keeps the module smaller and avoids dead helper 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 578 - 583, Remove the dead `_lane_outputs`
helper from `diagnostics.py` since it has no remaining callers and is now
superseded by `_output_states` and `_lane_output_summary`. Delete the
`_lane_outputs` function definition and ensure any lingering references are
updated or removed so the module only keeps the active output-summary path.
services.py (1)

1000-1005: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Duplicate of diagnostics.py's _count_by.

_count_config_rows is functionally identical to diagnostics.py's _count_by (same key-counting logic). Worth consolidating into a shared helper module alongside the zone-duplicate summarizers to avoid drift between the two counting implementations.

🤖 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 `@services.py` around lines 1000 - 1005, The `_count_config_rows` helper
duplicates the key-counting logic already implemented in `diagnostics.py`’s
`_count_by`, so consolidate both into a shared helper used by `services.py` and
the diagnostics code. Move the counting logic into the existing shared helper
module alongside the zone-duplicate summarizers, then update
`_count_config_rows` to delegate to that shared function instead of
reimplementing the loop. Keep the external behavior the same, and use the
existing `_count_by` symbol as the source of truth for this counting behavior.
helpers/zone_validation.py (1)

34-43: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the unused raw zone-duplicate formatter. summarize_zone_mapping_duplicates has no remaining call sites, so keeping it around only preserves a raw entity-ID string builder with no current use.

🤖 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/zone_validation.py` around lines 34 - 43,
summarize_zone_mapping_duplicates is unused and should be removed from
helpers/zone_validation.py. Delete the function entirely and also remove any
now-unused typing imports or related references so the module stays clean; if
any callers exist elsewhere, update them to stop relying on this raw duplicate
formatter and use the remaining zone validation flow instead.
🤖 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 `@diagnostics.py`:
- Around line 597-609: The empty-state handling in _entity_status_summary is
inconsistent with _entity_status_bucket, causing blank state strings to be
counted as available instead of unknown. Update _entity_status_summary to treat
empty or whitespace-only state_text the same way as _entity_status_bucket does,
and apply the same normalization in _support_state_summary so the diagnostics
and support summaries classify entity states consistently.

In `@docs/runtime-simulation-validation.md`:
- Around line 4-6: The description in this section overstates the harness as
“production validation infrastructure,” which conflicts with its local/test-only
scope. Update the wording in the runtime-simulation validation text to use a
local-validation label or similarly narrow phrasing, and keep the surrounding
references to deterministic fake telemetry, V2.1 display fixtures, HA Lab
evidence, and live Home Assistant runtime validation clearly separated from this
local surface.

In `@scripts/issue_triage.py`:
- Around line 27-29: The triage report currently renders queue.source_dir
directly, which can leak local absolute paths even though _public_safety_issue
only checks parsed queue actions. Update the source_dir handling in
issue_triage.py so the value is normalized relative to REPO_ROOT or otherwise
sanitized before it is used in the report rendering path that builds the
“Source:” line. Make the fix in the queue/report flow around the queue object
and the rendering logic that references queue.source_dir, and ensure the
resulting output cannot contain a local absolute path.

In `@services.py`:
- Around line 911-927: _update `_support_state_summary` to treat an empty
`state.state` the same as `"unknown"` instead of counting it as available; the
current logic in `services.py` only checks for `"unknown"` and `"unavailable"`,
so add the empty-string case in the same branch. Since this duplicates
`diagnostics.py`’s `_entity_status_summary`, consider moving both summaries to a
shared helper (for example in `zone_validation.py`) and have
`_support_state_summary` call that shared function so the fix is centralized.

In `@tests` 2/test_issue_triage.py:
- Around line 250-258: The
`test_public_safety_rejects_cross_platform_local_paths` loop is not fully
wrapped by the `subTest` context because the `assertEqual` call sits outside it,
so move the assertion inside the `with self.subTest(local_path=local_path)`
block. This keeps each `local_path` case isolated and ensures failures are
reported per subtest while preserving the existing
`self.triage._public_safety_issue` check.

---

Nitpick comments:
In `@diagnostics.py`:
- Around line 246-276: In _runtime_summary, active_alert_resolution is being
recomputed from runtime_data instead of reusing the value already assembled in
diagnostics_summary. Update the _runtime_summary return payload to read
active_alert_resolution from diagnostics_summary["active_alert_resolution"] the
same way unavailable_or_unknown_entities and warnings are reused, so the summary
stays DRY and uses the existing _diagnostics_summary output.
- Around line 578-583: Remove the dead `_lane_outputs` helper from
`diagnostics.py` since it has no remaining callers and is now superseded by
`_output_states` and `_lane_output_summary`. Delete the `_lane_outputs` function
definition and ensure any lingering references are updated or removed so the
module only keeps the active output-summary path.

In `@helpers/zone_validation.py`:
- Around line 34-43: summarize_zone_mapping_duplicates is unused and should be
removed from helpers/zone_validation.py. Delete the function entirely and also
remove any now-unused typing imports or related references so the module stays
clean; if any callers exist elsewhere, update them to stop relying on this raw
duplicate formatter and use the remaining zone validation flow instead.

In `@scripts/issue_triage.py`:
- Around line 1428-1456: The report write path validation in
_resolve_report_path can raise ValueError for paths outside the repository, but
main() only handles OSError around _write_report. Update the error handling at
the call site in main() so the same clean failure path is used for both OSError
and ValueError, or normalize the exception type raised by
_resolve_report_path/_write_report so invalid --output paths are reported
without a raw traceback.
- Around line 405-483: Add cross-file duplicate ID detection to the maintenance
queue loading flow: `_action_from_data` only validates the per-file `id` format,
so extend `load_maintenance_action_queue` to track seen `MaintenanceAction.id`
values while iterating files and emit a warning when the same `HI-MRQ-...` id
appears more than once. Keep the existing `_action_from_data` validation as-is,
but ensure duplicate IDs are rejected or warned before returning the final queue
so only one action per id is accepted.
- Around line 301-317: The inline-list parsing in _parse_yaml_scalar currently
splits on commas with inner.split(",") and cannot handle quoted items containing
commas. Update the [..] branch to either implement proper tokenization for
quoted list items or, if you keep the current minimal parser, add an explicit
comment/documentation near _parse_yaml_scalar explaining that quoted commas are
unsupported; reference _parse_yaml_scalar and its inline-list handling so the
limitation is clear.

In `@services.py`:
- Around line 1000-1005: The `_count_config_rows` helper duplicates the
key-counting logic already implemented in `diagnostics.py`’s `_count_by`, so
consolidate both into a shared helper used by `services.py` and the diagnostics
code. Move the counting logic into the existing shared helper module alongside
the zone-duplicate summarizers, then update `_count_config_rows` to delegate to
that shared function instead of reimplementing the loop. Keep the external
behavior the same, and use the existing `_count_by` symbol as the source of
truth for this counting behavior.
🪄 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: b50f4869-53df-4a28-81cb-7700d48bdbe4

📥 Commits

Reviewing files that changed from the base of the PR and between 8c4bfeb and 016685f.

📒 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 diagnostics.py
Comment thread docs/runtime-simulation-validation.md Outdated
Comment thread scripts/issue_triage.py
Comment thread services.py
Comment thread tests 2/test_issue_triage.py Outdated
Scope: fix validated CodeRabbit actionable findings for diagnostics/support state summaries, advisory queue source redaction, runtime simulation wording, and issue-triage subTest isolation.

Runtime impact: no lane ordering, entity semantics, output writer, service contract, or migration change; diagnostics/support summaries now classify blank HA states as unknown.

Validation: python3 tests 2/test_diagnostics.py; python3 tests 2/test_issue_triage.py; python3 tests 2/test_runtime_card_sanity.py; git diff --check; python3 -m py_compile diagnostics.py services.py scripts/issue_triage.py; VERSION_GOVERNANCE_BRANCH=develop python3 scripts/check_version_governance.py; python3 scripts/check_proposal_links.py; scripts/security/scan_secrets.sh tracked.
@senyo888
senyo888 merged commit 632c74a into main Jul 4, 2026
11 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.

1 participant