Skip to content

[SDK-005] Add deployment-aware config models #7

Description

@AdeGneus

Context

CLI and Gateway consumers need typed deployment context (pi, phone, server) so diagnostics and capability decisions do not rely on string matching.

Scope

  • Create ori_sdk/device_config.py.
  • Define DeploymentType enum and DeviceConfig dataclass.
  • Add from_health_status(status) -> DeviceConfig.
  • Update helper output where deployment type affects tiers.

Non-Goals

  • Does not parse full ori.yaml.
  • Does not change runtime config semantics.

Technical Specification

DeploymentType values are PI, PHONE, and SERVER. Phone deployments cap available physical actuation tiers; server deployments may not expose GPIO.

Acceptance Criteria

  • Typed enum exists.
  • Health-derived config handles missing fields.
  • Deployment constraints are tested.
  • pytest, mypy, and ruff pass.

Tests Required

Test Verifies
test_deployment_type_values Enum values are stable.
test_from_health_status Health payload maps to config.
test_phone_caps_physical_tiers Phone constraints reflected.

Additional Test Coverage / Edge Cases

  • Parse deployment type case-insensitively only if the contract permits it; otherwise reject unknown casing.
  • Reject unknown deployment types instead of silently defaulting to Pi/server.
  • Verify phone deployment constraints cap physical actuation capabilities.
  • Verify server deployment does not imply GPIO/relay availability.
  • Handle missing timezone/location fields from health payload with explicit defaults or typed errors.

Invariants — Do Not Violate

  • SDK mirrors deployment contracts; runtime remains source of truth.

Dependencies

Blocked by:

  • Nothing

Unblocks:

Contract References

  • Runtime device.deployment_type config
  • SDK health models

Priority

poc-critical

Suggested Labels

ready, poc-critical

Metadata

Metadata

Assignees

No one assigned

    Labels

    poc-criticalMust be complete before PoC deployment.readyAll dependencies met. Can be picked up now.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions