refactor: declare the profile fields each provider consumes, once
Merged
AM
2mo ago+886+886+012345678901234567890123456789-82-82-01234567890123456789
Summary
Split out of #3118 and stacked on #3165. Please review only the top three commits. This is the single consumed-field admission you asked us to keep in core.
- A new
@agent-device/contracts/provider-profile-fieldsexport holds:ProviderProfileFieldDeclaration, a full consumed/refused record over the profile fields.rejectRefusedProviderProfileFields.
- Each provider declares the fields it consumes: BrowserStack, AWS Device Farm (
CLOUD_WEBDRIVER_PROFILE_FIELDS) and Limrun (LIMRUN_PROFILE_FIELDS). The runtime'sprofileFieldsis required. - That one declaration is enforced on connect, direct
leases.allocate, remote-config, and repeat allocation of a live lease. - If a repeat allocation fails, the reused lease is no longer released.
- Review nit [1]:
PROVIDER_PROFILE_FIELD_FLAGSis the single field-to-flag map, and the BrowserStack device-feature specs derive their flags from it.
Behaviour changes (nit [5]): flags that were silently ignored are now refused:
- AWS Device Farm refuses
--provider-app,--provider-os-version(and its--os-versionalias),--provider-projectand--provider-build. - BrowserStack refuses
--aws-*. - Limrun refuses every flag except
--provider-app.
None of the documented examples or help text use a refused flag.
Validation
pnpm check:affected --runpasses, including replay-compat with release tags fetched.eager-closure-budgetspasses.
🤖 Generated with Claude Code