Is your feature request related to a problem? Please describe.
The built-in environment provisioner (envprov) is hardcoded into the generate command and always resolves variables via os.LookupEnv. In internal/command/generate.go:
environmentProvisioner := new(envprov.Provisioner)
loadedProvisioners = append(loadedProvisioners, environmentProvisioner)
There's no way for a developer to say "use a .env file for local dev" or "use AWS SSM in production." Which provisioner handles environment resources is silently determined by ordering in the list (slices.IndexFunc returns the first match), making it hard to debug or override.
Describe the solution you'd like
Promote envprov to a first-class, loadable provisioner type the same way templateprov and cmdprov already work. The provisioner loader in internal/provisioners/loader/load.go currently handles template:// and cmd:// URI schemes. Adding a local-env:// scheme would let the loader parse and load environment provisioners from the existing .provisioners.yaml files.
For example, a developer could define this in their provisioners file:
- uri: local-env://default-provisioners/environment
type: environment
description: Pulls values out of the local environment as outputs to an environment resource
The built-in `os.LookupEnv` behavior should stay as the default when nothing is configured, so existing Score files keep working as-is.
**Describe alternatives you've considered**
1. **Writing a community provisioner for each source** Works today (e.g. the `dotenv` provisioner), but the selection between built-in and community is still implicit and order-dependent.
2. **Removing the built-in provisioner entirely** Would break backward compatibility for users relying on the current `os.LookupEnv` default.
3. **Keeping things as they are** Functional, but the "magic" resolution gets harder to reason about as more community provisioners are added.
**Additional context**
Came out of the discussion in #483 @chris-stephenson pointed out that while the `environment` resource type is "special," the provisioner backing it shouldn't be magic and should be overridable. The current [`envprov.Provisioner`](https://github.com/score-spec/score-compose/blob/main/internal/provisioners/envprov/envprov.go) matches any resource with `type == "environment"` and `class == "default"`, and defaults its `LookupFunc` to `os.LookupEnv` none of which the developer can change.
Is your feature request related to a problem? Please describe.
The built-in
environmentprovisioner (envprov) is hardcoded into thegeneratecommand and always resolves variables viaos.LookupEnv. Ininternal/command/generate.go:There's no way for a developer to say "use a
.envfile for local dev" or "use AWS SSM in production." Which provisioner handlesenvironmentresources is silently determined by ordering in the list (slices.IndexFuncreturns the first match), making it hard to debug or override.Describe the solution you'd like
Promote
envprovto a first-class, loadable provisioner type the same waytemplateprovandcmdprovalready work. The provisioner loader ininternal/provisioners/loader/load.gocurrently handlestemplate://andcmd://URI schemes. Adding alocal-env://scheme would let the loader parse and load environment provisioners from the existing.provisioners.yamlfiles.For example, a developer could define this in their provisioners file: