Skip to content

refactor(integration): make Hypercolor first class in Home Assistant - #5

Open
hyperb1iss wants to merge 11 commits into
mainfrom
nova/thermonuclear-quality
Open

refactor(integration): make Hypercolor first class in Home Assistant#5
hyperb1iss wants to merge 11 commits into
mainfrom
nova/thermonuclear-quality

Conversation

@hyperb1iss

Copy link
Copy Markdown
Owner

💎 Summary

This rebuilds the integration around a single typed Hypercolor runtime instead
of parallel coordinator dictionaries and downstream wire reconstruction.

  • Projects one immutable snapshot across state, catalog, devices, audio, and
    push telemetry.
  • Exposes the complete effect-scoped preset stack, including bundled and saved
    presets, collision-safe labels, and modified-preset state.
  • Makes master power a true pause and resume contract while keeping destructive
    Stop as a separate idempotent action.
  • Reconciles live device discovery into child devices and device controls, with
    availability tied to current snapshot membership.
  • Routes daemon capability and authorization checks through the public Python
    client. Raw HTTP remains only for server identity, which the SDK does not yet
    expose at its high-level boundary.

🌊 Runtime and WebSocket behavior

The integration subscribes before its initial refresh, retains the typed hello
capabilities, intersects optional channels, and treats resync messages as an
ordering barrier. State-bearing daemon event families trigger refreshes while
high-frequency telemetry stays on direct typed update paths.

Snapshot and WebSocket health share one source-aware outage model. Availability
and repair creation use the same stable deadline, changing retry messages cannot
extend an outage, and healthy push traffic does not churn the repair registry.
Unexpected integration exceptions remain programmer errors instead of being
misreported as daemon outages.

🛡️ Control and release safety

  • All integration services require an administrator.
  • Effect upload validates allowed roots, file type, size, symlink behavior, and
    path replacement races.
  • Service registration, YAML schemas, translations, manifest versions, and
    dependency requirements are checked as executable metadata contracts.
  • Release planning is typed and fail closed. Main and the version tag publish
    atomically after the complete verification suite passes.
  • CI actions use immutable SHAs, workflow shell is checked by actionlint and
    ShellCheck, and authenticated SDK fetches keep long Basic auth headers on one
    line.
  • A dedicated no-sources job proves compatibility with the published
    hypercolor==0.3.2 package.

🧪 Verification

  • just verify: 96 passed, 1 explicit live-daemon skip, 82.02% coverage
  • Ruff check and format: passed
  • ty: passed
  • integration metadata contract: passed
  • wheel and source distribution builds: passed
  • actionlint 1.7.12 with ShellCheck 0.11.0: passed
  • independent thermonuclear maintainability review: PASS

The live-daemon smoke test remains opt-in and was not run. No daemon or Home
Assistant service was started or restarted for this change.

hyperb1iss and others added 11 commits August 12, 2026 01:27
Keep Git-Iris release notes while moving release-state decisions into a
typed planner shared by create and resume paths. Validate release inputs
before a single atomic main-and-tag push.

Pin external actions, share Hypercolor setup, and add workflow, shell,
and published-package compatibility gates to CI.

Co-Authored-By: Nova (GPT-5.4) <noreply@openai.com>
Co-Authored-By: Stefanie Jane <stef@hyperbliss.tech>
Replace the parallel coordinator maps and defensive field readers with one
typed snapshot owned by the config entry runtime. Route every mutation
through a shared refresh boundary and preserve idempotent effect stopping.

Project first-class effect presets, zones, device state, diagnostics, and
telemetry from the SDK models. Split the Home Assistant harness into focused
contract, lifecycle, and daemon-backed scenarios so failures stay local.

Co-Authored-By: Nova (Codex) <noreply@openai.com>
Document the effect-scoped preset contract, optional telemetry entities,
and the complete Home Assistant automation service set.

Repair end-to-end recipes after the harness split and make the full test
recipe enforce the project coverage floor.

Co-Authored-By: Nova (GPT-5.4) <noreply@openai.com>
The typed runtime owns one authoritative snapshot, so state, catalog, and
device event categories no longer represented different refresh paths.
Use one exact allowlist and prove telemetry plus refresh handling together.

Remove the stale config-flow test module after its contracts moved into the
Home Assistant flow suite.

Co-Authored-By: Nova (Codex) <noreply@openai.com>
A long-lived healthy connection could become unavailable immediately after
its first REST failure because grace was measured from the last success and
CoordinatorEntity bypassed the explicit connection policy.

Track one disconnect timestamp per source, derive every entity deadline from
that clock, and keep changing retry errors from extending the grace period.
WebSocket repair state follows the same authority as entity availability.

Co-Authored-By: Laplace (Codex verifier) <noreply@openai.com>
Co-Authored-By: Nova (Codex) <noreply@openai.com>
Daemon discovery still needs one raw identity request because the public SDK
has no get_server method. Route output-power capability and authorization
checks through HypercolorClient so transport, auth, models, and errors share
the same contract as the loaded integration.

Co-Authored-By: Laplace (Codex verifier) <noreply@openai.com>
Co-Authored-By: Nova (Codex) <noreply@openai.com>
Device controls could remain available after discovery removed their backing
device, and hub action buttons ignored daemon availability entirely.

Share one coordinator-backed device entity base across lights, switches, and
buttons. All controls now follow the typed runtime and live snapshot.

Co-Authored-By: Laplace (Codex verifier) <noreply@openai.com>
Co-Authored-By: Nova (Codex) <noreply@openai.com>
Snapshot failures raised repairs before their grace expired. Push traffic
churned repair state. The WebSocket router missed events, leaving Home
Assistant stale with polling off.

Use one repair deadline for both transports, gated by health transitions.
Refresh state event families. Classify only SDK failures as outages.

Co-Authored-By: Laplace (Codex verifier) <noreply@openai.com>
Co-Authored-By: Nova (Codex) <noreply@openai.com>
The source checkout recipe placed Hypercolor above the sibling path consumed
by uv, and the Python requirement implied unsupported 3.15 compatibility.
Keep both repositories adjacent and state the actual Python 3.14 range.

Co-Authored-By: Laplace (Codex verifier) <noreply@openai.com>
Co-Authored-By: Nova (Codex) <noreply@openai.com>
GNU base64 wraps a realistic GitHub token across multiple lines, which makes
libcurl reject the optional authenticated SDK fetch. Strip encoded newlines
and lock the behavior with a long-token regression test.

Co-Authored-By: Laplace (Codex verifier) <noreply@openai.com>
Co-Authored-By: Nova (Codex) <noreply@openai.com>
GitHub runners do not include just, so both source-backed verification
and the isolated PyPI compatibility lane failed before reaching project
gates. Install the same pinned runner through uv in both environments.
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