Summary
Migrate pkg/cli and pkg/api/server.go from constructing recipe.Builder / bundler.Bundler / validator.Validator directly to consuming the github.com/NVIDIA/aicr facade landed in #1072.
Motivation
After #1072 lands the facade, the repository carries three independent wiring paths:
| Caller |
Mechanism |
Source |
| CLI |
recipe.SetDataProvider (process-global, deprecated) |
pkg/cli/root.go:382, 396 (//nolint:staticcheck // tracked by #983 Stage 2) |
| REST server |
recipe.NewBuilder + bundler.New directly |
pkg/api/server.go:85-91 |
| Facade |
recipe.WithDataProvider(dp) + per-Client isolation |
aicr.go:180 |
Every change to wiring policy (new constructor option, new pre-flight, new lifecycle hook) has to be applied in all three places. Per CLAUDE.md — "business logic lives in functional packages so CLI and API can both use it" — the facade should be the single aggregation point; CLI and REST become thin presentation layers over aicr.Client.
CLI is also still on the deprecated global-state path; migrating onto aicr.Client retires it.
Acceptance
Out of scope
Related
Summary
Migrate
pkg/cliandpkg/api/server.gofrom constructingrecipe.Builder/bundler.Bundler/validator.Validatordirectly to consuming thegithub.com/NVIDIA/aicrfacade landed in #1072.Motivation
After #1072 lands the facade, the repository carries three independent wiring paths:
recipe.SetDataProvider(process-global, deprecated)pkg/cli/root.go:382, 396(//nolint:staticcheck // tracked by #983 Stage 2)recipe.NewBuilder+bundler.Newdirectlypkg/api/server.go:85-91recipe.WithDataProvider(dp)+ per-Client isolationaicr.go:180Every change to wiring policy (new constructor option, new pre-flight, new lifecycle hook) has to be applied in all three places. Per
CLAUDE.md— "business logic lives in functional packages so CLI and API can both use it" — the facade should be the single aggregation point; CLI and REST become thin presentation layers overaicr.Client.CLI is also still on the deprecated global-state path; migrating onto
aicr.Clientretires it.Acceptance
pkg/cli/root.gono longer callsrecipe.SetDataProvider; bootstraps anaicr.Clientper command invocation.pkg/api/server.goconstructsaicr.Clientinstances (one per recipe-source configuration), notrecipe.Builder/bundler.Bundlerdirectly.make qualifyclean).Out of scope
pkg/recipe'sSetDataProvider/GetDataProvider— that's feat(recipe): deprecate SetDataProvider / GetDataProvider globals #987.Related