Skip to content

Peripherals v1: SDK 0.3.0 runtime - #10

Merged
MarkParker5 merged 51 commits into
developfrom
feature/sdk-runtime
Oct 29, 2026
Merged

MarkParker5 merged 51 commits into
developfrom
feature/sdk-runtime

Conversation

@MarkParker5

Copy link
Copy Markdown
Member

Part of the peripherals v1 wave (SDK 0.3.0): one Peripheral protocol for every radio, service, provider and integration, a frozen shared Platform, runtime-owned lifecycle and retries, and typed static keys (Need[T], SettingsExtraField, ComposeService).

  • Ported to the SDK 0.3.0 peripheral API: peripherals(platform) entry point, self.platform / self.output, typed needs

Needs majordom-integration-sdk 0.3.0 on PyPI: CI installs the released SDK, so it stays red until the SDK PR is merged and released. Merge and release order: SDK → integrations → Hub.

Reviewed.

The checklist asks for every external thing as a need, read from
self.peripherals, and app services from self.platform.
The SDK needs it (type parameter defaults). CI tests 3.13 only.
The package exports peripherals(platform): the server it provides and
the controller that needs it. Settings are the controller's typed nested
model, applied in place; the controller no longer restarts the server.
Platform facts replace the context (platform_facts_did_change), the
tests set a recording output on the controller and seed devices under
its key.
The bound-needs fixture is renamed to bound, so it no longer shadows
the package's peripherals().
The settings hook no longer raises on the lost connection, which made
the runtime count an outage it heals by itself as a failure.
The runtime stops a controller whose start failed and starts the same
object again later: stop() now finds no keeper or connection instead of
raising, and leaves the object as the constructor did.
The platform facts hook asked for a restart on any change: a Thread
network learned or a new Wi-Fi network restarted the integration for a
fact it never reads.
A server restarted on purpose (recreated with new settings) is usually
back by the first attempt, so it no longer flashes an error in the app.
Anything but a lost connection ended the keeper silently: the
integration stayed running without hearing the server, and stop()
raised the error before closing the connection. The keeper now reports
an error that isn't still running, which the runtime turns into a
restart.
Its greeting goes into its compose command, so a change recreates the
container and the controller reconnects instead of restarting.
A required field makes the controller impossible to build, so the user
never gets to enter it.
A newline in it reached the server as a second protocol command.
The constructor's Settings annotation no longer needs the future
import, and every public name comes from the SDK's top level.
List every output call, point at the virtual server as the worked
example, and drop the TODO bodies and capability fakes that are gone.
The dev runner the package docstring offers needs the runtime extra,
and the tests run the controller under the runtime too.
The comment said the template ignores poetry.lock; it tracks it.
@MarkParker5
MarkParker5 merged commit 3e1ed36 into develop Oct 29, 2026
5 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