Skip to content

feat(carport): dynamic driver management via main.pkl#7

Merged
fdatoo merged 11 commits intomainfrom
feat/dynamic-carport-management
May 1, 2026
Merged

feat(carport): dynamic driver management via main.pkl#7
fdatoo merged 11 commits intomainfrom
feat/dynamic-carport-management

Conversation

@fdatoo
Copy link
Copy Markdown
Owner

@fdatoo fdatoo commented May 1, 2026

Summary

  • Adds binary field to DriverInstance Pkl class and DriverInstanceConfig proto, flowing through the evaluation pipeline so driver executables can be declared in main.pkl
  • Implements RegisterInstance / UnregisterInstance on carport.Host using the existing launchLifecycle / shutdownInstance machinery; returns an error on duplicate IDs
  • Wires carport.Host as the real CarportManager in the daemon, replacing the nopCarportManager stub; adds a compile-time interface assertion
  • Removes the static drivers.toml loading path entirely — main.pkl is now the sole driver config source; updates integration test to seed instances via RegisterInstance

Test plan

  • task build — passes
  • task test — all packages green
  • task test:race — no races (one pre-existing flaky test in internal/mcp/resources also fails on main)
  • task test:integration — passes
  • ./dist/gohomed --help | grep drivers-toml — no output (flag removed)
  • Declare a driver instance in main.pkl with a binary path and confirm the daemon spawns it (smoke test from the plan)

Known limitations / follow-up

  • Dynamically registered instances always use defaultLifecycleConfig() — lifecycle tuning from Pkl is a follow-up
  • Existing drivers.toml users must migrate entries to main.pkl before upgrading (no migration path provided)
  • driverName is accepted by RegisterInstance but not stored on Instance (no field for it yet) — tracked as follow-up debt

🤖 Generated with Claude Code

fdatoo and others added 11 commits May 1, 2026 02:12
…stanceConfig proto

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add ctx field to Host struct, store it in Start, and implement
RegisterInstance and UnregisterInstance for dynamic driver lifecycle
management. Includes TDD tests covering not-started, duplicate ID,
stopped-host, and not-found error paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…config source

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fdatoo fdatoo merged commit 8b468c2 into main May 1, 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