fix(daemon): refuse leases for providers without a registered runtime
Merged
TH
12h ago+216+216+012345678901234567890123456789-43-43-01234567890123456789
Summary
leases.allocate with a leaseProvider that no registered runtime claims now fails before any lease is recorded: UNSUPPORTED_OPERATION, details.reason: 'provider-not-registered', details.provider, details.registeredProviders. Previously only the hard-coded required list was checked, so a plugin provider such as testmu on a daemon without the plugin recorded a lease with no device behind it.
leaseProviderRequiringRuntimeinpackages/contracts/src/lease-scope.tsis the one classifier. Provider-less leases (including backend-only),proxyandcloud(newCLOUD_LEASE_PROVIDER, used bycloud-profile.ts) need no runtime; every other id must be registered.- The admission site no longer compares provider names. The now-unread
providerRuntimeRequiredIdsplumbing is removed from the lease handler, request chain and router. The list itself andcreateProviderDeviceRuntimeRequestProvidersare left for #3767. - Heartbeat and release are unchanged. Help,
plugins.mdandclient-api.mdname the reason. - 19 files; tests that allocated provider leases without registering the runtime now register it.
Validation
pnpm check:affected --run --head 9923eec046: all runnable checks passed (exactCommit=true). Provider integration suite: 65 files pass, including a testmu refusal with no lease in the registry. Unit tests cover each exemption (provider-less, backend-only, proxy, cloud). Not device-facing.
🤖 Generated with Claude Code